[FEATURE] `-c`/`--continue` silently skips newer background (`--bg`) sessions; no shared checkpoint between agent view and CLI session history
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Steps to reproduce:
- Start a session in a project directory, send it to background mode (
--bg//background) so it gets a"template": "bg"entry in~/.claude/jobs/<id>/state.json. - Let it keep running (its
.jsonltranscript in~/.claude/projects/<project>/keeps getting the newest mtime in that directory). - Open a new terminal,
cdinto the exact same directory, runclaude -c.
Expected: -c resumes the most recent session in the directory (per docs), or at minimum warns that a more recent session was skipped.
Actual: -c silently resumes an older, unrelated interactive session — no error, no warning, no mention that a newer session exists and was skipped because it's a "bg"-template job. The only way to discover this is to already know about claude agents and manually check ~/.claude/jobs/. This makes it very easy to think you're "continuing" your work while actually you've dropped into a stale, unrelated session — I only found the real cause by manually inspecting job state files and process trees.
Root cause (confirmed via docs + on-disk inspection): agent view (claude agents, --bg, /background, the on-demand daemon) and plain CLI session history (-c/--continue) are two permanently separate tracks. Even taking over a background session from agent view doesn't convert it — it stays tagged "bg" forever, so it can never surface through -c. There's no cross-referencing or shared "most recent" pointer between the two systems at all.
Proposed Solution
Suggested features:
- Share a single session checkpoint/index between agent view and plain CLI sessions, so a background session can also be resumed directly via
claude -c/--continue, not only throughclaude agents. - At minimum, whenever a background session detaches back to agent view (or on some regular cadence while running), have it write a checkpoint update into the same session-list index that
-creads from — so CLI and agent view are backed by one shared, consistent session list instead of two parallel systems that are invisible to each other.
Alternative Solutions
_No response_
Priority
High - Significant impact on productivity
Feature Category
CLI commands and flags
Use Case Example
_No response_
Additional Context
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗