| description | Snapshot this session into a handoff doc, then /clear and reload it in a fresh thread | |
|---|---|---|
| argument-hint |
|
You are performing a CONTEXT HANDOFF for the current Claude Code session: capture everything needed to continue, then clear this session and reload from the doc in a fresh thread (same process, empty context).
The user's steering for this handoff — what the next session should focus on and any specific instructions: $ARGUMENTS
Do this, in order:
-
Compose a handoff document that lets a fresh session with ZERO prior context continue this work. Include:
- Goal — the overall task/objective.
- Current state — what's done, in progress, verified vs. not.
- Key files & locations — paths touched or relevant, one line each.
- Decisions & constraints — choices made and why; anything to NOT do.
- Next steps — concrete, ordered actions, weighted toward the user's steering above.
- Gotchas / commands — how to run/test, env quirks, non-obvious context.
- Open questions — anything unresolved. Tight, factual prose. Assume a competent reader with no memory of this conversation.
-
Write the doc. Mint a unique path in
/tmpand write there with the Write tool:- Run:
echo "/tmp/handoff-$(date +%Y%m%d-%H%M%S).md" - Write the document to that exact path.
- Run:
-
Verify you are in tmux. Run
echo "$TMUX_PANE". If it is EMPTY, STOP — do not clear anything; tell the user this session is not running inside tmux so the in-place handoff is impossible, and point them at the doc you just wrote. -
Launch the handoff (only if $TMUX_PANE is non-empty). Run, substituting the real pane id and the doc path from step 2:
bash ~/.claude/handoff/clear-and-prompt.sh "$TMUX_PANE" "Continue from a handoff. Read <DOC_PATH> in full, then carry out the work it describes." -
End your turn immediately with a one-line confirmation, e.g. "Handoff written to — clearing and reloading now." Do NOT keep working: the turn must yield so the queued /clear can fire on an idle REPL.