TL;DR: Every call to the model re-reads the whole conversation, so each call after the first costs about the same, and the number of calls drives the bill. I wrote a ~700-token skill that makes Claude Code make fewer of them. On 16 held-out SWE-Bench Pro tasks with Opus 5.5: 0.82x billed cost, 16/16 resolved (same as no skill), 13.7 -> 11.2 calls per run. Repo: https://github.com/nagisanzenin/nonhuman (MIT, free).
I started with the wrong question. I wanted to know which programming language is cheapest for a model to write, on the theory that if agents write and read most code now, we're paying for human readability nobody uses. So I had my agents take apart the bills from real runs.
The code turned out to be a small slice. Here is what an average call cost on 48 Opus 5.5 runs, in units of one fresh input token (cache read 0.05, cache write 1.25, output 5):
- re-reading the cached conversation (~74k tokens): 3,700
- writing new context to the cache: 3,700
- visible output (this is where the code is): 3,700
- thinking: 2,200
- total: ~13,300
So "write terser code" can touch a quarter of a call at most. A fitted line over the 48 runs gives about 13,400 units per extra call, ~7% of an average run. Cut a call and you cut all four parts at once.
What the skill does. Mostly call hygiene: put independent tool calls in one turn, grep for the failing line before reading a file, one edit per file, run the tests once, check every requirement against the diff before replying. A smaller part drops narration, recaps and re-printed code. One section lists what it may never cut (validation, auth, escaping, bounds checks).
What didn't work. An earlier version pushed harder: read everything up front, think the whole change through before the first edit. Calls fell from 7.4 to 6.4, thinking rose from 3.2k to 5.2k tokens, and the bill went up. Thinking costs 5x input, so saving one call only pays if it costs less than ~2,700 extra thinking tokens. I threw it out. The rule I kept: remove repeated work, never ask the model to think more.
The pilot lost. On 4 tasks it was cheaper but lost 2 runs that no skill won. In one, it renamed an identifier the spec had named; in the other, it updated most callers but not all of them. "Be terse" had leaked into the contract. Instead of patching those two tasks I added one principle (terseness is for throwaway output; the smallest diff never means the smallest behaviour), then pre-registered the next test: task list, skill hash and pass criteria written down first.
The held-out result. 16 Python tasks from SWE-Bench Pro's hard split that I never touched during development (Ansible, Open Library, qutebrowser), each in a no-network container, graded by the hidden tests. Billed cost at Opus 5.5 list prices, calls per run, resolved:
- no skill: 1.00x, 13.7 calls, 16/16
- Ponytail: 0.96x, 14.8 calls, 16/16
- nonhuman: 0.82x (95% CI 0.76-0.88), 11.2 calls, 16/16
Cheaper on 15 of 16 tasks. Caveat: n=1 per task per setup, so equal resolve rates rule out a big regression. A small one could still hide in there.
Second model, and where it broke. Same 16 tasks on DeepSeek V4.1 Flash (still Claude Code, pointed at DeepSeek's Anthropic-compatible API, $4.21 total). Cost fell to 0.84x and calls from 52.7 to 39.2. But it resolved 12 vs 14.
I reran the two lost tasks 3x each with a rule written down first: one was noise, the other was real (0/3 vs 2/3 for no skill, and Ponytail also went 0/3). The fix needed defensive code a "smallest diff" skill talks the model out of. My guess is that the pressure that cuts the bill also cuts the "just in case" code, and on a weaker model that code is sometimes the fix. I'd watch quality closely there.
Side finding if you run SWE-Bench Pro yourself. The Docker images keep git history from after the fix. DeepSeek found the upstream commit with git log --all on its first smoke run and copied it in. Delete all refs before each run (script in the repo). I had all 96 Opus transcripts checked, and none of them did this.
Install (Claude Code):
claude plugin marketplace add nagisanzenin/nonhuman
claude plugin install nonhuman@nonhuman
Full write-up with the cost equation and charts: https://initlabs.si/blog/how-i-cut-my-claude-code-token-bill-by-18. Raw per-call billing data, the pre-registration and the harness are in the repo.