[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.
Showing cached comments. Read the full discussion on GitHub ↗
8 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Thanks bot. Reviewed the candidates — none is a clean duplicate, but two are genuinely adjacent:
/handoveris single-user, same-machine, linear baton-pass./handoveris an integrated in-app session-transition flow — one keystroke, draft → optional edit → fresh session pre-seeded → original archived. Could share a summarisation engine; different UX surface./clsas the example user-facing form./handoveris essentially the native-command version of the same need. If maintainers prefer to consolidate: enabling #35150's hook surface would let/handovership as a built-in skill rather than core code. Either path satisfies the underlying ask. Happy to close and roll into #35150 if that's preferred — leaving open for triage.The core differentiation from
/compactand friends (user-driven timing decoupled from context-pressure, optional rather than mandatory curated step, higher fidelity than auto-compact summaries) still holds against these candidates.I've been dealing with this same problem manually. I have my own /context:handoff command that does this before I run /clear, then paste in the the handoff to resume from. How can I upvote this 1M times?!?!?
Hit the same need and built https://github.com/yacb2/claude-session-handoff as a workaround for this exact
/handovershape — a wrapper +/handoffslash command that closes the currentclaudeand opens a fresh one with a handoff prompt seeded via theSessionStarthook (additionalContextfor the model,systemMessagebanner so the user sees the handoff). Three trigger paths: ahandoff:prefix (zero tokens,UserPromptSubmithook), the/handoffslash command, and a natural-language skill that fires on phrases like "start a new session keeping the plan" or "continue this in a fresh session". Does not touch/resumeor.jsonlstorage; the seeded context is whatever you (or the skill) curate at handoff time — so it's the manual escape hatch, not a built-in/handover.the part that bites in the handover-vs-compact framing is that 'current state' (files modified, branch, in-progress edits) isn't in the transcript the model summarizes. /compact and a drafted hand-off both work over the conversation log, but the git and filesystem state the agent touched lives outside it. so the hand-off is the model's reconstruction of state, not ground truth, and it drifts the moment an edit landed without being narrated back. intent fidelity helps, the state half still leaks. what held for us was keeping the session durable out-of-process, so a restart reloads the real thread, not a summary.
if useful, how we keep sessions durable across restart instead of replaying a summary: https://fazm.ai/r/fykzrwjd
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
Hi @Jonathan-7, I’m looking into how people actually carry state across long Claude Code sessions. You mentioned that explicit handoff prompts preserve decisions and rationale better than /compact. In the last handoff you had to do manually, what did /compact tend to lose, and roughly how much effort did it take to get a clean handoff together? I’m researching the workflow, not pitching anything.