Assistant made a config change that multiplied recurring API spend ~20× with no cost warning or guard
Body:
What happened
Working on a long-running production project (Farcaster content agent on
Hermes Agent), Claude Code proposed and applied a change that removed the
condition under which an agent loop skipped its turn.
Before: the loop ran ~3.5 agent turns/day (it skipped almost every run).
After: the loop ran a full agent turn every 20 minutes — ~72/day.
Each turn sent ~95,700 input tokens. The user's xAI credit balance (~$5)
was exhausted overnight.
Why it compounded
A separate pre-existing bug made every turn rns
create no record, so the existing daily cap (which counted only SUCCESSFUL
actions) never incremented. Success was cappoop
could not terminate.
The assistant behaviour worth flagging
- No cost-impact estimate was produced before applying a change to a
recurring, LLM-invoking loop. The relevany")
was one command away and was only computed after the money was gone.
- Follow-up: when restoring service the assistant selected
claude-sonnet-5 as the gateway model withy
because it was already used elsewhere in the project (for 1 call/day).
Measured on identical input via the same
claude-sonnet-5 $2.25 / 1M input → ~$60.75/mo at 12 turns/day
deepseek-v4-flash $0.13 / 1M input → ~
A 17× difference. Corrected only after the user objected.
- The agent under management repeatedly reported a fabricated cause
("database is locked") for a validation ehort,
28 chars, need 30"), six times in a row, to the user's phone overnight.
Reproduced on a DB copy: the database waswn
failure mode: the model does not reconcile its final message with the
actual tool result.
Suggested product-side improvements
- When an assistant edits code/config governng
loop, surface a before/after invocation-rate estimate.
- Encourage caps on ATTEMPTS, not only on su
- Surface raw tool-error text to the user rather than the model's
paraphrase of it, when a tool call fails.
Impact
Financial: user's xAI balance exhausted (~$5
Downtime: project without a model until reconfigured onto another provider.
Time: user spent a night on false alarms plu
Fixes applied in-project (by the assistan
Per-target failure cutoff (3 fails/day), hary
recorded BEFORE the turn, one-per-day alert when the cap trips, raw tool
rejections written to a log file and shown t
model's paraphrase, prompt updated with the validation requirement,
gateway moved to a 17× cheaper model, 10 unu
(they were 53% of every request body).
Full incident report (Russian):
~/joker/reports/2026-08-08_incident_report_c