Skill detail
session-handoff
Creates handoff documents for AI agent session transfers, capturing state so fresh agents can continue work when the context window approaches capacity.
Why we recommend it: Handoff documents address context-window exhaustion, adjacent to context management.
Inspect before use
Read the source instructions and check the requirements before you install this skill.
SKILL.md
The saved excerpt is a snapshot from when this skill was listed. The external source remains the complete and most current version.
--- 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 - MissinRead the full source on GitHub (opens external page)