New to Claude Skills? Learn how to install them →

davila7 on GitHub

Session Handoff

Free

Streamline AI agent session transfers with comprehensive documentation.

Get this skill

Free · Opens the source repo

What Session Handoff does

The Session Handoff skill is designed to facilitate the seamless transfer of work between AI agents by creating comprehensive handoff documents. This skill addresses the common issue of context exhaustion that can occur during long-running sessions. By generating structured handoff documents, it ensures that new agents can pick up where their predecessors left off without losing critical information. The skill is particularly useful for teams that rely on AI agents for collaborative tasks, enabling a smooth transition of responsibilities and preserving the continuity of work.

When a user triggers a handoff, whether by requesting to save their current state or when significant milestones are reached, the skill initiates a workflow that generates a scaffold for the handoff document. This scaffold includes essential details such as timestamps, project paths, recent commits, and modified files, allowing the user to focus on filling in the critical context necessary for the next agent. The skill also includes validation steps to ensure that the handoff document is complete and secure, checking for placeholders and sensitive information before finalization.

The Session Handoff skill is ideal for developers and designers who frequently collaborate using AI agents and need a reliable method to maintain context across sessions. By proactively suggesting handoffs after substantial work, it encourages users to document their progress regularly, thus minimizing the risk of losing important context. The structured approach to creating and resuming handoffs helps teams maintain high productivity levels, even when switching between different agents or team members.

Overall, this skill is a valuable tool for anyone looking to enhance their workflow with AI agents, ensuring that all critical information is captured and easily accessible for future sessions.

When to use it

Use this skill when you need to save your current session state or when resuming work from a previous handoff.

When not to use it

This skill may not be suitable for one-off tasks or scenarios where context preservation is not critical.

What you can build with it

Transitioning Between Tasks

When switching between different projects or tasks, use the skill to create a handoff document that captures the current state and next steps.

Collaborating with Multiple Agents

In a team environment where multiple AI agents are used, generate handoff documents to maintain continuity and clarity across sessions.

Documenting Long-Term Projects

For long-running projects, use the skill to create a series of linked handoffs that preserve the decision-making process and context for future reference.

How to install Session Handoff

View source

1. Install with the skills CLI

npx skills add davila7/claude-code-templates/session-handoff --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by davila7

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/

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

Frequently asked questions about Session Handoff

Similar skills