[FEATURE] /handover — user-curated session hand-off with fresh context

Status Closed — not planned
Maintainer reply None cached
Activity 9 comments · opened Apr 28, 2026 · closed Jul 4, 2026

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 loaded
  • CLAUDE.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:

  1. 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
  1. 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 --edit flag) opens the draft in \$EDITOR for users who want to curate before committing.
  2. Starts a fresh session in the same cwd, pre-seeded with the (optionally curated) hand-off as the first user message.
  3. 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.
  4. Flags: --edit (open in \$EDITOR before 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. /handover is 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"). /handover is 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 to PreCompact / PostCompact.
  • --promote-durable flag asks the user to mark facts as durable → auto-appended to CLAUDE.md or 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.

View original on GitHub ↗

8 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/40439
  2. https://github.com/anthropics/claude-code/issues/46608
  3. https://github.com/anthropics/claude-code/issues/35150

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

Jonathan-7 · 5 months ago

Thanks bot. Reviewed the candidates — none is a clean duplicate, but two are genuinely adjacent:

  • #46608 is a different primitive — org-scoped session sharing across developers (ACLs, URLs, fork-by-another-account). /handover is single-user, same-machine, linear baton-pass.
  • #40439 is related but distinct in shape. That issue proposes a one-way export to a portable artifact (file you can move/share). /handover is 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.
  • #35150 is the closest match. It proposes the plumbing (skills can clear + inject a continuation prompt) with /cls as the example user-facing form. /handover is essentially the native-command version of the same need. If maintainers prefer to consolidate: enabling #35150's hook surface would let /handover ship 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 /compact and 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.

arielperez82 · 5 months ago

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?!?!?

yacb2 · 4 months ago

Hit the same need and built https://github.com/yacb2/claude-session-handoff as a workaround for this exact /handover shape — a wrapper + /handoff slash command that closes the current claude and opens a fresh one with a handoff prompt seeded via the SessionStart hook (additionalContext for the model, systemMessage banner so the user sees the handoff). Three trigger paths: a handoff: prefix (zero tokens, UserPromptSubmit hook), the /handoff slash 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 /resume or .jsonl storage; 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.

m13v · 4 months ago

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.

m13v · 4 months ago

if useful, how we keep sessions durable across restart instead of replaying a summary: https://fazm.ai/r/fykzrwjd

github-actions[bot] · 3 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

tamilov · 1 month ago

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.

Showing cached comments. Read the full discussion on GitHub ↗