Claude Code run costs $6,000 overnight
- MakeUseOf reported on May 22 that a Claude Code user left an automated loop running overnight and was billed about $6,000. - The reported failure point was an 800,000-token context being rebuilt after a 30-minute loop outlasted Anthropic’s default five-minute prompt cache. - Anthropic’s official pricing and Claude Code docs remain live, with task-budget controls documented in the Claude API materials.
MakeUseOf reported on May 22 that a Claude Code user was billed about $6,000 after leaving an automated coding loop running overnight. The account, which cited a Reddit post, described a setup that checked for software updates every 30 minutes and kept running while the user slept. Anthropic’s own documentation shows why that kind of workflow can become expensive: Claude Code is designed to read codebases, run commands and continue multi-step tasks, while Anthropic bills model usage by tokens and charges different rates for fresh prompt-cache writes and cache hits. ### How did an overnight run get that expensive? MakeUseOf said the user’s loop was not expensive because of one large command, but because it kept rebuilding context over and over. The publication said the session had grown to roughly 800,000 tokens and that the loop re-ran every 30 minutes without a stopping condition. (makeuseof.com) Anthropic’s pricing page shows why repeated rebuilds matter. For Claude Opus 4.7, base input tokens are priced at $5 per million, 5-minute cache writes at $6.25 per million, 1-hour cache writes at $10 per million, cache hits and refreshes at $0.50 per million, and output tokens at $25 per million. Anthropic also notes that Opus 4.7 uses a new tokenizer that may consume up to 35% more tokens for the same fixed text. (makeuseof.com) ### What does prompt caching have to do with the bill? Anthropic’s prompt-caching documentation says the default cache lifetime is five minutes, and cached content is refreshed at no additional cost when reused within that window. Anthropic also offers a one-hour cache duration at an added charge. MakeUseOf said the 30-minute wait between checks meant the loop outlasted the default five-minute cache. (platform.claude.com) According to the report, that forced the system to rebuild the large conversation history from scratch on each cycle rather than reusing a cheaper cached version. ### What exactly is Claude Code built to do? Anthropic describes Claude Code as an “agentic coding tool” that reads a codebase, edits files, runs commands and integrates with development tools. (platform.claude.com) The company says users can invoke it from the terminal, IDE, desktop app and browser, and use it to automate tasks such as dependency updates, writing tests and fixing lint errors. (makeuseof.com) Anthropic’s consumer pricing page says Claude Code is included in Pro and Max subscriptions, while usage limits still apply. On May 6, Anthropic said it had doubled Claude Code’s five-hour rate limits for Pro, Max, Team and seat-based Enterprise plans and removed peak-hours limit reductions for Pro and Max accounts. ### What controls does Anthropic document for long-running agent tasks? (code.claude.com) Anthropic’s API documentation says users can set “task budgets” to give Claude an advisory token budget for a full agentic loop so the model can self-regulate on long tasks. Anthropic also points developers to usage and cost pages in the Claude Console and documents a Usage and Cost API for monitoring. (claude.com) Anthropic has also flagged another billing change ahead. MakeUseOf said Anthropic announced in May that, starting June 15, the Agent SDK, the `claude -p` command, Claude Code GitHub Actions and third-party agent tools would move to a separately billed credit pool at API rates outside subscription limits. June 15 is the next concrete date in the story. (platform.claude.com) Anthropic’s pricing docs and Claude Code documentation remain the primary references for users checking model rates, cache behavior and controls for long-running agent workflows. (makeuseof.com)