Prepare handoff to successor agent when approaching context limits
From arevlo:swarmnpx claudepluginhub arevlo/claude-code-workflows --plugin arevlo-swarm/handoffGenerates structured Markdown handoff document with git status, session progress, learnings, files touched, and resume instructions for another Claude session. Supports --full and --compact modes.
/handoffEnds swarm session: summarizes work/blockers, persists state via hivemind_store and git, cleans agents/tasks/reservations, updates hive, generates handoff note.
/handoffGenerates a developer handoff package for the specified screen, feature, or component, including visual specs, interaction specs, QA checklist, assets, and notes.
/handoffSaves session state snapshot as structured JSON to docs/tasks/<branch>/session_logs/<timestamp>_handoff.json, capturing git status, progress summary, tasks, and context for resume.
/handoffCreates a detailed handoff plan summarizing conversation, technical details, code, decisions, and next steps for continuing work in a new session.
/handoffCreates handoff branch from main, scratchpad with analysis/plan/files/testing, PR, roadmap entry, and copy-paste worker prompt for task delegation.
Create continuation context and spawn successor agent.
/handoff [goal]
Prompt user:
Handoff preparation.
Please run the following command:
/export
Save to: .claude/swarm/handoff/session-final-$(date +%Y%m%d-%H%M%S).txt
(You can download the export or copy to clipboard, then save to the path above)
Wait for user confirmation that export was saved.
From the export and current working memory, create:
## Continuation Prompt for Successor Agent
### Context Source
Load from: .claude/swarm/handoff/session-final-{timestamp}.txt
### Mission
[Original goal from export or args]
### Progress So Far
- [Completed work]
- [Current state]
- [Blockers/challenges encountered]
### Files Modified
- `path/file.ts` - [changes made]
- `path/other.ts` - [changes made]
### Critical Context
[Essential information successor needs]
### Immediate Next Steps
1. [Next action]
2. [After that]
3. [Long-term goal]
### Approach/Strategy
[How to proceed, lessons learned]
### Available Resources
- Research: [path if exists]
- Plan: [path if exists]
- Progress checkpoints: [paths]
- Full session export: .claude/swarm/handoff/session-final-{timestamp}.txt
Save to: .claude/swarm/handoff/continuation-prompt-{timestamp}.md
Use Task tool with subagent_type: "general-purpose"
Prompt:
You are continuing work from a prior session that reached context limits.
Load context from: .claude/swarm/handoff/continuation-prompt-{timestamp}.md
Your mission: {goal}
Current state: {state from prompt}
Next steps: {steps from prompt}
Continue the work seamlessly. Full session history available at:
.claude/swarm/handoff/session-final-{timestamp}.txt
(Reference if you need detailed context)
IMPORTANT: You have a fresh context window. Work efficiently to complete the mission.
Original agent reports:
ā Handoff complete
Successor agent spawned to continue work.
Continuation prompt: .claude/swarm/handoff/continuation-prompt-{timestamp}.md
Full context: .claude/swarm/handoff/session-final-{timestamp}.txt
Original session ending gracefully.