Automatically transfers context between Claude sessions via bash script hooks, enabling custom startup logic and pre-compaction environment setup to preserve and focus thread history when starting new conversations

Goal-focused context transfer for Claude Code - transform /compact into system instructions that preserves the current task post-compact
Claude-Handoff extends /compact with optional goal-focused handoff. When you run /compact handoff:<your goal> the plugin:
Simply prompt the agent to 'proceed' and you're away.
PreCompact Hook: Activates only when you use /compact handoff:... format
handoff: prefixclaude --resume <session> --fork-session --model haiku --print <prompt> to generate handoff immediately.git/handoff-pending/handoff-context.json temporarilyCompact: Proceeds normally
SessionStart Hook: Runs in the continued session
Result: Session continues with focused context injected, ready to execute your goal, just prompt it to go
Traditional compaction is lossy and unfocused - each summary degrades context quality. Goal-focused handoffs produce sharper results and get you back where you left off.
Inspired by AmpCode's handoff model, and my own observations, this plugin auto-injects generated context without human review. Claude Code hooks can't pause for user editing.
PreCompact prompting for handoff adds some execution time to /compact, approximately ~20s.
# From your project directory
claude plugin marketplace add kylesnowschwartz/claude-handoff
claude plugin install claude-handoff
Trigger goal-focused handoff:
/compact handoff:now implement this for teams as well, not just individual users
/compact handoff:execute phase one of the created plan
/compact handoff:find other places in the codebase that need this same fix
Regular compact (no handoff):
/compact
/compact keep the context tight
Enable debug logging: Edit handoff-plugin/hooks/lib/logging.sh and set LOGGING_ENABLED=true
View logs:
tail -f /tmp/handoff-precompact.log /tmp/handoff-sessionstart.log
This plugin follows the Claude Code plugin architecture:
.claude-plugin/marketplace.json - Local marketplace definitionhandoff-plugin/.claude-plugin/plugin.json - Plugin metadatahandoff-plugin/commands/ - Slash commandshandoff-plugin/hooks/ - Hook implementationsMIT - See LICENSE file for details
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub kylesnowschwartz/claude-handoff --plugin claude-handoffUnified review, refactoring, and cleanup workflows with specialized analysis agents
Core SimpleClaude framework with intent-based commands and specialized agents
Skills and agents for diagrams, codebase patterns, hypothesis testing, Socratic thinking, file querying, frontend design, image generation, and command creation
Learn Claude Code by building real things, one level at a time
Enforces git diff thresholds to promote disciplined code review during AI agent sessions
Claudikins Automatic Context Manager - seamless context handoff for Claude Code
Ultra-compressed communication mode. Cuts ~75% of tokens while keeping full technical accuracy by speaking like a caveman.
Memory compression system for Claude Code - persist context across sessions
Multi-model consensus engine integrating OpenAI Codex CLI, Gemini CLI, and Claude CLI for collaborative code review and problem-solving.
Curate auto-memory, promote learnings to CLAUDE.md and rules, extract proven patterns into reusable skills.
Unified status line for Claude Code with multi-CLI (Claude, Codex, Gemini, z.ai) usage monitoring, context, rate limits, and cost tracking