[Feature Request] Seamless in-session upgrade — apply updates without exit/restart/resume workflow
Problem
When a new version of Claude Code is released and installed (via brew upgrade, npm update, or auto-update), the update only takes effect for new sessions. The currently running session continues using the old binary loaded in memory.
This creates a disruptive workflow:
- User is in the middle of a productive session
- User upgrades Claude Code (or auto-update runs)
- To use the new version, user must:
- Exit the current session
- Start a new session
- Find and resume the previous session via
--resume - Accept the quality degradation that comes with resumption
The Deeper Problem: Quality Degradation on Resume
Even with --resume, there is documented quality loss. As noted in the DoltHub Claude Code Gotchas article:
"Claude Code is definitely dumber after the compaction. It doesn't know what files it was looking at and needs to re-read them. It will make mistakes you specifically corrected again earlier in the session."
This means the exit → upgrade → resume workflow doesn't just add friction — it actively degrades session quality because:
- Behavioral conditioning is lost: The AI forgets corrections and patterns learned during the session
- File awareness resets: Must re-read files it was already working with
- Repeated mistakes: Makes errors that were already corrected earlier
- Mental model disruption: Loses the accumulated understanding of the task
For sessions that have compacted multiple times, this degradation compounds — the AI has already lost some conditioning at each compaction, and a full restart/resume loses even more.
Who This Impacts Most
- Power users with long, complex sessions
- Sessions that have compacted multiple times
- Multi-file debugging or refactoring tasks
- Users who have spent time correcting and training the AI during the session
- Anyone who doesn't want to sacrifice session quality just to get a bug fix
Proposed Solution
Implement a graceful in-place update mechanism that preserves the running session's full state.
Option A: /upgrade Slash Command (Recommended)
User runs /upgrade
→ Claude Code serializes full session state (conversation, behavioral context, tool states, environment)
→ Process performs graceful restart with new binary
→ State is restored in-place
→ User continues with ZERO quality loss
This follows established patterns like:
- PM2 graceful restart using SIGINT with wait_ready
- nginx reload using SIGHUP
- systemd service reloads
Option B: Automatic Detection with Prompt
- Detect newer version on disk
- Prompt: "Version 2.0.70 available. Upgrade now? Session will be preserved."
- If accepted, perform graceful restart with state preservation
Technical Considerations
- Serialize not just conversation text but behavioral state where possible
- Handle in-flight tool operations gracefully
- Rollback mechanism if new binary fails to start
- Cross-version state compatibility (handle schema changes)
Expected Behavior
| Current Workflow | Proposed Workflow |
|------------------|-------------------|
| Upgrade requires exit + manual resume | Upgrade happens seamlessly in-place |
| Resume causes quality degradation | Full session quality preserved |
| AI forgets corrections and files | AI retains all learned context |
| User must track session IDs | No manual intervention needed |
Impact
- Eliminates the trade-off between "stay current" and "preserve session quality"
- Reduces friction for staying on latest version
- Improves experience for power users
- Makes auto-update truly seamless
Related Issues
- #12990 - Persistent session context across restarts
- #12774 - Session Continuity Improvements
- #6497 - Hot reload of agents and slash commands
- #1340 - Session resumption (closed, but quality issues remain)
References
- DoltHub: Claude Code Gotchas — Documents post-compaction quality loss
- PM2: Graceful Restart — Proven pattern for state-preserving restarts
- nginx: Graceful Reload — Signal-based reload pattern
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗