Skip to main content
skill CX Codex

session-handoff · softaworks — Claude Code skill: what it does, how to install

Creates handoff documents for AI agent session transfers. Useful when context window fills up or projects span multiple sessions.

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

What session-handoff does

The skill saves agent work state into a structured document and lets a fresh session pick up exactly where you left off. Triggers on request ('create handoff', 'save state') or proactively after substantial work — multiple file edits, complex debugging, architecture decisions.

Four Python scripts inside: create_handoff.py generates a document with timestamp, current git branch, modified file list; validate_handoff.py checks section completeness, scans for secrets, scores quality (minimum 70 to finalize); check_staleness.py assesses currency — FRESH, SLIGHTLY_STALE, STALE, VERY_STALE — by counting commits and changes since creation; list_handoffs.py shows all available documents in the project. Documents live in .claude/handoffs/ with names like YYYY-MM-DD-HHMMSS-[slug].md.

For long projects, handoff chaining is supported: each new document links to its predecessor via --continues-from flag, maintaining a context lineage. Requires Python to run the scripts.

What it helps with

  • save session state before context window fills
  • resume work after a break without losing details
  • transfer architectural decisions to the next agent
  • check whether saved context is still current before loading
  • chain multiple sessions for a long-running project

Example prompts for the agent

  • create a handoff for this session
  • save state to .claude/handoffs/ named auth-implementation
  • load the most recent handoff and continue

How to install session-handoff

1Skills CLI (Vercel)

npx skills add softaworks/agent-toolkit --skill session-handoff -a claude-code

2Manually: put the files in place

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

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

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about session-handoff

How to install session-handoff in Claude Code?

Run npx skills add softaworks/agent-toolkit --skill session-handoff -a claude-code. The skill will appear in ~/.claude/skills/session-handoff/SKILL.md.

What does session-handoff do?

Creates a document capturing full session context: modified files, git branch, decisions made, next steps. A fresh session reads the document and continues without losing state.

When should I create a handoff?

On user request, when context window nears capacity, after completing a major task, or before pausing work. The skill will proactively suggest creating a handoff after five or more file edits or complex debugging.

Source text

SKILL.md · MIT
---
name: session-handoff
description: "Creates comprehensive handoff documents for seamless AI agent session transfers. Triggered when: (1) user requests handoff/memory/context save, (2) context window approaches capacity, (3) major task milestone completed, (4) work session ending, (5) user says 'save state', 'create handoff', 'I need to pause', 'context is getting full', (6) resuming work with 'load handoff', 'resume from', 'continue where we left off'. Proactively suggests handoffs after substantial work (multiple file edits, complex debugging, architecture decisions). Solves long-running agent context exhaustion by enabling fresh agents to continue with zero ambiguity."
---

# Handoff

Creates comprehensive handoff documents that enable fresh AI agents to seamlessly continue work with zero ambiguity. Solves the long-running agent context exhaustion problem.

## Mode Selection

Determine which mode applies:

**Creating a handoff?** User wants to save current state, pause work, or context is getting full.
- Follow: CREATE Workflow below

**Resuming from a handoff?** User wants to continue previous work, load context, or mentions an existing handoff.
- Follow: RESUME Workflow below

**Proactive suggestion?** After substantial work (5+ file edits, complex debugging, major decisions), suggest:
> "We've made significant progress. Consider creating a handoff document to preserve this context for future sessions. Say 'create handoff' when ready."

## CREATE Workflow

### Step 1: Generate Scaffold

Run the smart scaffold script to create a pre-filled handoff document:

```bash
python scripts/create_handoff.py [task-slug]
```

Example: `python scripts/create_handoff.py implementing-user-auth`

**For continuation handoffs** (linking to previous work):
```bash
python scripts/create_handoff.py "auth-part-2" --continues-from 2024-01-15-auth.md
```

The script will:
- Create `.claude/handoffs/` directory if needed
- Generate timestamped filename
- Pre-fill: timestamp, project path, git branch, recent commits, modified files
- Add handoff chain links if continuing from previous
- Output file path for editing

### Step 2: Complete the Handoff Document

Open the generated file and fill in all `[TODO: ...]` sections. Prioritize these sections:

1. **Current State Summary** - What's happening right now
2. **Important Context** - Critical info the next agent MUST know
3. **Immediate Next Steps** - Clear, actionable first steps
4. **Decisions Made** - Choices with rationale (not just outcomes)

Use the template structure in [references/handoff-template.md](references/handoff-template.md) for guidance.

### Step 3: Validate the Handoff

Run the validation script to check completeness and security:

```bash
python scripts/validate_handoff.py <handoff-file>
```

The validator checks:
- [ ] No `[TODO: ...]` placeholders remaining
- [ ] Required sections present and populated
- [ ] No potential secrets detected (API keys, passwords, tokens)
- [ ] Referenced files exist
- [ ] Quality score (0-100)

**Do not finalize a handoff with secrets detected or score below 70.**

### Step 4: Confirm Handoff

Report to user:
- Handoff file location
- Validation score and any warnings
- Summary of captured context
- First action item for next session

## RESUME Workflow

### Step 1: Find Available Handoffs

List handoffs in the current project:

```bash
python scripts/list_handoffs.py
```

This shows all handoffs with dates, titles, and completion status.

### Step 2: Check Staleness

Before loading, check how current the handoff is:

```bash
python scripts/check_staleness.py <handoff-file>
```

Staleness levels:
- **FRESH**: Safe to resume - minimal changes since handoff
- **SLIGHTLY_STALE**: Review changes, then resume
- **STALE**: Verify context carefully before resuming
- **VERY_STALE**: Consider creating a fresh handoff

The script checks:
- Time since handoff was created
- Git commits since handoff
- Files changed since handoff
- Branch divergence
- Missing referenced files

### Step 3: Load the Handoff

Read the relevant handoff document completely before taking any action.

If handoff is part of a chain (has "Continues from" link), also read the linked previous handoff for full context.

### Step 4: Verify Context

Follow the checklist in [references/resume-checklist.md](references/resume-checklist.md):

1. Verify project directory and git branch match
2. Check if blockers have been resolved
3. Validate assumptions still hold
4. Review modified files for conflicts
5. Check environment state

### Step 5: Begin Work

Start with "Immediate Next Steps" item #1 from the handoff document.

Reference these sections as you work:
- "Critical Files" for important locations
- "Key Patterns Discovered" for conventions to follow
- "Potential Gotchas" to avoid known issues

### Step 6: Update or Chain Handoffs

As you work:
- Mark completed items in "Pending Work"
- Add new discoveries to relevant sections
- For long sessions: create a new handoff with `--continues-from` to chain them

## Handoff Chaining

For long-running projects, chain handoffs together to maintain context lineage:

```
handoff-1.md (initial work)
    ↓
handoff-2.md --continues-from handoff-1.md
    ↓
handoff-3.md --continues-from handoff-2.md
```

Each handoff in the chain:
- Links to its predecessor
- Can mark older handoffs as superseded
- Provides context breadcrumbs for new agents

When resuming from a chain, read the most recent handoff first, then reference predecessors as needed.

## Storage Location

Handoffs are stored in: `.claude/handoffs/`

Naming convention: `YYYY-MM-DD-HHMMSS-[slug].md`

Example: `2024-01-15-143022-implementing-auth.md`

## Resources

### scripts/

| Script | Purpose |
|--------|---------|
| `create_handoff.py [slug] [--continues-from <file>]` | Generate new handoff with smart scaffolding |
| `list_handoffs.py [path]` | List available handoffs in a project |
| `validate_handoff.py <file>` | Check completeness, quality, and security |
| `check_staleness.py <file>` | Assess if handoff context is still current |

### references/

- [handoff-template.md](references/handoff-template.md) - Complete template structure with guidance
- [resume-checklist.md](references/resume-checklist.md) - Verification checklist for resuming agents

© softaworks · MIT · softaworks/agent-toolkit

Similar skills

All skills for Agent setup: memory, context, orchestration →

session-handoff by other authors comes first.

From the same set12

database-schema-designer Design SQL and NoSQL data models with relationships, constraints, indexes, and migrations. Useful when starting a schema or reviewing one that already exists. CX Codex +1 4,300installs qa-test-planner Turns a feature description into a test plan, manual test cases, a regression suite or a bug report. Fires only when you name it: qa-test-planner. CX Codex +1 4,300installs codex A skill that runs Codex CLI for code analysis, refactoring, and automated editing. Uses GPT-5.2 by default with adaptive reasoning, hitting 76.3% on SWE-bench. CX Codex +1 4,100installs react-dev Provides type-safe React 18 and 19 patterns for TypeScript components, hooks, and Server Actions. CX Codex +1 4,100installs feedback-mastery Guides developers and leads through difficult workplace conversations using the SBI and Preparation-Delivery-Follow-up frameworks. Helps turn friction into factual feedback. CX Codex +1 4,000installs gemini Tells your agent how to drive Gemini CLI for code review, plan review, or files too large for its own context. Useful when you want a second opinion on a whole repo. CX Codex +1 4,000installs reducing-entropy A skill that measures success by the size of the codebase afterwards, not by the effort spent. It runs only when you ask, and it deletes. CX Codex +1 4,000installs plugin-forge Skill for creating and managing Claude Code plugins with proper structure, manifests, and marketplace integration. Use it when building plugins for distribution or setting up plugin components like commands and hooks. CX Codex +1 3,900installs

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