context-mode for Claude Code, Measured: 315 KB of Tool Output Became 5.4 KB (Here’s the Catch)

context-mode, Measured: 315 KB of tool output became 5.4 KB

Last Verified: October 22, 2026 — we ran context-mode’s own benchmarks and two of our real logs on Windows 11, Node 24.18.1, context-mode v1.0.169 (commit a92cf6a). Local scripts only, no Claude session

When Claude Code runs a tool, the whole output lands in its context window: a 56 KB page snapshot, a 100 KB build log, every line of it. context-mode changes where that output goes. The raw output stays in a sandbox on your machine, a small script reads it there, and only what that script prints reaches Claude. It isn’t compression. Nothing gets squeezed; most of it simply never enters the conversation.

The README says 315 KB becomes 5.4 KB, 98% less. We wanted to know if that holds, what it actually counts, and what happens on our own logs. So we cloned the repo, ran its benchmarks, and pushed two of our own files through the same sandbox. Here’s what came out.

Watch on YouTube

Measured by us · October 22, 2026

Windows 11 laptop, Node 24.18.1, context-mode v1.0.169 (commit a92cf6a), installed from GitHub with npm install --ignore-scripts. No Claude login, no API key: we ran the repo’s benchmark scripts and its real sandbox executor locally.

What we ranResult
The README benchmark, 14 scenarios315 KB → 5.4 KB in context, 98% less. 13 of 14 rows matched BENCHMARK.md to the byte
All 21 benchmark scenarios95.8% (the docs say 96%)
Same 14, counting the summary scripts tooabout 95% (94.7%). The benchmark doesn’t count them
Our failed render log, 1,117 lines103 KB → 329 B. The error message was still there, word for word
A small 0.4 KB network log13%. Small outputs barely gain

Sizes are bytes of text that would enter the context. The repo turns bytes into tokens by dividing by 4; we didn’t run a real tokenizer, and we didn’t measure tokens, cost or session length inside Claude Code.

Terminal: context-mode ecosystem benchmark, 14 rows, total 315KB to 5.4KB, 98%
Our run, October 22: the README’s 14 scenarios on our machine, reprinted as a narrow table. The last line is the headline number: 315 KB of tool output, 5.4 KB in context.

Quick Start

  • What it is: an MCP server plus a Claude Code plugin. It adds sandbox tools (run code on a file or command output, index and search docs) and hooks that nudge Claude to use them instead of dumping raw output.
  • Who made it: Mert Koseoglu (GitHub mksglu). Not made by Anthropic.
  • Cost: free to use. License: Elastic License 2.0, which is source-available, not an OSI license (details below). About 31,700 GitHub stars (October 22, 2026).
  • Works best on: big, noisy output: logs, page snapshots, issue lists, CSVs. Not on output that’s already small.

Install, in Claude Code (two lines from the README):

/plugin marketplace add mksglu/context-mode
/plugin install context-mode@context-mode
On this page (12 sections)
  1. It Doesn’t Compress. Here’s What Happens Instead
  2. Our Own Log: 103 KB In, 329 Bytes Out
  3. All 14 Scenarios, With the Part the Benchmark Skips
  4. Search Mode Is a Different Number
  5. What We Did Not Test
  6. Step 1. Install
  7. Step 2. Use It
  8. How to Remove It
  9. License and Privacy
  10. Reproduce Our Numbers
  11. FAQ
  12. Sources

It Doesn’t Compress. Here’s What Happens Instead

Without context-mode, Claude reads a log by pulling the whole file into the conversation. With it, Claude writes a few lines of code (count the errors, keep the failing line, print the stage times) and runs that code in a separate process. The file is read inside that process. Only the console.log output comes back.

Normal tool callWith context-mode
What runsRead the file / run the commandA short script that reads it, in a sandbox subprocess
What enters contextEverything it returnedOnly what the script prints
Who decides what to keepNobody: you get it allThe script, which Claude writes
Raw dataIn the conversationStays on your disk

The third row matters most: the saving depends on the script. The README’s benchmark uses summary scripts a person wrote in advance. In real use, Claude has to write them, and a careless one could drop the line you needed. That’s why we tried it on a log where we knew what had to survive.

Our Own Log: 103 KB In, 329 Bytes Out

We picked a real failure: the log from a video render that crashed at the very end (1,117 lines, 103,272 bytes). We fed it to context-mode’s actual sandbox executor (ctx_execute_file) with a short summary script, the kind Claude would write: did it fail, how many warnings, the error line, time per stage.

Terminal: render log 100.9 KB to 329 B, Render FAILED, 37 lint warnings, EPERM rename error, stage times
Our run, October 22: the four lines Claude would see from a 100.9 KB render log. The error line is cut in this capture for width; in the real output it’s complete.

Those 329 bytes held everything we needed to fix it: the render failed, lint found 0 errors and 37 warnings, the full EPERM: operation not permitted, rename error with both file paths, and the stage times (capture 167 s, encode 166 s). That’s 99.7% smaller, or 99.0% if you count the 715-byte script.

We also ran a 158-commit git log --stat (171,711 bytes) through it: 461 bytes came back with the commit count, lines added and removed, the five most-touched files and the last three commits.

Compared with what we actually do today

Nobody pastes a 100 KB log in full. Our habit is tail -20, which on this log is 3,848 bytes. Against that, context-mode’s 329 bytes is about 91% smaller, not 99.7%. On the git log, head -60 was 2,689 bytes against 461 (about 83%).

The bigger difference is what you get: tail shows the last lines, while the script counted all 37 warnings and summed every commit. A tail can’t do that.

All 14 Scenarios, With the Part the Benchmark Skips

This is the README’s main benchmark (BENCHMARK.md, Part 1), run on our machine with npm run -s test:ecosystem. The last two columns are ours: the size of the summary script for each row, and the saving if you count that script as context too (because in real use, Claude has to write it into the conversation).

ScenarioSourceRawIn contextSavedScript sizeSaved, script counted
React useEffect docsContext75.9 KB261 B96%1,012 B79%
Next.js App Router docsContext76.5 KB249 B96%1,131 B79%
Tailwind CSS docsContext74.0 KB186 B95%916 B73%
Page snapshot (Hacker News)Playwright56.2 KB299 B99%1,132 B98%
Network requestsPlaywright0.4 KB349 B13%1,115 Bbigger than the raw
PR list (Next.js)GitHub6.4 KB719 B89%767 B77%
Issues (React)GitHub58.9 KB1,139 B98%849 B97%
Test output (30 suites)vitest6.0 KB337 B95%810 B81%
TypeScript errors (50)tsc4.9 KB347 B93%772 B78%
Build outputnext build6.4 KB405 B94%597 B85%
MCP tools (40)tools/list17.0 KB742 B96%843 B91%
Access log (500 requests)nginx45.1 KB155 B99.7%704 B98%
Git log (150+ commits)git11.6 KB107 B99%421 B96%
Analytics CSV (500 rows)CSV85.5 KB226 B99.7%545 B99%
Total, 14 scenarios315 KB5.4 KB98%11,614 B94.7%

Our run matched BENCHMARK.md on 13 of 14 rows to the byte; the CSV row printed 226 B instead of 222 B. Script sizes include indentation, so they’re slightly generous. The capture above rounds to whole percents, so 99.7% shows as 100%.

Two things stand out. The big wins are on big, repetitive output (a 56 KB page snapshot, a 500-line access log, a 500-row CSV), where even counting the script you keep 97 to 99%. And on small output it doesn’t pay: the 0.4 KB network log only shrank 13%, and once you add the script it’s bigger than just reading the raw output.

Search Mode Is a Different Number

context-mode can also index docs into a local SQLite full-text index and return only the matching sections. The repo benchmarks that separately (Part 2: three fixed queries per document). Our run with npx tsx tests/live-benchmark.ts:

DocumentRawSearch resultsSaved
Supabase Edge Functions3,988 B2,246 B44%
React useEffect docs6,075 B1,494 B75%
Next.js App Router docs6,658 B3,311 B50%
Tailwind CSS docs4,102 B620 B85%
Skill prompt (main)16,683 B0 Bno match (all 3 queries found nothing)
Skill references (4 files)36,090 B2,412 B93%
MCP tools/list (40)2,509 B1,016 B60%

Total: 76,105 B → 11,099 B, 85%. Add the 14 Part 1 scenarios and you get the README’s “21 scenarios”: 398,524 B → 16,620 B, 95.8%.

One row isn’t a saving, it’s a miss

The skill prompt file has grown since BENCHMARK.md was written (4.4 KB then, 16.3 KB now), and none of its three fixed queries matched anything in the current version. The script prints 0 bytes and reports it as a 0% row. In real use that would mean Claude gets nothing back and has to search again. Search saves less than the script mode (44 to 93%) and depends on asking the right question.

What We Did Not Test

We measured the sandbox, not a working session. These README claims need a logged-in Claude session, and we haven’t checked them:

  • How well Claude writes the summary scripts on its own, how long they get, and how often it has to retry.
  • Real token counts. Every size here is bytes; the repo’s tokens are bytes divided by 4.
  • Your bill or usage limit. Context bytes aren’t the same as cost; output tokens are a separate thing.
  • Longer sessions. The README says sessions last much longer before context fills up. Not measured.
  • Picking up after compaction, which the plugin tracks in a local SQLite database.

If you install it, the plugin’s own /context-mode:ctx-stats shows the savings for your session. That’s the number to trust for your work.

Step 1. Install

Claude Code plugin (recommended in the README)

~2 min

Needs Claude Code v1.0.33 or newer (claude --version). Type these where you talk to Claude:

/plugin marketplace add mksglu/context-mode
/plugin install context-mode@context-mode

Restart Claude Code (or run /reload-plugins), then check it:

/context-mode:ctx-doctor

Every check should show [x]. Per the README, the plugin registers six hooks and 11 MCP tools, and injects its routing instructions at session start without writing files into your project.

Or: MCP server only (try it without the hooks)

~1 min

From your terminal. You get the tools, but Claude isn’t nudged to use them:

claude mcp add context-mode -- npx -y context-mode

Cloning the repo to run the benchmarks yourself?

Use npm install --ignore-scripts. The package’s postinstall script contains code that updates Claude Code’s plugin registry; skipping it keeps a benchmark-only clone from touching ~/.claude. We checked: our settings file was byte-identical before and after.

Step 2. Use It

CommandWhat it does (per the README)
/context-mode:ctx-statsSavings for this session, per tool
/context-mode:ctx-doctorChecks runtimes, hooks, the search index and versions
/context-mode:ctx-index · ctx-searchIndex a file or folder, then search it
/context-mode:ctx-purgeDeletes everything in the local index
/context-mode:ctx-upgradePulls the latest version and re-wires the hooks

Day to day you don’t call the tools yourself. Ask Claude to look at a big log or a page and, with the hooks on, it should reach for the sandbox instead of reading the raw output. Then run ctx-stats to see what it actually saved.

How to Remove It

From your terminal (commands checked against claude plugin --help, Claude Code 2.1.308):

claude plugin uninstall context-mode@context-mode
claude plugin marketplace remove context-mode

Installed the MCP-only version instead? claude mcp remove context-mode. If you added the optional status line, delete the statusLine block from ~/.claude/settings.json. Indexed content lives in ~/.context-mode/content/ (per the README); run ctx-purge before uninstalling, or delete that folder.

License and Privacy

context-mode is under the Elastic License 2.0. It’s free to use, copy, modify and share. The main limit: you can’t offer it to others as a hosted or managed service. That makes it source-available; it isn’t an OSI-approved license like MIT.

The README says: “No telemetry, no cloud sync, no usage tracking, no account required.” The one online piece is optional: ctx-insight opens a hosted team dashboard in your browser. We didn’t check its pricing or what it needs.

Reproduce Our Numbers

No Claude account needed. Node 22.5+ (we used 24.18.1):

git clone --depth 1 https://github.com/mksglu/context-mode
cd context-mode
npm install --ignore-scripts
npm run -s test:ecosystem
npx tsx tests/live-benchmark.ts

The first prints the 14 scenarios, the second the 7 search scenarios. Our own-log test used the repo’s PolyglotExecutor.executeFile with a 715-byte summary script; the render log is ours, so your files will give different numbers.

FAQ

Does context-mode cut my Claude bill by 98%?

We can’t say that, and the 98% doesn’t mean it. It’s 98% fewer bytes of tool output entering the context, on the benchmark’s own files with pre-written scripts. We didn’t measure tokens or cost. Check ctx-stats on your own sessions.

Is it compression?

No. The raw output stays in a sandbox process, and only what a short script prints comes back. Nothing is encoded or squeezed.

Will Claude miss important lines?

It can, if the script it writes keeps the wrong things. On our failed render log, the full error line survived in 329 bytes. That’s one log, not a guarantee.

When does it not help?

Small output. Our 0.4 KB network log shrank 13%, and counting the script it got bigger. Search mode saves less too (44 to 93%) and can come back empty.

What license is it under?

It’s source-available under the Elastic License 2.0: free to use and modify, but you can’t resell it as a hosted service.

Related guides

4 ways to cut Claude Code token usage, measured · 5 Claude Code settings to change first

Sources

context-mode by Mert Koseoglu, Elastic License 2.0: github.com/mksglu/context-mode.