
handoff
Generate a HANDOFF.md that captures goal, current state, files touched, failed attempts, and next steps — so a fresh Claude session can continue exactly where this one left off. Use when sessions are getting long, Claude keeps retrying the same broken solution, or the user wants to step away and resume later.
- Installs
- 381
- Last 24h
- +14
- Trending rank
- #7119
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/thedotmack/claude-mem --skill handoff- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads handoff automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Handoff
Generate a structured HANDOFF.md file that gives a fresh Claude session everything it needs to continue this work without dragging the current degraded context forward.
claude-mem already injects recent observations into every new session, so the fresh agent starts with a timeline of what happened. The handoff adds what that timeline cannot: the goal, the failed attempts and why they failed, the current theory, and exact next steps, plus pointers into memory for deeper recall.
When to Use
- The session is long and Claude feels confused or repetitive
- Claude keeps trying the same failing solution over and over
- The user wants to step away and resume later
/compactran but Claude still lacks clear direction- The user says "handoff", "generate a handoff", "I want to start fresh", or "write a handoff doc"
What to Capture
Think hard about the full arc of this conversation before writing. The handoff must be useful to a Claude instance that has never seen this conversation.
Required Sections
-
Goal — One paragraph. What is the user actually trying to accomplish? State the end state, not the current sub-task. Be specific enough that a fresh agent can orient immediately.
-
Current State — What is working right now? What is broken? What is the exact symptom of the problem? Include error messages verbatim if relevant.
-
Files in Play — List every file that has been read, edited, or created during this session that is relevant to the current task. Use absolute or repo-relative paths. Include a one-line note on why each file matters.
-
What Has Been Tried (and Why It Failed) — This is the most important section. List every approach attempted that did not work, and explain WHY it failed (not just that it failed). A fresh agent that skips this section will repeat the same mistakes.
-
Current Best Theory — What do you currently believe is the right path forward, even if you haven't proven it yet? Include any evidence or reasoning that supports it.
-
Next Steps — Concrete, ordered actions for the fresh agent to take. Be specific: file paths, function names, commands to run. The fresh agent should be able to start on step 1 immediately.
-
Key Constraints and Context — Any non-obvious constraints: environment specifics, user preferences expressed during this session, things the user explicitly said NOT to do, external dependencies, performance requirements, etc.
-
Memory Pointers — If claude-mem's search tools are available, use Smart search: run
searchfor this task's key terms, inspecttimelinearound relevant results, then fetch only selected records withget_observations. List the few observation IDs that matter most (a decision, the root cause, a failed approach), so the fresh agent can retrieve those records. Also list one or twosearchqueries worth re-running. Skip this section if the tools are not available.
Writing Rules
- Write the handoff for a fresh Claude, not for the user. The user knows what happened; the fresh Claude does not.
- Be ruthlessly specific. Vague next steps are useless. "Fix the auth" is bad. "In
src/auth/middleware.ts:47, the token expiry check usesDate.now()but should usereq.timestamp— change the comparison on line 52" is good. - Include exact error messages, stack traces, or test output that captures the failure mode.
- Do not pad. Every sentence should be load-bearing information for the fresh agent.
- Do not write the handoff from the user's perspective. Write it as a briefing document addressed to the incoming agent.
Output
Write the handoff to HANDOFF.md in the current working directory (the project root).
Use this structure:
# Handoff
> Generated: [timestamp]
> Project: [project name or directory]
> Session summary: [one sentence describing what this session was about]
## Goal
[What the user is trying to accomplish — the actual end state]
## Current State
**Working:**
- [list what is confirmed working]
**Broken:**
- [exact symptom, error message, or failure mode]
## Files in Play
| File | Why It Matters |
|------|---------------|
| `path/to/file.ts` | [one line] |
## What Has Been Tried (and Why It Failed)
### Attempt 1: [short name]
- **What:** [what was done]
- **Why it failed:** [root cause, not just "it didn't work"]
### Attempt 2: [short name]
...
## Current Best Theory
[What you currently believe is the correct approach and why]
## Next Steps
1. [Specific, actionable step with file path or command]
2. [Next step]
3. ...
## Key Constraints
- [Non-obvious constraint or preference the user expressed]
- [Things explicitly ruled out]
## Memory Pointers
- Observations: [#ID — one line on why it matters]
- Searches worth re-running: [`search` query]
After Writing
Tell the user:
- That
HANDOFF.mdhas been written - To run
/clearor start a new Claude Code session - To open the new session and say: "Read HANDOFF.md and continue from where we left off."
- That claude-mem gives the fresh agent the recent timeline automatically, and
HANDOFF.mdis its precise briefing on top of that - That
HANDOFF.mdis a scratch file: don't commit it (delete it once the new session has picked up, or add it to.gitignore)
Keep the message short. The user is ready to move — don't make them read a wall of text.
FAQ
What does the handoff skill do?
Generate a HANDOFF.md that captures goal, current state, files touched, failed attempts, and next steps — so a fresh Claude session can continue exactly where this one left off. Use when sessions are getting long, Claude keeps retrying the same broken solution, or the user wants to step away and resume later.
How do I install handoff?
Run npx skills add https://github.com/thedotmack/claude-mem --skill handoff in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/handoff/ (personal) or .claude/skills/handoff/ (project).
Which AI agents can use handoff?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is handoff safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains handoff?
It is published by thedotmack in thedotmack/claude-mem. It has 381 recorded installs.
More from thedotmack/claude-mem
mem-search
thedotmack/claude-mem
This skill should be used when the user asks to "search memory", "what do you remember about X", "check claude-mem", "mem search", "find past observations", "what did we do last session", or wants prior-session context about a project, decision, file, or task. Searches the user's Claude-Mem (cmem.ai) memory.
smart-explore
thedotmack/claude-mem
Token-optimized structural code search using tree-sitter AST parsing. Use instead of reading full files when you need to understand code structure, find functions, or explore a codebase efficiently.
make-plan
thedotmack/claude-mem
Create a detailed, phased implementation plan with documentation discovery. Use when asked to plan a feature, task, or multi-step implementation — especially before executing with do.
do
thedotmack/claude-mem
Execute a phased implementation plan using subagents. Use when asked to execute, run, or carry out a plan — especially one created by make-plan.
timeline-report
thedotmack/claude-mem
Generate a "Journey Into [Project]" narrative report analyzing a project's entire development history from claude-mem's timeline. Use when asked for a timeline report, project history analysis, development journey, or full project report.
knowledge-agent
thedotmack/claude-mem
Build and query AI-powered knowledge bases from claude-mem observations. Use when users want to create focused "brains" from their observation history, ask questions about past work patterns, or compile expertise on specific topics.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.