claude-code - 💡(How to fix) Fix [BUG] /background mid-turn silently drops the in-flight turn in the forked bg session

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

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?

When I call /background (or /bg) on a brand-new session while the first turn is still in flight, two things happen:

  1. The foreground claude process exits immediately.
  2. The backgrounded session, when reattached via Agent View, shows the first user message but no processing is happening — the turn that was in flight is silently dropped. To make progress I have to re-send the message manually in the bg session.

The bg session is created successfully (it shows up in Agent View) — this is not "bg failed" — but the in-flight work it inherited is frozen.

What Should Happen?

Either:

  • The in-flight turn that the foreground was processing should resume automatically in the bg session, or
  • /background should not be accepted while a turn is in flight (block with a hint to wait for the current turn to finish).

Right now there's no warning and the user only notices that the bg session is stuck after attaching to it.

Error Messages/Logs

No errors. The foreground exits cleanly with the usual "Session backgrounded" message.

Steps to Reproduce

  1. Launch claude fresh (no -r, no -w).
  2. Send your first message — Claude starts processing the turn.
  3. While the turn is still streaming, run /background (no argument).
  4. claude exits immediately. ✓ (expected — this is the documented "free the terminal" behavior)
  5. Start claude again and open Agent View (claude agents), or reattach to the bg session from another claude process.
  6. Open the backgrounded session: your first user message is there, but nothing is happening — no spinner, no streaming, no tool calls. The session is idle at the first message.
  7. To get any output you must send a new message in the bg session.

Claude Model

Not relevant (reproduces regardless of model)

Is this a regression?

I don't know — I started noticing it on 2.1.150 but I haven't tested earlier versions for this specific case.

Last Working Version

Unknown

Claude Code Version

2.1.150

Platform

Anthropic API

Operating System

macOS (Darwin 25.5.0)

Terminal/Shell

zsh (macOS Terminal / iTerm2)

Additional Information

The user data isn't lost (the user message stays in the transcript) but the work — the assistant turn that was running — is silently dropped instead of being resumed in the bg session. The only way to recover is to re-type or re-send the message after attaching to the bg session.

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] /background mid-turn silently drops the in-flight turn in the forked bg session