Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

handoff · thedotmack — Claude Code skill: what it does, how to install

Generates a structured HANDOFF.md with goals, failed attempts, and next steps. Use it when context degrades or when starting a fresh session.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add thedotmack/claude-mem --skill handoff -a claude-code
Open on GitHub

What handoff does

The skill generates a structured HANDOFF.md file in the project root. It prepares a briefing document for a fresh agent instance when the current session gets unwieldy, /compact fails to restore focus, or Claude loops on failing solutions. The document is addressed directly to the incoming agent, outlining the actual end state, verified working features, and exact error messages.

Its main section records what failed and why. Instead of letting the next session repeat broken attempts, the handoff documents every failed approach alongside its root cause. It also builds a table of touched files, details the working theory, specifies project constraints, and lays out ordered next steps with concrete paths and function names. If claude-mem search tools are available, it appends observation IDs and search queries.

Do not commit it. The author treats HANDOFF.md strictly as a scratch file: delete it once the new agent resumes work with the prompt to read it, or add it to .gitignore.

What it helps with

  • document session state before clearing degraded context
  • record failed approaches alongside their root causes
  • pass concrete next steps and file paths to a fresh agent
  • link relevant claude-mem observation IDs for quick recall

Example prompts for the agent

  • Generate a handoff doc for this session
  • Write a HANDOFF.md so I can start fresh
  • Run handoff before I clear the context

How to install handoff

1Skills CLI (Vercel)

npx skills add thedotmack/claude-mem --skill handoff -a claude-code

2Manually: put the files in place

~/.claude/skills/handoff/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/handoff/

From the same set20

The whole set →
mem-search thedotmack Searches memory for solutions and context from previous coding sessions when you need to recall past work. Claude Code CX Codex Cursor +1 8,900installs smart-explore thedotmack Uses tree-sitter to map code structure and find symbols. Useful when you need to explore a codebase without loading every full file. Claude Code CX Codex Cursor +1 7,300installs make-plan thedotmack Turns a feature request into a phased plan built on real documentation instead of guesses. Useful right before you run do. Claude Code CX Codex Cursor +1 7,200installs do thedotmack The skill runs an implementation plan in phases through subagents. Use it when a plan needs execution with checks after each phase. Claude Code CX Codex Cursor +1 7,000installs knowledge-agent thedotmack Builds focused knowledge corpora from claude-mem observations and lets you query them in an AI session. Useful for reviewing past work by topic or project. Claude Code CX Codex Cursor +1 5,700installs learn-codebase thedotmack Instructs the agent to read every source file in full before starting work. Built for onboarding on unfamiliar repositories. Claude Code CX Codex Cursor +1 5,300installs how-it-works thedotmack Explains how claude-mem works behind the scenes. It covers tool observation logging, local file storage, and memory injection timing. Claude Code CX Codex Cursor +1 5,100installs pathfinder thedotmack This skill maps feature flows, finds duplicated concerns, and proposes a unified architecture. Use it to inspect a codebase before a refactor. Claude Code CX Codex Cursor +1 5,100installs

Other versions of handoff

Similar

skill Yeachan-Heo Manage local skills with slash commands to list, create, search, edit, and remove them. It suits projects that keep both user and project-level skill files. Claude Code CX Codex Cursor +1 833installs binance-agentic-wallet binance-web3-team This skill connects your agent to the Binance Web3 wallet CLI, letting you check balances, swap tokens, submit limit orders, and manage DeFi positions from the terminal. Claude Code CX Codex Cursor +1 15,000installs omc-doctor Yeachan-Heo A skill that audits an oh-my-claudecode install: compares the plugin version against npm and hunts stale hooks in your settings files. Useful when the plugin looks installed but nothing changes. Claude Code CX Codex Cursor +1 832installs obsidian-canvas-creator axtonliu Turns text into a JSON Canvas file that Obsidian opens as an interactive board. Choose a radial mind map or a freeform layout with grouped zones. Claude Code CX Codex Cursor +1 2,000installs firecrawl-build-search firecrawl A skill that shows an agent how to wire Firecrawl search into a product, so a query finds candidate pages before anything gets read. Claude Code CX Codex Cursor +1 61,500installs system-info agno A skill with two scripts that tell the agent which host it runs on and what sits in a folder. Useful before you trust any path it prints. Claude Code CX Codex Cursor +1 302installs setup-matt-pocock-skills Matt Pocock This skill configures a repository for Matt Pocock's engineering skills by setting its issue tracker, triage labels, and domain docs layout. Run it before using the other skills. Claude Code 1,052,851installs to-tickets Matt Pocock Turns a plan, spec, or conversation into small end-to-end tickets with explicit blockers. Use it to agree on the work breakdown before tickets go to a tracker. Claude Code 711,230installs

Questions about handoff

How do I install handoff in Claude Code?

Run npx skills add thedotmack/claude-mem --skill handoff -a claude-code in your terminal.

What does HANDOFF.md contain?

It captures the overall goal, touched files, confirmed working features, exact failure messages, and failed attempts with root causes. It also outlines ordered next steps and claude-mem memory pointers.

Should HANDOFF.md be committed to version control?

No. The skill treats HANDOFF.md as a scratch document that should be deleted once the fresh session resumes work, or excluded via .gitignore.

Source text

SKILL.md · Apache-2.0
---
name: handoff
description: 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.
---

# 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
- `/compact` ran 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

1. **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.

2. **Current State** — What is working right now? What is broken? What is the exact symptom of the problem? Include error messages verbatim if relevant.

3. **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.

4. **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.

5. **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.

6. **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.

7. **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.

8. **Memory Pointers** — If claude-mem's search tools are available, use Smart search: run `search` for this task's key terms, inspect `timeline` around relevant results, then fetch only selected records with `get_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 two `search` queries 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 uses `Date.now()` but should use `req.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:

```markdown
# 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:

1. That `HANDOFF.md` has been written
2. To run `/clear` or start a new Claude Code session
3. To open the new session and say: **"Read HANDOFF.md and continue from where we left off."**
4. That claude-mem gives the fresh agent the recent timeline automatically, and `HANDOFF.md` is its precise briefing on top of that
5. That `HANDOFF.md` is 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.

© thedotmack · Apache-2.0 · thedotmack/claude-mem

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor