[FEATURE] `-c`/`--continue` silently skips newer background (`--bg`) sessions; no shared checkpoint between agent view and CLI session history

Status Open
Maintainer reply None cached
Activity 1 comment · opened Jul 16, 2026

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:

  1. 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.
  2. Let it keep running (its .jsonl transcript in ~/.claude/projects/<project>/ keeps getting the newest mtime in that directory).
  3. Open a new terminal, cd into the exact same directory, run claude -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 through claude 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 -c reads 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_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗