If you run Cypress through Claude Code or a similar AI coding assistant, you probably haven't thought about what happens to the output after the test finishes.
The command runs once, but its output doesn't go away. It sits in the conversation context and gets re-sent on every API call for the rest of your session. We call this the context passenger: a cost you paid once to produce, then pay again, quietly, on every turn that follows.
We measured what running Cypress with the default configuration added to the context and were able to cut it by 75%.
How we benchmarked
We used the Claude Code CLI with the claude-sonnet-4-6 model to run the cypress-example-kitchensink full test suite in run mode. The repository's test suite contains 20 specs and 120 tests, and to simulate a realistic scenario, we forced one test to fail.
For the baseline, we started three separate Claude sessions asking the agent to run Cypress in the Electron browser with the default configurations. We then measured cache_write tokens for the Cypress run turn specifically because that’s the test output being written into context, the thing that gets carried forward on every subsequent turn.
How we cut Cypress’s context footprint by ~75%
After establishing the baseline, we tested our hypothesis that we could use existing Cypress configuration options to lower the cost. We had expected a reduction in tokens; we just didn’t realize by how much.
Two small changes allowed us to reduce the token cost by 75%:
- Switching the mocha reporter from the spec reporter to the built-in dot reporter with --reporter=dot
- Quieting the Cypress CLI output with -q
# Running Cypress with defaults
npx cypress run
# Running cypress with dot reporter and the quiet flag
npx cypress run --reporter=dot -q
We saw these results:
npx cypress run |
npx cypress run --reporter=dot -q |
||
|---|---|---|---|
| 1 | 2,585 | 633 | 75.5% |
| 2 | 2,589 | 627 | 75.8% |
| 3 | 2,576 | 643 | 75.0% |
About 1,950 fewer tokens, consistent across every run, with variance under 15 tokens.
These are the cache_write tokens for the Cypress run turn alone. We isolated that turn to strip out other variables and get an honest read of Cypress's footprint on the agent's context.
The best part is these token optimization configurations don't cause you to lose the necessary failure detail. The dot reporter still prints the full failure summary and stack at the end. What it drops is the line-per-passing-test noise. Your agent keeps everything it needs to diagnose and fix a failing test; it just stops paying to narrate the passes.
Why the footprint matters more than the run cost
Looking at the results, a ~75% reduction is huge, but how does this contribute to the overall session costs? Ultimately, when considering this single turn, the cost difference in itself is small, almost negligible. However, this is a compounding cost, not a one-time cost. Those tokens ride in the context for every subsequent turn and are re-read from cache each time your agent continues to do more work in the session.
In our experiment, we measured the one-time write cost, but the carry cost is real and scales with two things: the size of your test suite and how long the agent keeps working after the test runs. In long sessions, a ~1,950 token passenger re-read across dozens of turns is the difference you actually pay for.
Make it a rule for your agent
Nobody remembers to pass these flags on every prompt. It's a small detail, and small details are exactly what you encode as a rule so the agent applies them automatically. Add this to your agent rules file (AGENT.md, CLAUDE.md, or whatever your tool uses):
## Running Cypress
When running Cypress tests, always use `--reporter=dot -q`Set it once, and every agent-driven test run in that repo benefits without any manual intervention.
The takeaway
Test output is the context passenger whose cost follows you around long after the run finishes. Switching to --reporter=dot -q will help reduce the context footprint of your agent’s session by about three-quarters. Set it once and never think about it again.
And the bigger habit: audit what your agent tooling leaves in context. Tool output is a recurring cost and a place where significant token savings can be realized.
