Six Pitfalls in Measuring the Cost of Coding Agents: Evidence from a Cross-provider Study of Code Mode
Agent benchmarks now report dollars beside accuracy, but cost is usually estimated from token counts and a single provider’s price list, on one task suite, in one run, in one execution order. We ran a study of code mode—a harness’s programmatic tool-calling mode against its native tool calling—across six models from five providers, alongside four other open-source harnesses, on two task suites (8,520 planned cells). The protocol was pre-registered, with 23 documented amendments (Appendix A); a replication criterion and a counterbalanced re-run plan were filed before those data existed. We metered every request at a gateway that records each provider’s usage and cache accounting, validated to 0.023% on one 62-run Anthropic development pilot whose raw logs are not in the checksummed artifact. On the second suite, code mode (PTC against native) was cheaper for DeepSeek and gpt-6-luna: −21.8% [−37.46, −9.38] and −16.6% [−24.35, −8.55] per task (both intervals exclude zero and both survive Holm), and −22.64% [−39.77, −9.19] and −18.01% [−25.14, −10.61] on cells both modes solved. A counterbalanced re-run reproduced the per-task savings (−16.8% [−29.8, −6.3] and −19.0% [−29.0, −9.4]). Neither saving appears on batch 1. We use the study to quantify six pitfalls. (1) Token volume is not cost: pricing tokens without cache accounting reverses the point-estimate sign of the code-mode effect for three of six models, whose billed intervals include zero; after Holm correction only Haiku survives on batch 1. (2) Cache configuration is part of the treatment: where the cache breakpoint sat decided whether code mode was cached at all, and moving it made the same matrix 3.4 times cheaper. (3) Accounting can be missing: on one provider’s compatibility endpoint 128.1M input tokens arrived without a cache split, and the study’s own cost tool reported more money than was spent. (4) Execution order carries cost: one configuration’s cost varied 1.75–3.82-fold with its slot; the order effect was significant in 1 of 9 re-run rows, and a counterbalanced re-run did not bring the reversed GLM saving back (within the −8.1% to +8.0% native-arm drift). (5) Cost without quality misleads: on one model, code mode looked 54% dearer per task but was 101% dearer per solved task, because it also solved fewer tasks (46 against 60 of 62), and the re-run reproduced the gap (48 against 62). (6) One suite is not enough: two interleaved collections of identical requests differed by −5.3%, with an interval half-width of 11.6% at 31 tasks, and our own pre-registered replication on a second suite failed for all four providers. On Claude Haiku 4.5, code mode is dearer and less reliable on batch 1 (the same per-solved direction appears on the second suite, but those intervals include zero). We give a checklist for cost measurement and release the gateway, logs and analysis code.
Authors
- Max Reischl
- Alexander Feurer
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-12-02
- DOI
- https://doi.org/10.5281/zenodo.24745223
- Primary Topic
- Software Engineering Research
- Type
- preprint