The True Cost of AI Coding in 2025
Spoiler: the tokens are cheaper than you think. The bottleneck is task design, not the API bill.
The Numbers
Let's be concrete. Claude Sonnet 4 at current pricing costs roughly $3/million input tokens and $15/million output tokens. A typical coding session — reading files, generating code, running tests, fixing errors — might use 50k-200k tokens per task. That's $0.15-$3 per task depending on complexity and model.
Running 10 agents simultaneously for 8 hours (an overnight run) on Sonnet 4 typically costs $20-80 depending on task complexity. If those agents complete 10-30 meaningful coding tasks, you've paid $1-5 per completed task. A developer's hourly rate divided by tasks-per-hour almost always exceeds this.
Model Choice Is the Biggest Lever
| Model | Relative cost | Best for |
|---|---|---|
| Claude Opus 4 | High | Architecture decisions, complex refactors, ambiguous tasks |
| Claude Sonnet 4 | Medium | Feature implementation, API development, most coding tasks |
| Claude Haiku 4 | Low | Documentation, boilerplate, search and triage, simple fixes |
The biggest cost optimization is using the right model for each task. Don't use Opus for writing getters and setters. Don't use Haiku for complex architectural refactors. amux lets you configure the model per session, so you can match model capability to task complexity.
What Actually Wastes Tokens
- Vague task descriptions: An agent that goes in the wrong direction and needs to backtrack uses 3-5x more tokens than one that executes correctly the first time. Write clear, specific task descriptions.
- Agents reading the whole codebase: If an agent reads 500k tokens of source code for a 10-line fix, your cost explodes. Keep task scope tight and specify relevant files explicitly.
- Long error loops: An agent stuck in a loop trying to fix a compilation error can burn thousands of tokens on unproductive iterations. amux's watchdog detects stuck agents and interrupts them.
- No context boundaries: Running agents on huge context windows when smaller ones would suffice. Use session checkpointing and compact summaries to keep context efficient.
The Real ROI Calculation
The correct comparison isn't "agent tokens vs. zero." It's "agent tokens vs. developer hours." At $100-200/hr fully loaded developer cost, even a $50/day agent fleet is economical if it produces meaningful output. The question is task quality — designing tasks that agents can execute successfully is the skill that determines ROI.
Get started with amux
Run dozens of Claude Code agents in parallel. Python 3 + tmux. Open source.
git clone https://github.com/mixpeek/amux && cd amux && ./install.sh
amux register myproject --dir ~/Dev/myproject --yolo
amux start myproject
amux serve # → https://localhost:8822View on GitHub