session-handoff
Skill0 starsChanged 7 months agoMITView on GitHub
Save / list / resume task context across Claude Code sessions on the user's terms (instead of relying on /compact to choose what to keep). Writes a structured Markdown handoff file under <root>/.claude/handoff/ containing the current task, decisions, open questions, files touched, and next steps. Use save when wrapping up a session, resume at the start of the next one.
164 other projects use a version of this.
Adopted by
Most recently taken up by
- OpenAgentsInc/openagentstheir own version, first seen Nov 29, 2026
- anivar/agentic-sdlctheir own version, first seen Nov 29, 2026
- mikejhill/agent-skillstheir own version, first seen Nov 29, 2026
- weiweimhy/agent-skillstheir own version, first seen Nov 29, 2026
- exerias21/brainstorm-toolkittheir own version, first seen Nov 29, 2026
- jamesctucker/morainetheir own version, first seen Nov 29, 2026
Used with
Projects with it also use ascii-diagram, research-fleet 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.
SethGammonSkillascii-diagram
Generate perfectly aligned ASCII diagrams — architecture, flow, sequence, box-and-arrow. Uses a programmatic character-grid approach so alignment is guaranteed by math, not token prediction. Includes post-render verification.
Also in 4 projects that use this
SethGammonSkillresearch-fleet
Parallel research using Fleet wave mechanics. Spawns multiple scout agents, each investigating a different angle of the same question. Findings are compressed between waves. Produces a unified research brief from multiple independent perspectives.
Also in 3 projects that use this
ferocknewSkilldoc-reader
当用户要求"读取 Word 文档"、"解析 DOCX 文件"、"将 Word 转换为 Markdown"、"提取文档内容"、"读取 docx"时,或者需要在 JavaScript/Node.js 环境中读取 Microsoft Word 文档(.docx)并转换为 Markdown、HTML 或纯文本格式时使用此 skill。
Also in 3 projects that use this
vicoa-aiSkilllive-preview
Start a local app in the current user project, expose it through a tunnel, and return preview details in structured Markdown. Use when the user asks for a preview URL, public URL, shareable localhost, mobile/web preview, or tunnel setup.
Also in 4 projects that use this
mcabreradevSkillbug-diagnosis
Use when something is broken, failing or intermittent. Diagnose before fixing: a command that goes red on this bug first, then falsifiable hypotheses.
Also in 4 projects that use this
botlearn-aiSkilldoc-gen
Also in 4 projects that use this
Other versions164 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 164
- rohitg00/pro-workflow★ 2.9ksame name
- SethGammon/Citadel★ 927same name
- wanshuiyin/HERO-Anti-OverDefense★ 925same name
- OpenAgentsInc/openagents★ 469same name
- OneWave-AI/claude-skills★ 378same name
- ai-analyst-lab/ai-analyst★ 304same name
- entireio/skills★ 240same name
- Innei/SKILL★ 93same name
- yuzushi-dev/session-handoff★ 67same name
- Hive-Academy/ptah-extension★ 35same name
154 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 repository9 other files it gives its agents.
- answer-cacheSkill
- api-contractSkill
- codemapSkill
- diff-summarySkill
- file-summarySkill
- git-digestSkill
- log-extractSkill
- run-quietSkill
- test-failures-onlySkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 3 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 140 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
Do NOT invoke save for trivial tasks where the diff alone tells the story.
- Distinctive: line 50
If the command fails (not in a git repo), use the current working directory and warn the user that the handoff is not anchored to a git …
- Distinctive: line 59
Run these in a single Bash batch:
- Very specific: line 85
Make sure the parent directory exists (mkdir -p .claude/handoff on Unix, New-Item -ItemType Directory -Force .claude\handoff on PowerShell).
- Very specific: line 120
If the user passed a full Markdown document (e.g.
- Distinctive: line 158
If the directory does not exist or is empty, print:
- Very specific: line 168
If the user passed name=<slug>, glob for *<slug>*.md in the handoff directory and pick the most recent match.
- Very specific: line 171
If no file matches, print session-handoff: error: no handoffs to resume.
- Very specific: line 176
Read the file. Strip the YAML frontmatter (everything between the first two --- lines).
- Very specific: line 214
Never overwrite an existing handoff file — the timestamp prefix makes collisions effectively impossible, but if one happens, append -1, -2, …
“Common” is measured: kept by at least 6 in 10 of the 140 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
A Markdown-only skill — no Python, no scripts. You (Claude) read/write
Markdown files under <repo-root>/.claude/handoff/ using the Read, Write,
Glob, and Bash tools.
When to invoke
Three operations:
save
Invoke when ANY of these apply:
- The user is wrapping up a session and wants to "save where we are".
- The conversation is getting long and you want to checkpoint state before
/compactsummarizes it for you. - You've just made a non-trivial decision the next session should know about.
list
Invoke when the user asks "what handoffs do I have?" or "what was I working on last?".
resume
Invoke at the start of a new session when the user says "let's continue" or mentions previous work. Read the most recent handoff (or a specific named one) and use it to seed the next response.
Do NOT invoke save for trivial tasks where the diff alone tells the story.
This is for in-progress work with context that is not in the code itself.
Finding the repo root
For all operations, locate the repo root:
git rev-parse --show-toplevelIf the command fails (not in a git repo), use the current working directory and warn the user that the handoff is not anchored to a git repo.
The handoff directory is always <repo-root>/.claude/handoff/.
Operation: save
Step 1 — gather metadata in parallel
Run these in a single Bash batch:
| Command | Purpose |
git rev-parse --show-toplevel | Repo root. |
git symbolic-ref --quiet --short HEAD | Current branch (or empty / non-zero on detached HEAD). |
The current timestamp comes from date -u +"%Y-%m-%dT%H:%M:%SZ" (UTC), and
the filename prefix from date -u +"%Y%m%d-%H%M%S".
Step 2 — build the slug
The slug is a lowercase, kebab-case, filename-safe string up to 60 chars, derived from (in priority order):
- The
name=argument the user provided. - The
task=text (first ~6 words). - Literal
handoffas last resort.
Replace anything outside [a-z0-9-] with -, collapse repeated dashes,
strip leading/trailing dashes.
Step 3 — write the file
Path: <repo-root>/.claude/handoff/<YYYYMMDD-HHMMSS>-<slug>.md
Make sure the parent directory exists (mkdir -p .claude/handoff on Unix,
New-Item -ItemType Directory -Force .claude\handoff on PowerShell).
File contents:
---
saved_at: <UTC timestamp, e.g. 2026-05-14T18:00:00Z>
branch: <current branch, or "(no branch)" if detached/no-git>
slug: <slug>
---
# Handoff: <task or slug>
## Current task
<text from task= argument; omit section if empty>
## Decisions made
<text from decisions= argument; omit if empty>
## Open questions
<text from open= argument; omit if empty>
## Files touched
- <path1>
- <path2>
<omit section if empty>
## Next steps
<text from next= argument; omit if empty>
## Notes
<text from notes= argument; omit if empty>If the user passed a full Markdown document (e.g. from-stdin style or just
a big block of text), use that as the body verbatim, but still prepend the
YAML frontmatter.
Step 4 — confirm
Print one line:
session-handoff: wrote .claude/handoff/<filename>Operation: list
Step 1 — list files
ls -1t <repo-root>/.claude/handoff/*.md(or use Glob with pattern: ".claude/handoff/*.md" and sort by mtime
descending). Take the top N (default 10).
Step 2 — read each file's frontmatter
For each file in the list, read just the first ~10 lines to extract
saved_at and branch from the YAML frontmatter. Compute "X ago"
from the saved_at timestamp.
Step 3 — print
.claude/handoff/
20260514-180000-auth-rewrite.md on skill/auth (3h ago)
20260513-220000-fix-pagination.md on main (1d ago)
20260513-100000-spike-graphql.md on skill/graphql (2d ago)If the directory does not exist or is empty, print:
session-handoff: no handoffs found.Operation: resume
Step 1 — pick the file
- If the user passed
name=<slug>, glob for*<slug>*.mdin the handoff directory and pick the most recent match. - Otherwise, pick the most recently modified
*.mdin the handoff directory. - If no file matches, print
session-handoff: error: no handoffs to resume.and stop.
Step 2 — print the handoff
Read the file. Strip the YAML frontmatter (everything between the first
two --- lines). Print a header followed by the body:
# resuming <filename> (saved <saved_at> on <branch>, <age>)
<body>Then use the handoff to seed your understanding of the next response — but verify any file paths or references against the current code before acting on them (handoffs can go stale).
Slug examples
| Input | Slug |
name="Auth rewrite" | auth-rewrite |
task="Refactor user model + API" (no name) | refactor-user-model-api |
task="" and name="" | handoff |
name="feat/users#42" | feat-users-42 |
Humanizing age
| Seconds since saved | Display |
| < 60 | Ns ago |
| < 3600 | Nm ago |
| < 86400 | Nh ago |
| ≥ 86400 | Nd ago |
Notes
- Handoff files live under
<repo>/.claude/handoff/. The.claude/folder should be in the project's.gitignore. - Resuming a stale handoff (file paths that no longer exist, branch that has been deleted) is fine — the data is purely informational. Verify against the current code before acting.
- Never overwrite an existing handoff file — the timestamp prefix makes
collisions effectively impossible, but if one happens, append
-1,-2, etc. to the slug.
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.

