A retry-stuck headless agent burned $313 in one night and nobody could see it happening.

claude -p headless mode gives orchestrators no cost visibility, spend caps, or duplicate-input detection, so a single stuck retry loop can consume half a weekly quota before anyone notices.

Category: AI / Agents · Trend: Agents · Opportunity score: 8.0 / 10

What is the “A retry-stuck headless agent burned $313 in one night and nobody could see it happening.” problem in 2026?

claude -p headless mode gives orchestrators no cost visibility, spend caps, or duplicate-input detection, so a single stuck retry loop can consume half a weekly quota before anyone notices.

Who has this problem?

Developers running Claude Code subagents in headless/orchestrated pipelines.

Recorded source context

Dataset source note: The core issue: claude -p provided no cost visibility, spending caps, duplicate-input detection, or per-invocation logging that would have allowed an external orchestrator to detect and halt the runaway before significant costs accumulated.

This note may summarize the referenced material rather than quote it verbatim. Source label: anthropics/claude-code GitHub issue #57719, 10 May 2026. (reference).

Existing players in this space

  • claude -p headless flags: No --max-cost, --budget, or circuit-breaker flag exists.
  • External wrapper scripts: Users build their own daemons with no first-party cost hooks to key off.
  • Post-hoc billing dashboard: Confirms the damage after the fact, does not stop it mid-run.

What existing players are missing

A per-invocation cost and duplicate-input guard for headless/orchestrated Claude Code runs that halts a loop the moment it detects zero net progress against rising spend.

How Real Problem AI scores this opportunity

Aggregate score: 8.0 / 10. Four-axis rubric:

  • Problem severity: 9 / 10
  • AI feasibility today: 8 / 10
  • Market signal: 7 / 10
  • Competition gap: 8 / 10

How to build a solution: stack hints

  • Headless CLI wrapper/proxy
  • Per-invocation cost logging
  • Progress/duplicate-detection heuristic
  • Kill-switch webhook

Related AI / Agents problems on Real Problem AI