Although coding agents are now very effective in a variety of programming languages, their token cost can vary dramatically by programming language. We evaluate five recent models on programming problems in Python, Java, Rust, and OCaml. Carefully controlling for problem difficulty, we find stark and consistent variation in token consumption across languages. To understand why, we analyze both the structure and content of agent trajectories. We find that agents repeatedly produce noncompiling solutions in unfamiliar languages, revise solutions that already pass, plan solutions in code comments, distrust provided tests in favor of inputs they invent, and sidestep unfamiliar target languages by prototyping in Python. By-language token efficiency should therefore be considered when benchmarking and developing multilingual coding agents.
@misc{wu:tokenmaxxing,
title={The Best Programming Language for Tokenmaxxing: An Investigation of Coding Agent Behavior Across Programming Languages},
author={Zixuan Wu and Carolyn Jane Anderson and Arjun Guha},
year={2026},
eprint={2607.22807},
archivePrefix={arXiv},
primaryClass={cs.SE},
url={https://arxiv.org/abs/2607.22807},
}