[FEATURE] Context exhaustion should not create separate sessions, preserve session identity across compaction continuations
Resolved 💬 2 comments Opened Mar 12, 2026 by samoht9277 Closed Mar 13, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single feature request (not multiple features)
Problem Statement
When working on a long task (building a feature, debugging, etc.), context exhaustion causes Claude Code to create a brand new session with a summary/plan of the previous one as its first message. This means a single logical conversation gets split into multiple separate sessions.
What happens:
- Start a session,
/renameit to something meaningful like "auth-refactor" - Work for a while, context fills up
- Context gets exhausted, Claude Code creates a new session starting with "# Plan: Continue implementing auth refactor on branch X..."
- If context exhausts again, yet another session is created
/resumenow shows 2-3+ separate sessions for what was one continuous piece of work
The problems this creates:
- Session sprawl: A single feature can generate multiple sessions, cluttering
/resume - Custom names don't carry over:
/renameonly applies to the original session. Continuations get auto-generated names (relates to #25090, #26121) - No parent-child linking: There's no way to know which sessions are continuations of which. They appear as completely unrelated conversations
- Confusing
/resumeexperience: When resuming work the next day, you have to guess which of the 2-3 sessions with similar descriptions is the "latest" continuation - Related to #26832 which reports the same issue specifically for Plan mode transitions, but this affects any long-running session
Proposed Solution
A session should maintain its identity across context exhaustion. Specifically:
- Compact in-place whenever possible: Instead of creating a new session, summarize and continue in the same session file with the same session ID. This already works for normal compaction but not for full context exhaustion.
- If a new session file must be created, chain them: Add a
parentSessionIdfield so continuations are linked./resumeshould show them as one logical session (e.g., show only the latest continuation, or group them together).
- Propagate metadata to continuations: If the parent session has a
custom-title, the continuation should inherit it automatically. Same for tags and other metadata.
- Single entry in
/resume: Regardless of how many times context was exhausted, the user should see one session entry that resumes from the latest continuation point.
Current Workaround
Manually /rename each continuation session after it's created, and remember which one is the latest. Not great.
Version
2.1.74
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗