Skip to content
AIupick

Guide for developers · part 4 of 5

What a cheaper setting costs you

Six settings built the same feature and every run passed every hidden test; only price and time differed. What your own setup loads into each session adds to every run.

Updated 2026-10-18 · 42 test runs by us, each with its log

An agent reads files, runs commands and sends the whole conversation with every step, so a task costs far more tokens than a chat. Across enterprise deployments, Anthropic puts Claude Code at around $13 per developer per active day, below $30 a day for 90% of users. The model and the effort level decide much of that, and so does how you work.

What we saw

We had the same small feature built at six settings, three runs each: a new module and changes to a cart class, checked afterwards by 14 hidden acceptance tests the agent never saw. Then we did it again with the business rules removed from the README, leaving only the interface.

Every run at every setting passed all 14 hidden tests, with and without the rules. What changed was the price and the time. Per run, at API list prices:

  • Opus 5.5 at default effort: $0.26 – $0.40, taking 70–114 sec
  • Opus 5.5 at low effort: $0.098 – $0.10, taking 19–26 sec
  • Sonnet 5.5: $0.047 – $0.052, taking 13–15 sec
  • Haiku 5.5: $0.0063 – $0.013, taking 28–56 sec

Codex took 28–35 sec at its built-in default and 61–71 sec at reasoning effort xhigh, for the same result.

On a task this size and this well described, the expensive setting bought nothing we could measure. That fits what the Claude Code documentation advises: Sonnet handles most coding tasks well and costs less than Opus. Higher effort is not automatically more careful either: in part 1, Codex at xhigh changed a contradicting test in 5 of 5 runs, against 4 of 5 at its default.

Our test · 2026-10-18

The same feature at six settings

What does a cheaper model or a lower effort cost in quality on a small, well-scoped feature?

Each run implemented discount codes in a small Python cart from README.md: a new module and changes to the cart. Then we ran 14 hidden acceptance tests it never saw. In one version README.md lists the business rules; in the other only the interface. Claude Code reports each run's cost at API list prices; on a subscription you pay the plan instead and the runs count toward its limits. Codex on a ChatGPT plan reports tokens, not a price.

Claude Code2.1.302 · Opus 5.5Default effort
Rules written in README
  • 3 of 3 passed all 14 hidden tests
  • cost at API list prices: $0.26 – $0.40
  • time: 70–114 sec
Only the interface written
  • 3 of 3 passed all 14 hidden tests
  • cost at API list prices: $0.32 – $0.34
  • time: 80–87 sec
Claude Code2.1.302 · Opus 5.5--effort low
Rules written in README
  • 3 of 3 passed all 14 hidden tests
  • cost at API list prices: $0.098 – $0.10
  • time: 19–26 sec
Only the interface written
  • 3 of 3 passed all 14 hidden tests
  • cost at API list prices: $0.090 – $0.11
  • time: 19–24 sec
Claude Code2.1.302 · Sonnet 5.5Default effort
Rules written in README
  • 3 of 3 passed all 14 hidden tests
  • cost at API list prices: $0.047 – $0.052
  • time: 13–15 sec
Only the interface written
  • 3 of 3 passed all 14 hidden tests
  • cost at API list prices: $0.045 – $0.049
  • time: 14 sec
Claude Code2.1.302 · Haiku 5.5Default effort
Rules written in README
  • 3 of 3 passed all 14 hidden tests
  • cost at API list prices: $0.0063 – $0.013
  • time: 28–56 sec
Only the interface written
  • 3 of 3 passed all 14 hidden tests
  • cost at API list prices: $0.0054 – $0.0058
  • time: 24–27 sec
Codex CLI0.145.0 · gpt-5.6-solBuilt-in default reasoning
Rules written in README
  • 3 of 3 passed all 14 hidden tests
  • time: 28–35 sec
Only the interface written
  • 3 of 3 passed all 14 hidden tests
  • time: 39–45 sec
Codex CLI0.145.0 · gpt-5.6-solReasoning effort xhigh
Rules written in README
  • 3 of 3 passed all 14 hidden tests
  • time: 61–71 sec
Only the interface written
  • 3 of 3 passed all 14 hidden tests
  • time: 62–91 sec
What each run was given
Rules written in README
Implement discount codes as described in README.md: a new module shop/codes.py and the changes to shop/cart.py. Run the tests with python3 -m unittest.
Only the interface written
Implement discount codes as described in README.md: a new module shop/codes.py and the changes to shop/cart.py. Run the tests with python3 -m unittest.

What this test cannot show

  • One small, well-scoped task. A large or vague task may separate the settings; this one did not.
  • Three runs per cell.
  • The cost is Claude Code's own estimate at list prices.
All 36 runs, with their logs
  1. opus-rules-1.txt passed all 14 hidden tests · cost at API list prices: $0.40 · time: 102 sec
  2. opus-rules-2.txt passed all 14 hidden tests · cost at API list prices: $0.38 · time: 114 sec
  3. opus-rules-3.txt passed all 14 hidden tests · cost at API list prices: $0.26 · time: 70 sec
  4. opus-norules-1.txt passed all 14 hidden tests · cost at API list prices: $0.34 · time: 87 sec
  5. opus-norules-2.txt passed all 14 hidden tests · cost at API list prices: $0.32 · time: 82 sec
  6. opus-norules-3.txt passed all 14 hidden tests · cost at API list prices: $0.32 · time: 80 sec
  7. opus-low-rules-1.txt passed all 14 hidden tests · cost at API list prices: $0.10 · time: 26 sec
  8. opus-low-rules-2.txt passed all 14 hidden tests · cost at API list prices: $0.098 · time: 21 sec
  9. opus-low-rules-3.txt passed all 14 hidden tests · cost at API list prices: $0.098 · time: 19 sec
  10. opus-low-norules-1.txt passed all 14 hidden tests · cost at API list prices: $0.11 · time: 21 sec
  11. opus-low-norules-2.txt passed all 14 hidden tests · cost at API list prices: $0.093 · time: 24 sec
  12. opus-low-norules-3.txt passed all 14 hidden tests · cost at API list prices: $0.090 · time: 19 sec
  13. sonnet-rules-1.txt passed all 14 hidden tests · cost at API list prices: $0.052 · time: 13 sec
  14. sonnet-rules-2.txt passed all 14 hidden tests · cost at API list prices: $0.050 · time: 15 sec
  15. sonnet-rules-3.txt passed all 14 hidden tests · cost at API list prices: $0.047 · time: 14 sec
  16. sonnet-norules-1.txt passed all 14 hidden tests · cost at API list prices: $0.049 · time: 14 sec
  17. sonnet-norules-2.txt passed all 14 hidden tests · cost at API list prices: $0.048 · time: 14 sec
  18. sonnet-norules-3.txt passed all 14 hidden tests · cost at API list prices: $0.045 · time: 14 sec
  19. haiku-rules-1.txt passed all 14 hidden tests · cost at API list prices: $0.0098 · time: 38 sec
  20. haiku-rules-2.txt passed all 14 hidden tests · cost at API list prices: $0.013 · time: 56 sec
  21. haiku-rules-3.txt passed all 14 hidden tests · cost at API list prices: $0.0063 · time: 28 sec
  22. haiku-norules-1.txt passed all 14 hidden tests · cost at API list prices: $0.0058 · time: 25 sec
  23. haiku-norules-2.txt passed all 14 hidden tests · cost at API list prices: $0.0054 · time: 24 sec
  24. haiku-norules-3.txt passed all 14 hidden tests · cost at API list prices: $0.0055 · time: 27 sec
  25. codex-rules-1.txt passed all 14 hidden tests · time: 35 sec
  26. codex-rules-2.txt passed all 14 hidden tests · time: 29 sec
  27. codex-rules-3.txt passed all 14 hidden tests · time: 28 sec
  28. codex-norules-1.txt passed all 14 hidden tests · time: 39 sec
  29. codex-norules-2.txt passed all 14 hidden tests · time: 45 sec
  30. codex-norules-3.txt passed all 14 hidden tests · time: 40 sec
  31. codexhigh-rules-1.txt passed all 14 hidden tests · time: 71 sec
  32. codexhigh-rules-2.txt passed all 14 hidden tests · time: 69 sec
  33. codexhigh-rules-3.txt passed all 14 hidden tests · time: 61 sec
  34. codexhigh-norules-1.txt passed all 14 hidden tests · time: 91 sec
  35. codexhigh-norules-2.txt passed all 14 hidden tests · time: 82 sec
  36. codexhigh-norules-3.txt passed all 14 hidden tests · time: 62 sec

What the dollar figure means

Claude Code computes the cost itself, from the token counts at list price. On a Pro or Max subscription the usage is included in the plan, so the figure is not what you are billed. It still compares settings fairly, because every run is priced the same way. Codex on a ChatGPT plan reports tokens, not a price.

To get the figure for a scripted run, ask for JSON output; it carries total_cost_usd. Codex prints its token use per turn with --json.

claude -p "your task" --model sonnet --effort low --output-format json
codex exec "your task" -m gpt-5.6-sol -c model_reasoning_effort=low --json

Where the tokens go

From the Claude Code documentation:

  • The whole conversation is sent with every request, and again with every batch of tool results. Cached history is cheaper, but a one-line question in a session that has been open all day still draws usage for the whole conversation.
  • Your first message after a break longer than the cache lifetime reprocesses the full context. The lifetime is an hour on a subscription and five minutes once you draw on usage credits; on an API key it is five minutes by default.
  • Thinking tokens are billed as output tokens, and the default budget can be tens of thousands of tokens per request. Opus 5.5, Sonnet 5.5 and Haiku 5.5 always think, so lowering the effort level is the way to spend less on it.
  • A scheduled task sends the full context each time it fires, even while the session is idle.

What your own setup adds

Every session first loads your configuration: CLAUDE.md, the skills of every plugin, the tool lists, what hooks add. We ran one small task with Sonnet 5.5 in safe mode, which loads none of it, and with our own everyday setup: a personal CLAUDE.md of 436 lines, 30 plugins and hooks on five events. Every run passed. In safe mode a run cost $0.027 – $0.035 and took 8–10 sec. With our setup it cost $0.20 – $0.21 and took 19–25 sec. The tokens written to the cache at the start went from ~5K to 42K – 43K.

Our test · 2026-10-18

What an everyday setup adds to every run

How much do a personal CLAUDE.md, plugins and hooks add to the cost and time of one small task?

The same small task (implement parse_duration from a README, with correct tests) run with Sonnet 5.5, three times in safe mode, which loads none of our own configuration, and three times with our everyday setup: a personal CLAUDE.md of 436 lines, 30 plugins with their skills, and hooks on five events. Hidden checks decided whether a run was right. The tokens written to the cache are mostly what a session loads before it starts on the task.

Claude Code2.1.302 · Sonnet 5.5Default effort; may edit files and run the tests
Safe mode
  • 3 of 3 passed the hidden checks
  • cost at API list prices: $0.027 – $0.035
  • time: 8–10 sec
  • tokens written to the cache: ~5K
Our everyday setup
  • 3 of 3 passed the hidden checks
  • cost at API list prices: $0.20 – $0.21
  • time: 19–25 sec
  • tokens written to the cache: 42K – 43K
What each run was given
Safe mode
Implement parse_duration in duration.py as described in README.md. Run the tests with python3 -m unittest.
Our everyday setup
Implement parse_duration in duration.py as described in README.md. Run the tests with python3 -m unittest.

What this test cannot show

  • One setup, ours. Yours adds more or less depending on what it loads.
  • A short task: the fixed cost of loading the setup weighs more here than in a long session.
  • Three runs per condition.
All 6 runs, with their logs
  1. safe-1.txt passed the hidden checks · cost at API list prices: $0.027 · time: 8 sec · tokens written to the cache: 5K
  2. safe-2.txt passed the hidden checks · cost at API list prices: $0.034 · time: 10 sec · tokens written to the cache: 5K
  3. safe-3.txt passed the hidden checks · cost at API list prices: $0.035 · time: 10 sec · tokens written to the cache: 5K
  4. everyday-1.txt passed the hidden checks · cost at API list prices: $0.20 · time: 19 sec · tokens written to the cache: 42K
  5. everyday-2.txt passed the hidden checks · cost at API list prices: $0.20 · time: 22 sec · tokens written to the cache: 42K
  6. everyday-3.txt passed the hidden checks · cost at API list prices: $0.21 · time: 25 sec · tokens written to the cache: 43K

The Claude Code documentation suggests keeping CLAUDE.md under 200 lines and moving instructions for specific workflows into skills, which load only when used. Ours was more than twice that. For scripted runs, --safe-mode starts without CLAUDE.md files, skills, plugins, hooks or MCP servers, while permission rules still apply. That includes the project's own CLAUDE.md, so put what a scripted task needs into its prompt.

How to choose

  1. For a small task with clear rules and tests, start with the cheaper setting. Move up when it fails your tests, not before.
  2. Use /clear when you switch to unrelated work; stale context costs tokens on every later message.
  3. Expect your first message after a long break to cost more than the ones before it.
  4. In scripts, set the model and effort explicitly, so a change of defaults does not change your costs (part 5).
  5. Measure on your own tasks with the commands above, a few runs per setting: single runs vary (part 5).

Tools

Sources

Esc
↑ ↓ to moveEnter to open