claude-code - 💡(How to fix) Fix [BUG] Sessions auto-archived and killed mid-task on v2.1.138 (macOS); session orchestration spawning duplicate sessions without user input

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

  • Result: gcloud subprocess (pid 48311) was killed with the parent. The deploy log at /tmp/redeploy.log ends mid-output with no exit code, no success line, no error line. Cloud Run state had to be verified manually via console.

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

On Claude Code 2.1.138 (bundled inside Claude Desktop 1.7196.0 on macOS), active Cowork/Code sessions are being auto-archived and killed without user input — including sessions actively running long-running subprocesses. When a session is killed, its subprocesses are terminated with it. Additionally, the session orchestration layer is spawning multiple new sessions without user input, in a short window.

This appears related to the May 6 fix in 2.1.129 ("Remote Control sessions getting archived on transient CCR initialization blips during JWT refresh") but is occurring on the post-fix version, so the fix is either incomplete or this is a related regression.

Concrete Incident (today, ~11:24–11:29 AM PT, May 16, 2026)

Real-world impact: a gcloud run deploy pdf-remediator-api deploy to Google Cloud Run was killed mid-build when its parent Claude Code session was auto-archived.

Timeline:

  • 11:13 AM — Claude Code session 084aab6c-8c0e-47e8-a356-cbf3857549cc started in /Users/<user>/pdf-remediator, pid 44598
  • 11:24 AM — Claude initiated gcloud --project=<proj> run deploy pdf-remediator-api --source=./backend --region=us-central1 --quiet as a subprocess (zsh, pid 48311). Deploy progressed normally: "Validating configuration...done", "Uploading sources...done", "Building Container...done".
  • ~11:27 AM — Without any user input, the parent Claude Code session (pid 44598) was killed. The session's metadata file at ~/.claude/sessions/44598.json was removed.
  • Result: gcloud subprocess (pid 48311) was killed with the parent. The deploy log at /tmp/redeploy.log ends mid-output with no exit code, no success line, no error line. Cloud Run state had to be verified manually via console.
  • 11:28–11:29 AM — Within the next 60 seconds, ~5 new Claude Code processes were spawned without user input, all v2.1.138, all using --allow-dangerously-skip-permissions and the mcp__ccd_session__mark_chapter / mcp__ccd_session_mgmt__list_sessions MCP tools:
    • pid 49215 (resume e5b79748-...)
    • pid 49529 (resume d71b22c4-..., add-dir pdf-remediator/backend/app — a NEW session for the same project, replacing the killed one with no context carryover)
    • pid 50348 (resume 0e3d45f8-..., add-dir aeo-visibility-lab/pages)
    • pid 50681 (resume 8408adcb-..., add-dir Content_ROI_Analyst/dashboard/server)
    • pid 50979 (resume 292dfa7f-...)
    • pid 52583 (resume 2bfed0f2-..., add-dir gtfo/GTFO App)
  • A session metadata file (51873.json) exists with no matching live process — orphan.

Actual Behavior

  • Active session killed mid-deploy without user input
  • gcloud subprocess terminated, deploy left in unknown state
  • 5+ new sessions auto-spawned without user input within ~60 seconds
  • At least one orphaned session metadata file (PID does not match a running process)
  • Session metadata file for killed session was deleted, not moved to an archive state

What Should Happen?

  • Active sessions should not be archived/killed without explicit user action
  • When a session is archived (by user choice), running subprocesses should not be silently killed; user should be warned or subprocesses should be allowed to detach
  • The session orchestration layer should not spawn duplicate or new sessions without explicit user input
  • Killed sessions' conversation context should be preserved and recoverable

Error Messages/Logs

Steps to Reproduce

Not deterministic on my end — incident occurred during normal multi-session usage. Pattern that preceded it:

  1. Multiple concurrent Cowork sessions open across different project directories
  2. One session running a long-lived subprocess (gcloud deploy, ~5+ minute build)
  3. Sessions all share ccd_session_mgmt MCP tools and --allow-dangerously-skip-permissions

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

  • Claude Code (bundled, spawned by Desktop): 2.1.138 - Stray standalone CLI install (separate, not used in this incident): 2.1.118

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Related Issues

  • #22931 — archived Cowork chats disappearing
  • #28511 — Code session lost on tab switch
  • #29793 — conversation rollback on settings/menu switch
  • #33130 — conversations disappearing mid-session
  • #45076 — Cowork session history silently lost between sessions (macOS)
  • May 6, 2026 changelog (v2.1.129) — "Fixed Remote Control sessions getting archived on transient CCR initialization blips during JWT refresh" — fix appears incomplete or has regressed

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Sessions auto-archived and killed mid-task on v2.1.138 (macOS); session orchestration spawning duplicate sessions without user input