Feature Request: Session Handoff / Continuity Support
Feature Request: Session Handoff / Continuity Support
For: Claude Code CLI (https://github.com/anthropics/claude-code)
Proposed By: Patrick Hardiman (systems integrator, MeritWorks platform development)
Date: 2025-11-11
---
Problem Statement
Current Limitation: Claude CLI sessions are stateless. When a session ends, context and pending tasks are lost unless manually documented by the user.
Real-World Impact:
- Multi-day workflows require users to manually brief Claude at session start ("we were working on X, next step is Y")
- Complex projects lose momentum between sessions
- Users must maintain external task lists or rely on memory
- No built-in way to track project progression over time
- Onboarding new team members requires explaining full project history
Example Scenario:
Day 1 Session: Set up infrastructure, configure integrations (80% complete)
End: User exits session with pending tasks
Day 2 Session: User starts fresh, must re-explain context
Problem: Wasted time, potential missed tasks
---
Proposed Solution
Add built-in session handoff support to Claude Code CLI via a standardized continuity file.
Core Mechanism
.claude/handoff.md - Standardized file for passing context between sessions
Automatic Behavior:
- SessionEnd: Prompt Claude to write
.claude/handoff.mdwith pending tasks - SessionStart: Auto-read
.claude/handoff.mdand incorporate into session context - Auto-Archive: Move previous handoffs to
.claude/session-history/YYYY-MM-DD.md
File Format (Suggested)
# Session Handoff - [Date]
## Completed This Session
- ✅ Task 1
- ✅ Task 2
## Pending for Next Session
- [ ] Priority 1 task
- [ ] Priority 2 task
## Context Notes
- Key decision made: ...
- Blocker discovered: ...
- Reference files: ...
## Next Steps
1. First thing to do
2. Second thing to do
---
Implementation Options
Option A: Automatic (Recommended)
SessionEnd Hook:
{
"hooks": {
"SessionEnd": {
"type": "prompt",
"prompt": "Review current session state. Write .claude/handoff.md with completed tasks, pending tasks, context notes, and next steps."
}
}
}
SessionStart Hook:
{
"hooks": {
"SessionStart": {
"type": "prompt",
"prompt": "Check for .claude/handoff.md. If exists: (1) Read and incorporate into session context, (2) Archive to .claude/session-history/YYYY-MM-DD.md, (3) Present summary to user"
}
}
}
User Experience:
$ claude
Claude Code CLI starting...
📋 Previous session handoff found (2025-11-10)
Completed last session:
✅ Jira MCP integration configured
✅ Credentials secured
Pending tasks:
• Test Jira MCP connection
• Create MW-* projects
• Build jira-orchestrator agent
Ready to continue where we left off!
User: Let's do it
Option B: Manual (Opt-In)
Add CLI flag for users who want control:
$ claude --save-session # Prompt for handoff at end
$ claude --load-session # Read handoff at start
Option C: Configuration Setting
{
"sessionHandoff": {
"enabled": true,
"autoSave": true,
"autoLoad": true,
"archiveHistory": true
}
}
---
Benefits
For Individual Developers
- ✅ Zero context loss between sessions
- ✅ Explicit task tracking (no guessing "where were we?")
- ✅ Multi-day workflow support (setup → build → test → deploy)
- ✅ Built-in project history (session-history/ shows progression)
- ✅ Reduced cognitive load (Claude reminds you what's pending)
For Teams
- ✅ Knowledge transfer (developer A leaves handoff for developer B)
- ✅ Onboarding (new team members read project handoff)
- ✅ Collaboration (team shares Claude sessions via git)
- ✅ Accountability (handoff shows what was actually completed)
For Claude
- ✅ Better context continuity (Claude knows project state)
- ✅ More effective assistance (understands what's pending)
- ✅ Reduced redundant explanations (user doesn't re-explain every session)
---
Proof of Concept
We've implemented this pattern manually for the MeritWorks platform and it works exceptionally well:
Our Implementation:
.claude/next-session.md- Active handoff file.claude/session-history/- Archive of previous handoffs- Manual workflow: User asks Claude to write/read handoff files
Results:
- Seamless multi-session workflows (setup → test → deploy)
- Clear task progression across days
- Zero missed tasks or context loss
- Historical reference (what did we build last week?)
Files Created (can share examples):
SESSION_HANDOFF_PATTERN.md- Documentation of our manual patternnext-session.md- Example handoff file with tasks/context
Validation: This feature request comes from real-world usage where we identified the need and prototyped a solution.
---
Use Cases
1. Complex Infrastructure Setup
Session 1: Install dependencies, configure services (70% done)
Handoff: "Next: Test MCP connection, create projects"
Session 2: Picks up exactly where left off
2. Multi-Step Workflows
Session 1: Design API schema
Handoff: "Next: Implement endpoints, write tests"
Session 2: Build endpoints
Handoff: "Next: Deploy to staging, run integration tests"
Session 3: Complete deployment
3. Team Collaboration
Developer A Session: "Investigated bug, found root cause in auth module"
Handoff: "Root cause: JWT validation timing issue. Fix: Update middleware."
Developer B Session: Reads handoff, implements fix
4. Long-Running Projects
Week 1: Foundation setup
Week 2: Core features
Week 3: Integration work
Each session reads previous week's handoff for continuity
---
Alternative Considered
Why not just use git commit messages or project management tools?
- Commit messages are code-focused (what changed), not session-focused (what's next)
- Project management tools (Jira, etc.) are external to Claude context
- Handoff files are Claude-specific context (what Claude needs to know)
- Lives in
.claude/directory (gitignored by default, optional to commit) - Tighter integration: Claude reads/writes directly without external tools
Complementary, not replacement: Handoff files complement commits/PM tools, don't replace them.
---
Security & Privacy Considerations
File Location: .claude/handoff.md (local, not cloud-synced)
Gitignore by Default:
# .claude/.gitignore (auto-generated)
handoff.md
session-history/
Opt-In Sharing: Users can choose to commit handoffs to git for team sharing
No Sensitive Data: Guidelines to avoid credentials/secrets in handoff files
---
Configuration Options (Suggested)
{
"sessionHandoff": {
// Enable/disable feature
"enabled": true,
// Automatically save handoff at session end
"autoSave": true,
// Automatically load handoff at session start
"autoLoad": true,
// Archive previous handoffs to session-history/
"archiveHistory": true,
// Handoff file location (relative to .claude/)
"handoffFile": "handoff.md",
// Archive directory (relative to .claude/)
"archiveDir": "session-history",
// Archive filename format
"archiveFormat": "YYYY-MM-DD-HHmm.md",
// Prompt user before saving/loading
"promptUser": false,
// Maximum archive files to keep (0 = unlimited)
"maxArchiveFiles": 100
}
}
---
User Interface Suggestions
SessionEnd Prompt (if not automated)
Your session is ending. Would you like to save a handoff for the next session?
[Y/n]:
Claude will create .claude/handoff.md with:
• Completed tasks
• Pending tasks
• Context notes
• Next steps
SessionStart Message (if handoff found)
📋 Session handoff from 2025-11-10 17:34
Last session completed:
✅ Jira MCP integration
✅ Nomenclature updates
Pending for this session:
• Test MCP connection
• Create MW-* projects
• Build jira-orchestrator agent
Type 'show handoff' to see full details
Type 'clear handoff' to start fresh
CLI Commands (optional)
claude handoff save # Manually save handoff
claude handoff load # Manually load handoff
claude handoff show # Display current handoff
claude handoff clear # Clear handoff (start fresh)
claude handoff history # List archived handoffs
---
Migration Path
Phase 1: Add basic handoff support (write/read files)
Phase 2: Add SessionStart/SessionEnd hooks
Phase 3: Add archive/history management
Phase 4: Add UI polish (prompts, commands)
Backward Compatibility:
- Disabled by default (opt-in via config)
- No breaking changes to existing workflows
---
Success Metrics
Adoption:
- % of users who enable sessionHandoff
- Number of handoff files created/read
- Session continuity rate (users who read previous handoff)
Impact:
- Reduced time to resume work (measure session start productivity)
- User satisfaction (survey: "Does handoff improve workflow?")
- Feature requests for enhancements (validates usefulness)
---
References
Similar Features in Other Tools:
- tmux: Session persistence (terminal state)
- Jupyter Notebooks: Cell state preservation
- Git: Commit messages (what changed, for code)
- Project Management: Kanban boards (task state)
What's Different:
- Handoff is Claude-specific context (not code, not tasks, but session state)
- Lightweight (markdown file, not database)
- Human-readable (can be edited manually)
- Version-controllable (optional git commit)
---
Example Handoff File (From MeritWorks)
# Session Handoff - Next Session Tasks
**Date Created**: 2025-11-11
**Previous Session**: Jira MCP Setup Complete
**Next Session**: Test Jira MCP & Create Projects
---
## ✅ What's Ready
- Jira MCP server installed and configured at `/meritworks/mcp-servers/jira/`
- Credentials in `.env` file (tested & working)
- Claude Code CLI configured with `.mcp.json` and `settings.local.json`
- MCP tools available: 22 Jira tools (create, update, search, sprint management)
- Nomenclature updated: MW-DEV, MW-BIZ, MW-EDU (MERITWORKS-*)
---
## 🎯 Tasks for Next Session
### Priority 1: Test Jira MCP Integration
- [ ] Verify MCP server loads (check available tools)
- [ ] List all Jira projects (should see CC, HSP, TPM)
- [ ] Test basic connectivity to hardimantech.atlassian.net
### Priority 2: Create MeritWorks Projects
- [ ] Create MW-DEV (MERITWORKS-DEV) - Development work
- [ ] Create MW-BIZ (MERITWORKS-BIZ) - Business tasks
- [ ] Create MW-EDU (MERITWORKS-EDU) - Curriculum development
### Priority 3: Create First Ticket
- [ ] Create MW-DEV-1: "Jira MCP Integration Complete"
---
## 📋 Next Steps After Testing
Once Jira MCP is verified:
1. Build jira-orchestrator agent
2. Document Socrates NAS architecture
3. Set up Moodle Dev environment
---
## 🔧 Troubleshooting Reference
If MCP server not available:
- Check `.mcp.json` exists in `/meritworks/`
- Verify `enableAllProjectMcpServers: true` in settings
---
## 💡 Notes from Previous Session
- Patrick loves the MERITWORKS-* naming - wants to see the brand everywhere
- Systems integrator mindset: making disparate systems work together
- Architecture split: Dev tools on WSL (when working), Socrates on NAS (always-on)
---
Conclusion
Session handoff support would significantly improve multi-session workflow continuity in Claude Code CLI.
Key Value:
- Solves real pain point (context loss between sessions)
- Simple implementation (markdown files + hooks)
- Proven useful (we're using manual version successfully)
- Broad applicability (individuals, teams, long-running projects)
Request: Consider adding this feature to Claude Code CLI. Happy to collaborate on implementation, provide feedback, or test beta versions.
---
Contact
Reporter: Patrick Hardiman
Email: patrick@hardimantech.com
Use Case: MeritWorks platform development (integration-heavy, multi-session workflows)
Prototype: Available in meritworks/.claude/ directory
Willing to:
- Provide detailed use case examples
- Test beta implementations
- Contribute to documentation
- Share feedback from real-world usage
---
This feature request comes from actual development work where we identified the need, prototyped a solution, and validated its usefulness. We believe it would benefit the broader Claude Code community.
22 Comments
That's a pretty clean implementation, but this domain is quite active right now. I've worked out a similar solution. So has the next person who might comment here, and thousands and thousands of others. There are numerous YouTube videos on the topic, papers, conversations about it at the local bar.
So this surfaces the question: what makes your solution better than mine, better than the guy sitting next to me on the bus, better than what Anthropic employees scaffold out on occasion?
It's definitely something that should be a native feature in Claude Code, but I wonder if it isn't because there are so many ways to tackle this - and many would rather take a day to establish their own framework for cross-session continuity, than adopt an opinionated external framework.
https://ampcode.com/news/handoff
Thanks for the update, @towry. Awesome feature.
Strong support for this. Session handoff is table stakes for any serious development workflow.
Real scenario:
Day 1: Start complex refactoring task, build up context about codebase architecture, decisions made, approach chosen.
Day 2: Session is gone. Re-explain everything. Lose the nuance of why certain decisions were made.
Day 3: Same thing. Eventually give up on complex multi-day tasks in Claude Code.
What's needed:
/save-session my-refactoring-projectclaude --resume my-refactoring-projectIntegration with claude.ai:
Ideally, saved sessions could be accessible from claude.ai too. One context, multiple interfaces.
The ask:
Either implement session continuity, or permit users to build their own continuity tools by allowing programmatic access to our own sessions. We're paying $200/mo - we should be able to preserve our own work.
Using amp at work, I can confirm that handoff is incredibly useful. That said, it might be hard to implement this well. Everything depends on the quality of the prompt that it generates for its future self.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
I wonder what is meant by "occurring" in this context, but the feature request remains. It is certainly worthy of a non-automated response.
Here I am in Feb 2026, figuring this out organically and building it now, only to come across this.
Can we have the standard now? I'm probably sticking with my own solution but it's kind sad to see this hasn't been solved to a general state yet.
Built an open-source CLI that solves this: npx handoff-md , analyzes your repo and generates a HANDOFF.md for any AI model. github.com/guvencem/handoff-md
I haven't tested, but reviewed the repo. I'm a big fan of lean and mean, no-BS resources. This looks to be one of them. Thanks for the share, and it's likely yet another good reference, if
handoff-mdisn't used directly. I had something quite similar ~1 year ago, when working with the "cutting edge" AI friends of the time, when contexts were much smaller and things in general weren't as wild as they are now... I never took the time to share it with anyone, because I figured "_there's no way 57,002 others aren't already doing this, including the proud parents of these totally-not-sentient AI_"... wish I'd slapped a repo up to spark a fire around the concept!Keep up the good work, and thanks again for sharing.
Maybe it didn't exist when this issue was filed, but I am confused now this isn't met with
--continueor--resumealready, all sessions are already persisted and resumable. There is also/exportfor a markdown-formatted copy of a session.I _would_ like a first class way to move a session to a different machine though, e.g. from a CI system to local. I can hack something together by moving the session dir with JSONL but seems fragile.
Working Implementation: Plan-Aware Session Handoff via Slash Commands + Hooks
We've been running into this exact problem daily — especially when using Superpowers for plan-driven development. The workflow breaks at the plan→execution boundary: you spend significant context building a plan, then either (a) clear context and lose the reasoning, or (b) keep context and run out of room executing.
What we built (working today)
Two slash commands that bridge the gap using existing Claude Code infrastructure:
/create_handoff— Run before ending a session or when context is high. It:docs/superpowers/plans/*.mdor native.claude/plans/)thoughts/shared/handoffs/{session}/handoff-{date}.md/resume_plan— Run at the start of a new session. It:How it connects to existing hooks
We have a
Stophook (auto-handoff-stop.py) that blocks at 70% context usage and tells you to run/create_handoff. ASessionStarthook (session-start-continuity.sh) auto-loads the handoff in the next session. APreCompacthook saves continuity state before compaction.Why this matters more than just "write a markdown file"
The key insight is that the handoff must be plan-aware. A generic summary loses the structure. The handoff needs to know which tasks from the plan are done, which remain, and what the next concrete step is — not just "continue the refactor."
What we'd love natively
The three primitives already exist: plan files on disk, background Agent tool, TaskOutput monitoring. Wiring them together at
ExitPlanMode(as proposed in #30510/#30438) would eliminate the manual/create_handoffstep entirely. Even a simpler/compactoption (instead of full context clear) at plan exit would help enormously — per #38244.Happy to share the full command implementations if useful.
— Boris @ 199 Biotechnologies
I feel like many devs have built a similar system within their own workflow. I'm using a session memory schema with a heartbeat.md/Claude.md set-up and automatic updates of those files on a rolling basis.
My own mantra is - Each dev cycle creates the tools to repeat itself. Everything built is a single use case containing a general application seed crystal. Memory is the Upgrade. The more Persistence we can automate the better.
Posting for anyone searching for the cross-machine, same-CLI flavor of this:
@neoacar/claude-handoff— an open-source CLI that packages a Claude Code session (main transcript + subagent transcripts +memory/+ metadata) into.claude-shared/in the repo, rewrites absolute paths to portable placeholders, redacts secrets, and reconstructs the bundle on the receiver's machine soclaude --resumelists it with the original title and full history intact.How it differs from what's already in this thread:
--resume+/export(@stbenjam): both exist and are great — but--resumeonly finds sessions in the local~/.claude/projects/, and/exportproduces a markdown copy for humans, not a resume-able transcript. This tool makes the actual session JSONL travel between machines.handoff-md(@guvencem): generates an AI-agnostic markdown summary. Different goal — great for prompting a fresh session. This one preserves the real transcript so you don't lose fidelity on resume.Works today for single-machine → another-machine handoff through a git repo. Install:
npm install -g @neoacar/claude-handoff. Feedback welcome.This is extremely well thought out, and the fact that you've already built and validated the manual version (
next-session.md+ archive) proves the need is real.Having implemented essentially this same pattern (but as an MCP memory server rather than file-based), a few observations:
What works better than handoff files: Structured, queryable memory that any session can read/write at any time — not just at session boundaries. The handoff-at-exit pattern has a failure mode: if the session crashes or the user just closes the terminal, the handoff never gets written. And it requires the next session to start from the handoff, rather than any session being able to query "what's the current state of X?"
I built Recall for this — open-source MCP memory server (MIT licensed) that provides persistent, queryable memory across sessions:
remember— store a fact, decision, or task state at any time during a session (not just at exit)recall— search for relevant memories from any session. "What were we working on?" returns the answer.claim/release/handoffprimitives let agents formally transfer context to each otherYour "multi-step workflow" example would look like:
Each
rememberis immediate — no session-end hook needed. Any session can query at any time.uvx ai-recallworksto try it. GitHub: https://github.com/RecallWorks/RecallHit the same multi-day-context-loss problem and built a workaround: https://github.com/yacb2/claude-session-handoff. It closes the current
claudeand opens a fresh one with a handoff prompt seeded asadditionalContextvia theSessionStarthook, plus asystemMessagebanner so the user can see they're in a handoff session. Trigger via ahandoff:prefix (zero tokens,UserPromptSubmithook), a/handoffslash command, or a natural-language skill. Doesn't auto-archive — that still needs the officialSessionEndprompt hook you propose.Adding my vote here. Even with
claude agentsyou basically run into this problem. Need an official handoff or way to spawn another agent. Main goal is to avoid context bloat, among other things of course.The shift from handoff files to persistent queryable memory (@stevepaltridge) is the right direction. Writing context at session boundaries is fragile — crashes lose everything, and you can only query at start/end, not mid-session.
I've been building Context Cloud along similar lines — an MCP server where any session can read/write structured knowledge at any time, no hooks or session boundaries needed. A few things that came out of the build process that might be useful to this thread:
Typed knowledge matters. Raw text memory gets noisy fast. Context Cloud chunks everything into types — decision, finding, convention, state, question, reference — so when a session recalls context, it can differentiate "this is a decision we made and why" from "this is where things currently stand." Helps a lot with the stale-context problem several people mentioned.
Cross-tool is the unlock most people don't expect to need. Works across Claude (web/desktop/Code), Cursor, Codex, Windsurf. You commit a decision from Claude Code, recall it from Cursor tomorrow. Turns out most teams use more than one AI tool.
Team memory is the layer nobody here has built yet. Shared workspaces with roles, email invites, attribution on every chunk. Your teammate commits context from their session, your session recalls it. This is where individual continuity becomes team continuity — the handoff isn't a file, it's a shared knowledge layer that's always current.
Eval results: 99.4% accuracy on our test suite, 94/100 on a 20-session stress test with evolved facts and adversarial phrasing. Detail capture at 95.7–97.1%.
Free to try: contextcloud.pro | npm: @contextcloud/mcp-client | GitHub
Adding a note from the persistence/durability angle that hasn't been covered yet in this thread.
The "stateless session" framing in the original report is exactly right, but the thing that makes it a production problem rather than just an inconvenience is the interaction with compaction. When a session auto-compacts, the handoff file or continuation prompt you prepared for the next session is now decoupled from the session that produced it — and if the user resumes without realizing compaction happened, they're starting from partial state without knowing it.
We hit this building a multi-project GTM polling runner where each cycle dispatches 2–3 Claude Code agents in sequence. The pattern that works without native support:
completed_at, outcome, key context for successor)This is basically the "context injection at session start" pattern @stevepaltridge described, operationalized at the scheduler layer rather than the hook layer. It's more robust than file-based handoffs alone because the scheduler can verify the record was written before spawning the next session.
The native feature that would eliminate the external plumbing entirely: a first-class
SessionEndhook that persists a structured summary, keyed by project + workflow ID, and a matching--resume-workflow <id>flag that injects it at session start. That's the minimal surface needed to make multi-day orchestration not require an external process babysitting it.(Disclosure: I build Claudiverse — an agent orchestration tool built on top of Claude Code. The pattern above is what we do today. The feature request in this issue would make the native experience match what you'd expect from a production-grade tool.)
Strongly support this. One behavioral nuance from heavy real-world use worth folding in:
Beyond save-on-end / load-on-start, the high-value habit is read-before-acting + flag-divergence: before interpreting ANY new instruction or data mid-session, the agent re-reads the relevant handoff/log and checks the request against the recorded plan — and explicitly flags mismatches instead of advising from a blank slate.
In one long multi-topic session this caught the agent's own premature conclusions four separate times — each time the logs corrected it before I had to. So the handoff isn't just for session boundaries; consulted continuously, it becomes the source of truth that stops the agent re-deciding things already settled. Worth making "consult the handoff before acting" part of the default, not just "write it at the end."
I'm building a Claude/Codex session sharing platform, currently only supporting public sessions. Have a look here: https://joe-store-frontend.onrender.com
https://github.com/TomSOhm/claude-session-port , here's the cross-machine flavor, close to what @stbenjam proposed: moving a session machine-to-machine (CI→local).
It packages one session's real JSONL (so claude --resume actually resumes it, full history intact) into a single .tar.gz. No cloud, no git remote, no account; you pick the transport. Path/home remap handles cross-OS.
Credit where due: @NeoAcar's claude-handoff (above) does the same core thing, and goes further with default secret redaction and batch export, so it's worth a look. However, mine is a standalone tarball needing no repo, installs as a Claude Code plugin with slash-command, includes a helper that resolves each /resume picker row to its UUID by file size.
Tested on Windows so far; actively looking for macOS/Linux and cross OS export/import testers to confirm a moved session resumes. Not a substitute for a native feature, just a stopgap that works today.