Use case: test logs
Test and build logs: the agent reads the summary
A test run or a build log can put thousands of lines in front of the model. Context Mode Engine runs that output in a sandbox on your machine. A short script picks the failing tests, the error lines and the counts, and the model reads that summary. On a Vite test run of 1,106 tests, 61.4 KB of output reached the model as 0.4 KB.
Free · Local · Private · Forever
Context Mode Engine is source-available under the Elastic License 2.0. Free to use, for all time. It runs on your machine and keeps your data in ~/.context-mode.
Key facts
- What it is
- A use case for Context Mode Engine: test runs, lint reports, install logs, server logs and infrastructure plans.
- Who it is for
- Anyone who asks an agent to run the tests, fix the red ones and run them again.
- Agents
- The Engine works in ten agents: Claude Code, Codex, Gemini CLI, Qwen Code, Copilot CLI, VS Code, Kiro, ZCode, OpenCode and Pi.
- Measured result
- A 61.4 KB vitest run reached the model as 0.4 KB, and a 281.8 KB lint report as 0.6 KB. Plugin benchmark of 2026-11-01, median of 5 runs, raw table.
- Scope
- Tool output in the agent where you install the Engine. Bytes that reach the model, per tool output.
The job
You ask your agent to run the test suite and fix what is red. The suite prints every test name, every stack trace and every timing line. The agent needs a short list: the failing tests, the first error of each and the file to open.
With Context Mode Engine, the full log goes to a sandbox on your machine. The agent writes a small script that reads the log and prints the list. The model reads the list. The full log stays in the local index, and the agent can search it later with ctx_search.
What reached the model
Each row is one real tool output from an open project. The second column is the size of the raw output. The third is the size of the summary the model read.
| Tool output | Raw output | Reached the model | Sandbox time |
|---|---|---|---|
Test run, 1,106 tests, 25 failing (vitest run --reporter=verbose, vitejs/vite) | 61.4 KB | 0.4 KB | 60 ms |
Lint report as JSON (biome lint --reporter=json, packages/vite/src) | 281.8 KB | 0.6 KB | 65 ms |
Workspace install log (pnpm install --frozen-lockfile, vitejs/vite) | 14.6 KB | 0.2 KB | 59 ms |
Database server log (docker logs, mongo:8.0 --verbose) | 59.0 KB | 0.6 KB | 62 ms |
Infrastructure plan (terraform plan, 72 resources) | 33.3 KB | 0.2 KB | 62 ms |
Plugin benchmark of 2026-11-01 on an Apple M1 Pro, default settings, median of 5 runs. Raw data: the result tables and the same file on GitHub. Rerun it with the steps on Benchmarks.
How it works
- Your agent calls
ctx_executewith the command, or the PostToolUse hook catches a large output from a shell call. - The sandbox on your machine runs the command and gives the output to a short script the agent wrote.
- The script prints what the agent asked for, for example the failing tests and their first error line. That print is what the model reads.
- The full output goes into a SQLite FTS5 index in
~/.context-mode. When the agent needs a stack trace later, it searches for it.
Read more on Sandbox and Search and index.
Prompts to give your agent
Run the full test suite. Give me each failing test, its first error line and the file to fix. Then fix them one at a time and run the suite again.
Run the linter on src. Group the findings by rule, show the count for each rule, and fix the rule with the most findings.
Run terraform plan and list each resource it will replace or destroy, with the reason the plan gives.