handoff
Skill47 starsChanged 2 months agoMITView on GitHub
Save state at the end of a session, or resume from the last one. Triggers "wrapping up", "running out of context", "done for today", "continue where we left off", "resume".
195 other projects use a version of this.
Adopted by
Most recently taken up by
- mattpocock/skillstheir own version, first seen Oct 8, 2026
- AlexisBalayre/claude-code-configtheir own version, first seen Oct 5, 2026
- fmind/dottheir own version, first seen Oct 5, 2026
- michielvandermeer/skillstheir own version, first seen Oct 4, 2026
- Integralist/agent-skillstheir own version, first seen Oct 4, 2026
- obie/auto-handofftheir own version, first seen Oct 4, 2026
Used with
Projects with it also use which-skill, wait-what and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
risadamsSkillwhich-skill
Router over this pack's skills and flows. Ask it "which skill fits X" when you don't remember what's available.
Also in 5 projects that use this
AWSSkillwait-what
Stop. That last message did not land: re-pitch it.
Also in 51 projects that use this
AWSSkillto-questionnaire
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
Also in 41 projects that use this
loulanyueSkillsetup-ts-deep-modules
Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.
Also in 15 projects that use this
RoentekSkillwriting-beats
Writing, exploit — assemble raw material into a journey of beats, grounding each term before a beat leans on it.
Also in 20 projects that use this
RoentekSkillwriting-fragments
Writing, explore — mine raw fragments, no structure yet.
Also in 20 projects that use this
- +5 more from aws
- +1 more from Roentek
Other versions195 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 195
- mattpocock/skills★ 335ksame name
- ykdojo/claude-code-tips★ 10ksame name
- vinvcn/mattpocock-skills-zh-CN★ 4.6ksame name
- davidondrej/skills★ 4.1ksame name
- compozy/compozy★ 2.8ksame name
- feiskyer/claude-code-settings★ 1.7ksame name
- openclaw/agent-skills★ 1.1ksame name
- suboss87/FDEOps★ 950same name
- anombyte93/prd-taskmaster★ 604same name
- stevesolun/ctx★ 588same name
185 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository39 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/AGENTS.mdAGENTS.md
- adhdSkill
- auditSkill
- autoresearchSkill
- buildSkill
- ccSkill
- checkpointSkill
- codexSkill
- componentSkill
- consolidateSkill
- context-docSkill
- design-tokensSkill
- dr-initSkill
- exploreSkill
- fixSkill
- freezeSkill
- harvestSkill
- hookSkill
- lighthouseSkill
- oracleSkill
- orchestrateSkill
- plan-ceo-reviewSkill
- plan-featureSkill
- poke-holesSkill
- projectSkill
- proof-of-workSkill
- qaSkill
- refactorSkill
- retroSkill
- review-batchSkill
- reviewSkill
- share-learningSkill
- shipSkill
- strategistSkill
- testSkill
- tldrSkill
- triageSkill
- zero-tech-debtSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 11 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 167 edited versions we read keep these.
11
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 46
Every handoff — auto or manual — always captures real, git-derived data at creation time:
- Very specific: line 100
If the current branch is linked to a GitHub Issue (e.g., feat/123-description):
- Distinctive: line 138
End of work session: - Before closing Claude Code
- Distinctive: line 139
Context at 65%+: - Before manual compaction or context quality degrades
- Distinctive: line 193
When compaction is unavoidable, populate this template — each section forces preservation of the dimensions most often lost:
- Distinctive: line 223
After compaction, probe 3–5 critical facts before continuing work:
- Very specific: line 230
If any probe returns vague or incorrect answers, re-read the handoff file (/handoff resume mode) to restore critical context.
- Distinctive: line 269
Before loading the local handoff, check for a linked GitHub Issue:
- Distinctive: line 280
If an issue is found, present it as the primary context — it's the shared source of truth.
- Distinctive: line 324
Check GitHub Issue: - Read linked issue for shared project context
- Distinctive: line 325
Load local handoff: - Read session-specific state
- Distinctive: line 327
Verify files: - Check current state vs handoff
- Distinctive: line 332
When starting a new session, the setup automatically:
“Common” is measured: kept by at least 6 in 10 of the 167 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Session Handoff
Two-mode skill: Save state at end of session, Resume state at start of next session.
Product-aware runner and state
Claude uses the installed runner and state under ~/.claude:
HANDOFF_RUNNER="$HOME/.claude/src/scripts/handoff.ts"
CC_STATE_ROOT="$HOME/.claude"Standalone Codex uses
${CODEX_HOME:-$HOME/.codex}/darkroom/source/src/scripts/handoff.ts, but the
plugin's stable handoff state is exposed only to hooks as $PLUGIN_DATA. In a
Codex plugin hook, set HANDOFF_RUNNER to that runner and
CC_STATE_ROOT="$PLUGIN_DATA". Outside that environment, do not guess a cache
path or write into ~/.claude: manual Codex create/resume/list/clean is
unavailable until the host exposes the same plugin-data path to the session.
Mode: Save
Save current session state for later resumption. This is the end-of-session boundary skill — for mid-task rollback points before risky operations, use /checkpoint.
Usage
CC_SETTINGS_HOME="$CC_STATE_ROOT" bun "$HANDOFF_RUNNER" createOr use the native command:
/handoffWhat Gets Saved
Every handoff — auto or manual — always captures real, git-derived data at creation time:
- Project: name, path, current branch
- Pending changes:
git status --porcelain(first 20 lines) - Key files: uncommitted paths union the files the session ledger observed being changed (see below)
- Recent commits: subjects of the last 3 commits
- Source:
manualorauto(see below)
In Claude, three additional sections are built purely from observed tool activity, not inference:
- Files Modified — every path a
Write/Edit/NotebookEdittouched - Files Read — every path a
Readtouched - Tool Failures — the exact tool name and error string, bounded and secret-redacted
These Claude-only sections come from the session ledger, a bounded JSONL at
~/.claude/tmp/session-ledger/<session_id>.jsonl written by the PostToolBatch
hook. It exists to fix a specific hole: git status forgets everything you
committed. A file edited at the start of a long session and committed an hour
later is invisible to a git status-only handoff, so the longer the session,
the more of its work disappears from the record. The ledger stores paths, tool
names, and error strings only — never file contents, prompts, or tool responses
— and never infers, so a Bash command's success is recorded as nothing
rather than as a guess.
Beyond that, what's actually filled in depends on how the handoff was created:
- Manual (
/handoff, orhandoff.ts create --summary "text") — the--summarytext becomes the Session Summary. Active Todos / Current Task / Notes for Next Session are placeholders (<!-- ... -->) for you (or the agent, before the turn ends) to fill in manually — the CLI has no way to know your in-progress todos, decisions, or learnings on its own. - Automatic (PreCompact/SessionEnd hooks call
create --from-hook,source: "auto") — Active Todos, Current Task, and Notes for Next Session stay as unfilled placeholders, but Session Summary is no longer blank on the compaction path: thePostCompacthook writes Claude Code's owncompact_summaryinto the handoff that the precedingPreCompactcreated, matched on session id. That summary is the one record of intent, decisions, and rationale; the ledger sections are the record of artifacts. They are stored separately and never merged, so nothing inferred is presented as observed.
Standalone Codex hooks capture the git-derived fields through the shared
runner, but Codex does not provide Claude's PostToolBatch session ledger or
PostCompact compact_summary backfill. Do not claim those sections were
observed in Codex.
On a Claude SessionEnd handoff (no compaction involved) Session Summary can still be
empty — pair it with the structured compaction template below, or run a manual
/handoff with --summary before ending a session.
GitHub Issue Sync
If the current branch is linked to a GitHub Issue (e.g., feat/123-description):
- Post a progress comment on the issue:
gh issue comment 123 --body "## Session Update - Completed: [summary of work done] - Files modified: [list] - Next steps: [what remains]" - Check off completed tasks in the issue body if any task checkboxes were resolved during this session.
This ensures project progress is visible to the whole team, not just in local handoff files.
Handoff Location
Handoffs are scoped per project (repo toplevel basename, or cwd basename
outside a git repo) — a handoff saved in one project never surfaces as
"latest" when you resume in another. Claude stores them below
~/.claude/handoffs; Codex hooks store them below
$CODEX_HOME/plugins/data/darkroom-cc-settings/handoffs:
~/.claude/handoffs/
└── <project-name>/
├── handoff_20260115_143000.md
├── handoff_20260115_143000.json
├── latest.md -> handoff_20260115_143000.md
└── ...Handoffs saved before this per-project scoping existed live under the flat
~/.claude/handoffs/ directory; resume/list fall back to that legacy
directory exactly once, only when the current project has no scoped store of
its own yet.
When to Create Handoff
- End of work session - Before closing Claude Code
- Context at 65%+ - Before manual compaction or context quality degrades
- Taking a break - Preserve state for later
- Switching tasks - Save before context switch
- Before compacting - Auto-triggered by PreCompact hook
Auto-Handoff
Both products create git-derived handoffs before compaction and at session end. Claude additionally provides the session-ledger and PostCompact behavior described above. Codex does not provide Claude's SessionStart handoff display or automatic pruning contract; do not promise either.
Output
Confirms:
- Handoff file created (and GitHub Issue updated if linked)
- Location of file
- Key information saved
Claude context-window runbook (folded in from former /context skill)
The statusline shows live context usage:
Opus 5 | my-project | main*↑ | ▊░░░░░░░░░ 8% (84k/1.0M)| Usage | Action |
| 65–79% | Save a checkpoint and compact or prepare a handoff |
| 80–89% | Stop expanding scope and run /handoff |
| 90%+ | Run /handoff now |
Model degradation thresholds
Degradation is not gradual — it follows a step function. Place critical information at the beginning and end — see AGENTS.md "Context Hygiene". Avoid burying key facts in the middle.
| Model | Noticeable degradation | Severe degradation |
| Claude Opus 5 | ~100K tokens | ~180K tokens |
| Claude Sonnet 5 | ~80K tokens | ~150K tokens |
| Claude Haiku 4.5 | ~50K tokens | ~90K tokens |
Sonnet 5's tokenizer is ~30% heavier than Sonnet 4.6's, so it reaches these thresholds on noticeably less actual text — the token counts above are unchanged, but the same conversation fills them faster.
Key patterns:
- Lost-in-middle — information in the center gets less attention
- Context poisoning — a single wrong fact can corrupt reasoning on related topics
- Context distraction — irrelevant info degrades performance on a step function, not proportionally
Structured compaction template
When compaction is unavoidable, populate this template — each section forces preservation of the dimensions most often lost:
## Session Intent
[What the user is trying to accomplish — the "why"]
## Files Modified
- path/to/file.ts: What changed and why
## Files Read (Not Modified)
- path/to/reference.ts: Why it was consulted
## Decisions Made
- Decision 1: Rationale
## Errors Encountered
- Error message → Resolution applied (or "still unresolved")
## Current State
- Build status / test status / what works / what doesn't
## Next Steps
1. Immediate next action
2. Following actionThe artifact trail (which files were touched, what changed) is universally the weakest dimension after compression. Dedicated sections force preservation of file paths, error messages, and decisions that would otherwise silently drift away.
Post-compaction validation
After compaction, probe 3–5 critical facts before continuing work:
- "What files have I modified in this session?"
- "What was the last error I encountered?"
- "What approach did I decide on and why?"
- "What are the remaining next steps?"
If any probe returns vague or incorrect answers, re-read the handoff file (/handoff resume mode) to restore critical context.
Reducing context proactively
- Use
context: fork— skills that fork don't bloat main context - Delegate exploration — let agents handle research
- Clean summaries — agents return summaries, not raw output
- Avoid large file reads — use TLDR for token-efficient analysis
- Offload large tool output — write outputs >2000 tokens to scratch files; return summary + path
- Place critical info at edges — beginning and end of context get more attention
Mode: Resume
Load state from a previous session and continue work.
Usage
CC_SETTINGS_HOME="$CC_STATE_ROOT" bun "$HANDOFF_RUNNER" resumeOr use:
/handoff resumeWhat Gets Loaded
- Previous task: What you were working on
- Progress: What was completed
- Decisions: Key choices made
- Files modified: What was changed
- Next steps: What remains
- Context: Important information
GitHub Issue Context
Before loading the local handoff, check for a linked GitHub Issue:
BRANCH=$(git branch --show-current)
ISSUE_NUM=$(echo "$BRANCH" | grep -oE '[0-9]+' | head -1)
if [[ -n "$ISSUE_NUM" ]]; then
gh issue view "$ISSUE_NUM" --comments
fiIf an issue is found, present it as the primary context — it's the shared source of truth. The local handoff supplements it with session-specific details.
Present a combined summary:
- From GitHub Issue: Title, task progress (X/Y done), latest comments
- From local handoff: Session-specific notes, open files, debug state
Available Handoffs
In Claude, list handoffs for the current project:
ls ~/.claude/handoffs/"$(basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)")"/Resume Options
Most Recent
/handoffLoads the most recent handoff for current project.
Specific Handoff
/handoff project-name-2024-01-15-1430Loads a specific handoff file.
List All
/handoff listShows available handoffs.
Clean Old Handoffs
CC_SETTINGS_HOME="$CC_STATE_ROOT" bun "$HANDOFF_RUNNER" clean [keep]Removes old handoff files, keeping the most recent keep (default: 20) of
each type (.json and .md). SessionStart already prunes down to 20
automatically on every session, so this is only needed for on-demand cleanup
(e.g. clean 0 to wipe all handoffs).
Workflow
- Check GitHub Issue - Read linked issue for shared project context
- Load local handoff - Read session-specific state
- Review combined context - Understand where we left off
- Verify files - Check current state vs handoff
- Continue work - Pick up next steps from the issue task list
Claude automatic session start
When starting a new session, the setup automatically:
- Checks for linked GitHub Issue (reads context)
- Recalls project learnings
- Shows recent handoff if available
- Displays context from previous work
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

