Session Handoff Generator

Session handoff

by davila7 · MIT license · ★ 32,299 on GitHub

Session handoff cover

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…

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

Overview

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

Manual install (npx, ZIP)
Claude Codenpx skills add davila7/claude-code-templates --skill session-handoff -g -a claude-code
Claude Code (degit)npx degit davila7/claude-code-templates/cli-tool/components/skills/enterprise-communication/session-handoff#main ~/.claude/skills/session-handoff-davila7
Claude.ai / desktopZip the folder and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md6.2 KB
Read SKILL.md here
davila7/main1 file shown
SKILL.md
Show the full text190 lines

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:

python scripts/create_handoff.py [task-slug]

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

For continuation handoffs (linking to previous work):

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 for guidance.

Step 3: Validate the Handoff

Run the validation script to check completeness and security:

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:

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:

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:

  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/
1---
2name: session-handoff
3description: "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."
4---
5 
6# Handoff
7 
8Creates comprehensive handoff documents that enable fresh AI agents to seamlessly continue work with zero ambiguity. Solves the long-running agent context exhaustion problem.
9 
10## Mode Selection
11 
12Determine which mode applies:
13 
14**Creating a handoff?** User wants to save current state, pause work, or context is getting full.
15- Follow: CREATE Workflow below
16 
17**Resuming from a handoff?** User wants to continue previous work, load context, or mentions an existing handoff.
18- Follow: RESUME Workflow below
19 
20**Proactive suggestion?** After substantial work (5+ file edits, complex debugging, major decisions), suggest:
21> "We've made significant progress. Consider creating a handoff document to preserve this context for future sessions. Say 'create handoff' when ready."
22 
23## CREATE Workflow
24 
25### Step 1: Generate Scaffold
26 
27Run the smart scaffold script to create a pre-filled handoff document:
28 
29```bash
30python scripts/create_handoff.py [task-slug]
31```
32 
33Example: `python scripts/create_handoff.py implementing-user-auth`
34 
35**For continuation handoffs** (linking to previous work):
36```bash
37python scripts/create_handoff.py "auth-part-2" --continues-from 2024-01-15-auth.md
38```
39 
40The script will:
41- Create `.claude/handoffs/` directory if needed
42- Generate timestamped filename
43- Pre-fill: timestamp, project path, git branch, recent commits, modified files
44- Add handoff chain links if continuing from previous
45- Output file path for editing
46 
47### Step 2: Complete the Handoff Document
48 
49Open the generated file and fill in all `[TODO: ...]` sections. Prioritize these sections:
50 
511. **Current State Summary** - What's happening right now
522. **Important Context** - Critical info the next agent MUST know
533. **Immediate Next Steps** - Clear, actionable first steps
544. **Decisions Made** - Choices with rationale (not just outcomes)
55 
56Use the template structure in [references/handoff-template.md](references/handoff-template.md) for guidance.
57 
58### Step 3: Validate the Handoff
59 
60Run the validation script to check completeness and security:
61 
62```bash
63python scripts/validate_handoff.py <handoff-file>
64```
65 
66The validator checks:
67- [ ] No `[TODO: ...]` placeholders remaining
68- [ ] Required sections present and populated
69- [ ] No potential secrets detected (API keys, passwords, tokens)
70- [ ] Referenced files exist
71- [ ] Quality score (0-100)
72 
73**Do not finalize a handoff with secrets detected or score below 70.**
74 
75### Step 4: Confirm Handoff
76 
77Report to user:
78- Handoff file location
79- Validation score and any warnings
80- Summary of captured context
81- First action item for next session
82 
83## RESUME Workflow
84 
85### Step 1: Find Available Handoffs
86 
87List handoffs in the current project:
88 
89```bash
90python scripts/list_handoffs.py
91```
92 
93This shows all handoffs with dates, titles, and completion status.
94 
95### Step 2: Check Staleness
96 
97Before loading, check how current the handoff is:
98 
99```bash
100python scripts/check_staleness.py <handoff-file>
101```
102 
103Staleness levels:
104- **FRESH**: Safe to resume - minimal changes since handoff
105- **SLIGHTLY_STALE**: Review changes, then resume
106- **STALE**: Verify context carefully before resuming
107- **VERY_STALE**: Consider creating a fresh handoff
108 
109The script checks:
110- Time since handoff was created
111- Git commits since handoff
112- Files changed since handoff
113- Branch divergence
114- Missing referenced files
115 
116### Step 3: Load the Handoff
117 
118Read the relevant handoff document completely before taking any action.
119 
120If handoff is part of a chain (has "Continues from" link), also read the linked previous handoff for full context.
121 
122### Step 4: Verify Context
123 
124Follow the checklist in [references/resume-checklist.md](references/resume-checklist.md):
125 
1261. Verify project directory and git branch match
1272. Check if blockers have been resolved
1283. Validate assumptions still hold
1294. Review modified files for conflicts
1305. Check environment state
131 
132### Step 5: Begin Work
133 
134Start with "Immediate Next Steps" item #1 from the handoff document.
135 
136Reference these sections as you work:
137- "Critical Files" for important locations
138- "Key Patterns Discovered" for conventions to follow
139- "Potential Gotchas" to avoid known issues
140 
141### Step 6: Update or Chain Handoffs
142 
143As you work:
144- Mark completed items in "Pending Work"
145- Add new discoveries to relevant sections
146- For long sessions: create a new handoff with `--continues-from` to chain them
147 
148## Handoff Chaining
149 
150For long-running projects, chain handoffs together to maintain context lineage:
151 
152```
153handoff-1.md (initial work)
154 ↓
155handoff-2.md --continues-from handoff-1.md
156 ↓
157handoff-3.md --continues-from handoff-2.md
158```
159 
160Each handoff in the chain:
161- Links to its predecessor
162- Can mark older handoffs as superseded
163- Provides context breadcrumbs for new agents
164 
165When resuming from a chain, read the most recent handoff first, then reference predecessors as needed.
166 
167## Storage Location
168 
169Handoffs are stored in: `.claude/handoffs/`
170 
171Naming convention: `YYYY-MM-DD-HHMMSS-[slug].md`
172 
173Example: `2024-01-15-143022-implementing-auth.md`
174 
175## Resources
176 
177### scripts/
178 
179| Script | Purpose |
180|--------|---------|
181| `create_handoff.py [slug] [--continues-from <file>]` | Generate new handoff with smart scaffolding |
182| `list_handoffs.py [path]` | List available handoffs in a project |
183| `validate_handoff.py <file>` | Check completeness, quality, and security |
184| `check_staleness.py <file>` | Assess if handoff context is still current |
185 
186### references/
187 
188- [handoff-template.md](references/handoff-template.md) - Complete template structure with guidance
189- [resume-checklist.md](references/resume-checklist.md) - Verification checklist for resuming agents
190 
View all files on GitHub →

Details

License
MIT
Stars on the repo
★ 32,299
Checked
Source
davila7/claude-code-templates ↗
Creator
davila7 · 212 listings
View creator

Similar skills

See all →
SkillWorktree Handoff Manageropenclaw/agent-skills · by openclawHand local work to a shared OpenClaw Gateway: start a worktree session there as yourself in one request, seeded with a handoff, and get the session URL back.★ 1.1k GitHub starsAgentNEXUS Handoff Templatesmsitarzewski/agency-agents · by msitarzewski> Standardized templates for every type of agent-to-agent handoff in the NEXUS pipeline. Consistent handoffs prevent context loss — the #1…★ 154k GitHub starsAgentNEXUS Executive Briefmsitarzewski/agency-agents · by msitarzewskiThe Agency comprises specialized AI agents across every division — engineering, design, marketing, security, GIS, product, testing, and…★ 154k GitHub starsAgentIncident Response Guidemsitarzewski/agency-agents · by msitarzewski> Mode: NEXUS-Micro | Duration: Minutes to hours | Agents: 3-8★ 154k GitHub starsSkillAPI Documentation Generatordavila7/claude-code-templates · by davila7Create API handoff documentation for frontend developers. Use when backend work is complete and needs to be documented for frontend integration, or user says 'create handoff', 'document API', 'frontend handoff', or 'API documentation'.★ 32.3k GitHub starsSkillCode Review Documentation Kitphuryn/pm-skills · by phurynThe durable documentation set that makes an AI-built (vibe-coded) app reviewable before shipping. A small core every app needs — architecture, user/permission flows, permissions, variables/secrets, and a test-coverage map — plus conditional docs added only when they apply: emails, scheduled work, SEO, and embedded agents/automation. Defines what each doc must capture and how a reviewer or auditor uses it. Use when documenting a codebase for handoff, mapping user journeys and trust-boundary crossings, planning test coverage, or preparing for a security or performance audit.★ 26.6k GitHub stars

More from davila7

Skill2D Game Developmentdavila7/claude-code-templates · by davila72D game development principles. Sprites, tilemaps, physics, camera.★ 32.3k GitHub starsSkill3D Game Development Principlesdavila7/claude-code-templates · by davila73D game development principles. Rendering, shaders, physics, cameras.★ 32.3k GitHub starsSkill3D Web Experience Builderdavila7/claude-code-templates · by davila7Expert in building 3D experiences for the web - Three.js, React Three Fiber, Spline, WebGL, and interactive 3D scenes. Covers product configurators, 3D portfolios, immersive websites, and bringing depth to web experiences. Use when: 3D website, three.js, WebGL, react three fiber, 3D experience.★ 32.3k GitHub starsSkillSplit Test Setupdavila7/claude-code-templates · by davila7When the user wants to plan, design, or implement an A/B test or experiment. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," or "hypothesis." For tracking implementation, see analytics-tracking.★ 32.3k GitHub starsAgentResearch Literature Synthesizerdavila7/claude-code-templates · by davila7Academic research synthesis specialist. Use PROACTIVELY for comprehensive research on academic topics, literature reviews, technical investigations, and well-cited analysis combining multiple sources. <example>Context: A podcast episode needs a segment grounded in peer-reviewed evidence with formal citations. user: "Research the current state of transformer efficiency techniques for the episode, with proper academic citations." assistant: "I'll use the academic-research-synthesizer agent to search arXiv and Semantic Scholar, extract full-text findings via WebFetch, and produce a cited literature synthesis with confidence levels." <commentary>Use academic-research-synthesizer (not comprehensive-researcher) when the episode segment needs peer-reviewed sourcing, formal citation format, and explicit confidence tagging rather than general-purpose multi-source coverage.</commentary></example> <example>Context: The episode-orchestrator has routed a "literature review" request for a technical deep-dive segment. user: "Summarize the research landscape on federated learning privacy guarantees." assistant: "I'll invoke academic-research-synthesizer to systematically search academic sources, note peer-review status per source, and synthesize consensus vs. open debates."</example>★ 32.3k GitHub starsAgentAcademic Research Specialistdavila7/claude-code-templates · by davila7Academic research specialist for scholarly sources, peer-reviewed papers, and academic literature. Use PROACTIVELY for research paper analysis, literature reviews, citation tracking, and academic methodology evaluation. <example>Context: The research-orchestrator has kicked off Phase 4 parallel research on 'efficacy of intermittent fasting' and needs peer-reviewed evidence. user: "Find the academic evidence on intermittent fasting outcomes." assistant: "I'll use the academic-researcher agent to search Semantic Scholar, PubMed, and OpenAlex for peer-reviewed studies and write structured findings to academic-research.md." <commentary>The request is specifically for scholarly/peer-reviewed evidence rather than general web coverage or code, so academic-researcher (not web-researcher or technical-researcher) is the right specialist.</commentary></example> <example>Context: The user wants a literature review comparing methodologies across studies on a topic. user: "Can you review the literature on transformer model interpretability and identify research gaps?" assistant: "Let me invoke the academic-researcher agent to pull foundational and recent papers, extract methodologies, and surface open research gaps." <commentary>Literature review, methodology extraction, and research-gap identification are core academic-researcher capabilities, distinct from technical-researcher's focus on code repositories and implementations.</commentary></example>★ 32.3k GitHub stars