[BUG] Claude Code ran batch API script as background task, signaled completion while processes still running - several hundred USD in charges
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude Code autonomously invoked the Bash tool with run_in_background: true, creating background processes it then failed to track. The task-complete signal was sent without verifying those processes had exited. At 2026-06-15T01:56:40Z (June 14, 6:56 PM PDT), Claude Code sent an explicit task-complete signal:
▎ "Done. JSON is in Downloads on the Samsung, app installed on both devices. Re-import the JSON from Collections to pick up the pinyin split and notes."
The user stepped away. Unknown to them, three concurrent background instances of the script continued running silently for approximately six hours, making hundreds of API calls. The processes were not discovered until 2026-06-15T08:07:04Z (June 15, 1:07 AM PDT) - over six hours after Claude Code indicated the work was done.
Two distinct problems:
- Claude Code did not track or report the state of background tasks it spawned. It told the user the task was complete while those processes were still running.
- There is no human support escalation path for billing disputes caused by this behavior. Support case #215474713101599 was handled entirely by the Fin AI bot, which explicitly stated: "I'm an AI support assistant, and I don't have the ability to route conversations or connect you with human agents through this channel."
What Should Happen?
- Claude Code should track background tasks it spawns and not signal task completion until those processes have exited or been explicitly handed off.
- If background tasks making external API calls are started, Claude Code should surface a warning that they are still running before ending the session.
- Anthropic should have a human escalation path for billing disputes caused by Claude Code's own behavior - particularly when the charges are anomalous against the user's usage baseline and were flagged by external fraud systems.
Error Messages/Logs
Process log captured at discovery (2026-06-15T08:07:04Z):
PIDs: 13489, 13646, 13834
All targeting: en-multilang-top1000-retagged.json
Started: ~01:06 AM PDT
Model: claude-sonnet-4-6
Concurrency: batches of 10 at concurrency 4 (up to 12 simultaneous calls across 3 instances)
Sample request IDs from 400 responses returned after credit exhaustion (not the full set - complete call log is in Anthropic's systems):
req_011Cc49a7AuJQZFDSNwgQRQb
req_011Cc49a87hqaNFqySSJXwy1
req_011Cc49a8cU8ZbKkntwGYWV5
req_011Cc49a94kpQVD1ihoqC9fr
req_011Cc49a9akz68MSGnXtFgWg
req_011Cc49aA8zakfbxVghUkeqA
req_011Cc49aAaHb59t3d81tKUnj
req_011Cc49aBKgXwZcnoEHbMqwM
req_011Cc49aBnDN7xf1ttvmdbWd
req_011Cc49aCFFFoxvnjqVx4PtJ
req_011Cc49aCnVEvLtr7D65J8FM
req_011Cc49aDDYH4VYEALh4EXqe
req_011Cc49aE2QR2J8yS593zEDb
req_011Cc49aEVgQCL1Zcpj3SMAB
req_011Cc49aFXh7T3EVeq1ndmK7
req_011Cc49aG2hyYm4VTdRmevZN
req_011Cc49aGoLkx99ZppvYzYuJ
req_011Cc49aHMKqHm94ZTt1xyy9
Support case: #215474713101599 - closed by AI bot without human review.
Steps to Reproduce
Steps to Reproduce
- Ask Claude Code to run a script that makes external API calls
- Claude Code autonomously chooses to run the script with run_in_background: true - this is Claude Code's own tool call decision, not a user-specified flag
- Claude Code signals task complete without confirming the background process exited
- Exit the session or step away
- The background process continues running indefinitely with no visible indication
The core issue is reproducible any time Claude Code uses run_in_background on a long-running script and reports completion before confirming the process has exited.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.177
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Warp
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗