[FEATURE] /handover — user-curated session hand-off with fresh context
Summary
Native slash command for intentional, user-curated session hand-offs to a fresh context window. Distinct from /compact (automatic, in-place, lossy on decisions) and from /resume / --fork-session (both reload existing history).
Problem
Long Claude Code sessions hit context pressure. Native options today:
/compact— automatic summary; recent tool output crowds out earlier decisions; user can't cherry-pick what survives; quality is noticeably lower than what the model produces when explicitly asked to write a hand-over prompt/resume/--continue— reloads the bloated history, doesn't free space--fork-session— branches from current point, but full history still loadedCLAUDE.md/ auto-memory — solves cross-session durable facts, not mid-session transient state
The community workaround: ask the model to write a hand-over prompt (goal, decisions, constraints, current state, next steps, dead-ends), /clear, paste into a new session. In practice this produces significantly higher-fidelity continuity than /compact — the model, when prompted explicitly to draft a hand-off, preserves load-bearing decisions and rationale that the auto-compact summary loses. But it's friction users repeat session after session.
Proposed Solution
A /handover command that:
- Drafts a structured hand-off prompt from the current session, surfacing:
- Goal
- Decisions made (with rationale)
- Constraints discovered
- Current state (files modified, branch, in-progress changes)
- Next steps
- Approaches tried and rejected
- Shows the draft inline with accept / cancel / edit options. Default flow is one-keystroke accept — no mandatory editor round-trip. An optional shortcut (e.g.
Ctrl+G, or a--editflag) opens the draft in\$EDITORfor users who want to curate before committing. - Starts a fresh session in the same cwd, pre-seeded with the (optionally curated) hand-off as the first user message.
- Archives the original session with bidirectional links (
handed-off-to/handover-from) so it's still navigable in the picker — same plumbing as proposed in #49146. - Flags:
--edit(open in\$EDITORbefore commit);--non-interactive(SDK / scripted use).
Why This Is Different From Existing Issues
- #49146 — improves
/compact's UX (preserve archive, continue in new session). Still automatic summarisation./handoveris a different mode: explicit user-triggered, with a different drafting prompt aimed at intent fidelity rather than transcript compression. - #51998 — session templates: reusable starting points for parallel branches ("read 50 files once, fork to N feature branches").
/handoveris a linear baton-pass for one ongoing thread of work. - #38210 — agent auto-restart. Automation-focused, not interactive.
Complementary, not duplicates. /handover could share the archive-and-link plumbing with #49146.
Why User-Driven Timing Matters
/compact fires on context pressure. But the right time to hand off often has nothing to do with token count:
- Finished a discrete sub-task and want to start the next phase fresh
- The session has accumulated dead-end exploration that's polluting the model's framing
- Switching from research mode to implementation mode and want a clean slate
- About to step away and want a self-contained baton for tomorrow / for a colleague
Today the user has to either wait for /compact to fire (wrong moment, lossy output) or do the manual hand-off dance. /handover gives them an explicit "I decide when to turn the page" lever, decoupled from context window mechanics.
Why The Curated Step Matters (Optional, Not Mandatory)
The reason model-drafted hand-overs beat /compact is fidelity of intent, not fidelity of detail — the prompt itself is doing the work. The default flow should be one-keystroke accept of the draft, because the draft is already good. Editing is the safety valve for users who want to drop a rejected approach or add a constraint the model missed, not a mandatory step.
Workflow Integration
- New hook events
PreHandover/PostHandover, parallel toPreCompact/PostCompact. --promote-durableflag asks the user to mark facts as durable → auto-appended toCLAUDE.mdor auto-memory rather than carried only in the hand-off. Over repeated hand-offs, durable knowledge migrates out of the prompt and into memory; the prompt naturally shrinks.
Priority
Medium-high. With 1M-context models and longer agentic workflows, /compact's lossiness is a recurring pain point. The manual workaround is widespread and produces noticeably better continuity than the native option — making it native both standardises a converged-on pattern and gives users explicit control over hand-off timing.
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗