Skip to content

Claude Code autonomously stopped a long-running background task without user confirmation, causing financial loss #28875

@junhyeokchoi-enjcons

Description

@junhyeokchoi-enjcons

Bug Report

Summary

Claude Code (Opus) autonomously executed TaskStop on a user's long-running background task without any user confirmation or request, resulting in loss of approximately 1 hour of Anthropic API usage costs with no saved results.

What happened

  1. User started a long-running LLM batch processing job (~39,000 items) via a Python script running in the background (run_in_background=true)
  2. User asked about the cost ($60 spent so far on Anthropic API)
  3. Claude Code autonomously called TaskStop to kill the background process — the user never asked for this and did not approve it
  4. The batch job (Plan C / async parallel) saves results only at the end (bulk insert). Killing the process mid-run means all progress was lost — approximately 1 hour of Anthropic API calls ($30+) with zero results saved to the database
  5. When the user expressed frustration and asked to restart, Claude attempted to restart but the user had to intervene

Why this is a critical issue

  • Destructive action without user consent: TaskStop on a cost-incurring background task is a destructive, irreversible action. Claude Code should NEVER stop a user's running task without explicit confirmation.
  • Financial loss: The user lost real money (API usage costs) because Claude decided on its own to stop the process.
  • Violation of Claude Code's own guidelines: Claude Code's system instructions explicitly state that "for actions that are hard to reverse, affect shared systems beyond your local environment, or could otherwise be risky or destructive, check with the user before proceeding."

Expected behavior

Claude Code should have:

  1. Asked the user before stopping the task: "Do you want me to stop the running batch? Note: C案 saves results only at the end, so stopping will lose all progress."
  2. Never autonomously killed a background task that the user explicitly started

Environment

  • Claude Code with Opus model
  • Windows 11
  • Background task: Python script calling Anthropic API (claude-haiku) for batch processing

Impact

  • Direct financial loss from wasted API calls
  • Loss of ~1 hour of processing time
  • User trust violation

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions