Use case · Context Saving
I pay for 600 test results to fix 1. Pay for the 1.
Context Mode keeps the failing test and the summary, and folds the 599 passing tests into one line. On npm test with 600 tests, 17.0 KB becomes 1.2 KB. A Ruby minitest fix loop on Claude Opus 5.5 cost 61% less.
600 tests. 1 fails.
$ npm test 1 failing: the test and its assertion, as printed … 599 passing tests folded (599 lines) then a label: 599 passing tests folded, full output under an id, do NOT re-run the command
The failing test, its assertion and the summary line stay as printed.
Ruby, 401 tests. 1 fails.
Sent to the model
- The failing test and its error
- The summary line
- One line for the tests that passed
Kept in your archive
- All 401 results, word for word
Measured on the test fixtures of the folding A/B, Claude Haiku 4.5.
The agent needs one passing line after all. It asks your archive for it by id.
context-mode-search
{"docid":
"context-mode-toolcap-<hash>-<length>"}Sent to the model
- The lines it asks for
Kept in your archive
- The full output, under that id
No second test run. The label tells the agent not to run the command again.
Test fix loops, run with and without Context Mode. Cost per task.
Your own Anthropic or OpenAI account pays the model. We add no fee on tokens.
One test fails. You pay tokens for all 600.
Your agent runs the tests, and the runner's output enters the conversation.
The agent sends the whole conversation to the model on each later call, so the passing lines are sent again and again.
Run the tests, fix the code, run them again. Each run adds one more full log.
Keep the failure. Fold the passes.
- 01Your agent runs the tests
As usual:
npm test,minitest -vor another runner. - 02Context Mode folds the output
The failing test, its assertion and the summary line stay as printed. Passing tests fold into one counted line.
- 03The full log stays in your archive
The short version names an id. The agent reads any line back with
context-mode-search, with no second test run.
npm test. The runner prints 17.0 KB: 600 tests, 1 failing.- Keeps the failing test and its assertion
- Keeps the summary line
- Folds 599 passing tests into one line
- Archives the full 17.0 KB under an id
The same test fix loop, run twice. Cost per task.
| Test output | Context Mode | Direct |
|---|---|---|
| npm test, 600 tests, 1 failing | 1.2 KB | 17.0 KB |
| Ruby minitest -v, 401 tests, 1 failing | 0.7 KB | 16.2 KB |
| Test fix loop, cost per task | Context Mode | Direct | Lower |
|---|---|---|---|
| Ruby minitest fix loop, Opus 5.5 | $0.061 | $0.157 | 61% |
| npm test fix loop, short, Opus 5.5 | $0.068 | $0.087 | 22% |
| npm test fix loop, Haiku 4.5 | $0.032 | $0.069 | 53% |
Paired runs at API list price, with the same task success with and without Context Mode. The output sizes come from the test fixtures of the folding A/B. Your own saving depends on your mix of work. Method and sources →
What this uses.
Folds long tool output before the model reads it. Errors stay in full.
The 15 filters, the fold rules and the archive read-back.
Every paired run, with its evidence file.
Start free. Your own Anthropic or OpenAI account pays the model. We add no fee on tokens.
Related: Cut agent spend · For developers · Long sessions
Try it on your next test run.
npx @context-mode/cli connects your agents. 1,000 requests free, no card.