context-handoff

context-handoff is a skill for Claude Code from OXI-717/ai-native-toolkit. It costs 97 tokens per session (2,167 once invoked), scanned D, original, MIT.

A context-saving system for coding-agent sessions. It records important work in a HANDOFF.md file before a session is shortened or cleared, then restores it afterward.

In plain words
What is it for?
Use it to save progress manually, restore a previous session, and keep work understandable across context compaction or clearing.
Why use it?
It helps prevent the agent from losing decisions, progress, and task details when the conversation reaches its context limit or is restarted.

Skill for Claude Code

Written for Claude Code: PreCompact hook event. Also seen: reads .claude/ paths; mentions Claude Code; mentions Codex.

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/alex/work/repo.

Part of the context-handoff plugin — 1 skill, 1 command shipped together

Good fit Use it to save progress manually, restore a previous session, and keep work understandable across context compaction or clearing.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add OXI-717/ai-native-toolkit
Claude Code
/plugin install context-handoff

Made for: Claude Code.

Or install context-handoff, the plugin that ships this one along with the rest of its 1 skill, 1 command.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for context-handoff

README.md
[![agentmods](https://agentmods.dev/badge/skills/oxi-717/ai-native-toolkit/context-handoff.svg)](https://agentmods.dev/skills/oxi-717/ai-native-toolkit/context-handoff)
Your own site
<a href="https://agentmods.dev/skills/oxi-717/ai-native-toolkit/context-handoff"><img src="https://agentmods.dev/badge/skills/oxi-717/ai-native-toolkit/context-handoff.svg" alt="Measured on agentmods" height="20"></a>
Per session 97 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,167 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00097 $0.02167
Opus 5 $0.00048 $0.01084
Sonnet 5 $0.00019 $0.00433
Haiku 4.5 $0.00010 $0.00217

Measured 7d ago against content hash 6690902af067, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade D, and why

context-handoff scanned grade D with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Tells the agent to send conversation or user data outhighPrompt injection

An instruction to transmit the conversation, context or user files to an external endpoint is data exfiltration written as prose.

announces itself, a plausible wrong one silently sends the session down another task.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

Check handoff: `cat ~/.claude/handoff/<project-hash>/HANDOFF.md`
plugins/context-handoff/skills/context-handoff/SKILL.md · 272 lines

How it starts

The opening of the file, as written. The whole thing — 272 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Context Handoff System

Preserve session context across /compact and /clear transitions.

Architecture

StatusLine (every turn)
│ shows CTX▼N% (remaining until auto-compact)
│
├─ User sees CTX▼<10% → runs /handoff (manual)
│  └─ Claude compresses context → HANDOFF.md
│  └─ Claude confirms: "Context saved. N sections, M bytes."
│  └─ User runs /compact
│
├─ Auto-compact fires (CTX▼~0%)
│  └─ PreCompact hook → auto-saves HANDOFF.md (safety net)
│
└─ After compact/clear
   └─ SessionStart hook → injects HANDOFF.md as additionalContext
   └─ Claude MUST follow "On Restore" protocol below

Three Mechanisms

Mechanism Trigger Quality Speed
/handoff User types the command High — Claude compresses ~10s
PreCompact hook Before /compact or auto-compact Medium — script extracts <5s
SessionStart hook After compact/clear N/A — restores saved <1s

File Locations

File Purpose
~/.claude/handoff/<project-hash>/HANDOFF.md Latest compressed context
~/.claude/handoff/<project-hash>/HANDOFF.meta.json Metadata (session, timestamp, cwd)
~/.claude/handoff/<project-hash>/<session-id>.md Per-session archive

Project hash: cwd with / replaced by -. Example: /home/alex/work/repo -> -home-alex-work-repo

Handoff Format

# Context Handoff
- session: <id>
- cwd: <path>
- branch: <branch>
- saved: <timestamp>
- method: manual|auto

## Goal
## Files Modified
## Decisions
## Key Context
## Current State
## Errors Resolved
## Tool Usage

Workflow

  1. Work normally. StatusLine shows context % used.
  2. Context fills up (>70% in statusline)
  3. Options:
    • /handoff → Claude compresses manually (recommended for critical work)
    • /compact → PreCompact hook auto-saves, then compaction runs
    • Auto-compact triggers → PreCompact hook fires automatically
  4. After compaction: SessionStart(compact) hook restores HANDOFF.md
  5. Claude follows "On Restore" protocol

Read the full file on GitHub · 272 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 272 lines · 97 tokens per session scan D 6690902af067

Subscribe to this mod's changes

context-handoff is a skill published in the GitHub repository OXI-717/ai-native-toolkit (8 stars, last pushed 14d ago), licensed MIT. It adds 97 tokens to every session and 2,167 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it D with 2 findings (tells the agent to send conversation or user data out, reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories