The two ways you pay
Claude Code cost model
| Path | How it's billed | When it bites |
|---|---|---|
| Claude Pro/Max subscription | Flat monthly fee, capped usage | You hit rate limits mid-task on heavy days |
| Anthropic API credits | Per-token, pay as you go | Long sessions + large context = fast burn |
Why the bill spikes
Agent coding sends a lot of tokens: it re-reads files, includes context, and iterates. On a large repo or a long debugging session, that context adds up every turn. So the same tool that feels cheap on a toy project can get pricey on a real codebase — not because it's overpriced, but because you're doing more model work than a single chat.
Concrete ways to spend less
Cut the bill
- Use a cheaper model for routine workGLM and DeepSeek cost a fraction per token and handle everyday edits/refactors well. Save the premium model for the hard stuff.
- Scope the contextPoint the agent at the files that matter instead of the whole repo, so each turn ships fewer tokens.
- Run a local model for $0/tokenServe a model locally (Ollama/vLLM) and there's no per-token bill at all — you trade that for needing the hardware.
- Switch when a provider is cappedDon't pay overage or sit rate-limited; route to a second model and keep going.
The cheapest setup overall
The lowest-cost sustainable setup is a free, open-source agent plus your own model — a cheap hosted model for most work, or a local model for zero per-token cost. The agent itself costs nothing, and you only pay for exactly the model usage you choose.
FAQ
How much does Claude Code cost per month?
It depends on the path: a Claude Pro/Max subscription is a flat monthly fee with capped usage, while API credits are per-token and scale with how much you code. Heavy users on big repos feel the token cost the most.
How do I make Claude Code cheaper?
Use a lower-cost model (GLM/DeepSeek) for routine work, scope the context to relevant files, or run a local model for $0 per token. All of these need an agent that lets you pick the model.
What's the cheapest way to get agent coding?
A free, open-source agent plus your own model. Wuwei is free and MIT-licensed; you bring your own key and can use a cheap model or a local one, so the only cost is the model usage you choose.