A coding agent edits a file, runs the tests, reads the result and tries again. What it needs from that result is usually short: which tests failed, and why. What it often gets is a line for every test that passed. I measured how much of the output that is.

A few words first

A token is a chunk of text, roughly three quarters of an English word. APIs bill per million tokens: input is what you send, output is what the model writes. A coding agent is a program that calls a model in a loop and lets it run commands. A test runner is the tool that executes your tests and prints the results. A reporter is the format it prints them in. A pipe is how one program reads another program's output without a terminal window in between, which is typically how a script runs your tests.

The setup

I generated a suite of 120 tests: 12 areas of a made-up shop (cart, refunds, taxes and so on) with 10 tests each, such as test_rejects_missing_id. The same tests exist in Python and in JavaScript. Two of them fail for real, on a price that isn't rounded: 16.9915 instead of 16.99.

I ran them through a pipe with Python 3.13.5's unittest and the test runner built into Node 20.19.2. I counted tokens with tiktoken, OpenAI's tokenizer library, using the o200k_base encoding.

Command All pass, tokens Two fail, tokens
python -m unittest -v 2,647 2,837
python -m unittest 19 213
node --test (piped) 4,542 5,069
node --test --test-reporter=spec 1,732 2,583
node --test --test-reporter=dot 14 478

In the verbose Python run with two failures, the 118 passing lines take 2,584 tokens out of 2,837. That's 91%. Each one costs about 22 tokens, because the line prints the test name twice. When everything passes it's 99%: 2,647 tokens to say what "Ran 120 tests … OK" says in 19.

Python's default is already quiet, so there you only pay if someone added -v. Node surprised me. Through a pipe, this version printed TAP, a machine-readable format that gives every passing test five lines, including its duration. That's 4,542 tokens when nothing is wrong. Other Node versions may pick another default, so check yours. The durations also change between runs, so the Node numbers can move by a few tokens.

What it costs

An agent keeps earlier messages and sends them again on every step, so the output of the first test run is paid for on every later step too. Suppose the agent runs the tests 10 times in one task, with one model call after each run and the same two failures every time. The first output is sent 10 times, the second 9 times, and so on: 55 copies in total.

That's 156,035 input tokens with unittest -v and 11,715 without it. On gpt-5.6, at a list price of $2 per million input tokens, the test output alone costs $0.31 per task against $0.02. At 100 tasks a day it's $936 against $70 a month. On claude-haiku-5.5 ($0.10 per million) it's $47 against $3.51. For Node on gpt-5.6, the piped default comes to about $1,673 a month and the dot reporter to about $158. Prices are from the catalog snapshot of the LLM gateway I work on, dated November 25, 2026. I used the same token counts for every model, and other vendors' tokenizers will differ.

The verbose part also grows with the suite. At 22 tokens a line, 500 tests would be about 11,000 tokens per run, while the quiet version would stay around 220 with the same two failures.

The fix

Start with the flag. In Python, drop -v. In Node, add --test-reporter=dot. Put the exact command in your agent's instructions, so it doesn't choose a verbose one itself.

If you can't change the command, filter its output. This wrapper does that for unittest -v:

import subprocess import sys run = subprocess.run(sys.argv[1:], capture_output=True, text=True) text = run.stdout + run.stderr with open("test.log", "w") as f: f.write(text) # the full version stays on disk kept = [line for line in text.splitlines() if not line.endswith("... ok")] print("\n".join(kept)) print(f"exit code {run.returncode}, full output in test.log") sys.exit(run.returncode) 

Save it as quiet_tests.py and run python quiet_tests.py python -m unittest -v. On my suite it shows 264 tokens with two failures and 27 when everything passes. It only removes lines that end in ... ok, so anything unexpected still gets through. The exit code (the number a program returns, where 0 means success) is passed along, so a failing run still counts as failing.

Stopping at the first failure with -f looks like another fix. It printed 758 tokens together with -v, but it hid the second failure, so the agent may need an extra run to find it.

What this doesn't solve

I counted tokens and didn't measure whether agents fix bugs better or worse. Passing test names sometimes help: they tell the model what already works, or that the test it just wrote actually ran. With quiet output, a test that was never discovered looks almost the same as one that passed. Only the total count gives it away, so keep that line.

The suite is synthetic. Your test names may be shorter, and real failures are often longer. If 40 tests fail at once, the failures are the bill and hiding the passing tests saves little. Shortening the failures themselves is a separate job.

Ten runs per task is an assumption, and so is keeping every output in the history. Some agents trim old results. Prompt caching, a discount for input the provider has recently seen, makes the resent part cheaper. A gateway can't do this for you: it sees text, and it doesn't know which lines of it were passing tests.