context-mode
An open-source context window optimization tool for AI coding agents. It reduces token consumption and extends single-session continuity by sandboxing tool outputs, persisting session memory, and managing cross-platform routing.
Timeline (last 90 days)
This independent test never actually ran context-mode inside an agent, so it cannot judge the probability that a real model writes the script correctly on the first try, nor evaluate how session memory performs after compression.
context-mode is an open-source MCP server plus hook combination aimed at coding agents such as Claude Code, Codex, Cursor and Gemini CLI; its core function is to hand large tool outputs to an agent-generated script for execution in a subprocess, returning only the script's printed result and indexing the raw output into a local SQLite full-text search database.
context-mode uses the Elastic License 2.0 source-available license, having switched in March after initially being released under the MIT license.
context-mode once appeared on GitHub's trending list, gaining 904 stars in a single day, with total stars approaching 30,000.
context-mode claims it can save AI coding agents 98% of context window usage.
The 98% figure comes from the project's own tests/ecosystem-benchmark.ts; the benchmark contains 14 scenarios, each pairing a saved tool output with a summary script hand-written for that file, comparing the original file size with the script's output size.
An independent reproduction test ran the full benchmark using the project's own executor, and the results matched BENCHMARK.md byte for byte, confirming that the 98% figure itself is not fabricated.
Recounting the same 14 scenarios: raw tool output was 322,419 bytes, stdout alone was 5,517 bytes (98.3% savings), adding the echo path and code brought it to 16,916 bytes (94.8% savings), and adding the code in the call itself brought it to 27,504 bytes (91.5% savings).
Each ctx_execute_file reply in context-mode begins with the file path and a code block of up to 2000 characters, followed by the output, and the benchmark does not count these echoes and script code.
In the benchmark's git log sample, the script uses split(" ")[4] assuming the fifth word on each line is the commit type, but this only holds when the author's name is two words; the tester ran the same script on context-mode's own commit history (2,234 commits, 203 KB), and the summary output went from 107 bytes to 7,071 bytes, a 96.5% savings, but the output wrongly showed the most common type as 'update', when in fact 550 commits came from the single-word author name github-actions[bot].
19 more timeline events
All Facts (20)
This independent test never actually ran context-mode inside an agent, so it cannot judge the probability that a real model writes the script correctly on the first try, nor evaluate how session memory performs after compression.
50%Unverifiedcontext-mode uses the Elastic License 2.0 source-available license, having switched in March after initially being released under the MIT license.
50%Unverifiedcontext-mode once appeared on GitHub's trending list, gaining 904 stars in a single day, with total stars approaching 30,000.
50%Unverifiedcontext-mode claims it can save AI coding agents 98% of context window usage.
50%UnverifiedThe 98% figure comes from the project's own tests/ecosystem-benchmark.ts; the benchmark contains 14 scenarios, each pairing a saved tool output with a summary script hand-written for that file, comparing the original file size with the script's output size.
50%UnverifiedAn independent reproduction test ran the full benchmark using the project's own executor, and the results matched BENCHMARK.md byte for byte, confirming that the 98% figure itself is not fabricated.
50%UnverifiedRecounting the same 14 scenarios: raw tool output was 322,419 bytes, stdout alone was 5,517 bytes (98.3% savings), adding the echo path and code brought it to 16,916 bytes (94.8% savings), and adding the code in the call itself brought it to 27,504 bytes (91.5% savings).
50%UnverifiedEach ctx_execute_file reply in context-mode begins with the file path and a code block of up to 2000 characters, followed by the output, and the benchmark does not count these echoes and script code.
50%UnverifiedIn the benchmark's git log sample, the script uses split(" ")[4] assuming the fifth word on each line is the commit type, but this only holds when the author's name is two words; the tester ran the same script on context-mode's own commit history (2,234 commits, 203 KB), and the summary output went from 107 bytes to 7,071 bytes, a 96.5% savings, but the output wrongly showed the most common type as 'update', when in fact 550 commits came from the single-word author name github-actions[bot].
50%UnverifiedIn context-mode's own commit history, a total of 679 commits (30%) had author names that were not two words, causing three-part names to treat the author's surname as the commit type, and the script did not error, so the output looked like a summary.
50%Unverifiedcontext-mode's answer to information loss is indexing: when an intent is passed in and the output exceeds 5KB, the output is chunked into SQLite FTS5 and only the best-matching passages are returned.
50%UnverifiedThe tester used gh issue list --json to fetch 100 open React issues (303KB) and constructed a reply in context-mode's intentSearch manner with the query intent 'ViewTransition bugs'; the reply was 1,667 bytes (99.4% savings), but of the 100 issues, 8 mentioned ViewTransition and none of their numbers appeared in the reply, the five matching titles were all 'Output', and the previews were 120-character slices of the raw JSON.
50%Unverifiedcontext-mode's 98% savings is an upper bound measured under ideal conditions and does not count the tokens the model consumes to generate the summary script itself, which is also part of the context.
50%UnverifiedThe tester suggests: adopt context-mode's idea but do not necessarily rely on this package; when command output is large, have the agent write it to a file and run a script to process it, while requiring the script to print a few raw sample lines alongside the counts to expose misparsing; evaluate such tools on a task basis rather than byte basis, and count the agent-written code in the total overhead.
50%Unverifiedcontext-mode is an open-source MCP server plus hook combination aimed at coding agents such as Claude Code, Codex, Cursor and Gemini CLI; its core function is to hand large tool outputs to an agent-generated script for execution in a subprocess, returning only the script's printed result and indexing the raw output into a local SQLite full-text search database.
50%Unverifiedcontext-mode isolates raw outputs such as web page snapshots and command-line logs outside the context window through sandboxed tools.
50%UnverifiedOfficial data states that the sandbox isolation mechanism can achieve up to 98% reduction in context bloat.
50%Unverifiedcontext-mode persists session memory to a SQLite database so that previous changes and task states can still be retrieved after a conversation has been compressed.
50%UnverifiedThe Hooks mechanism allows developers to insert custom logic at lifecycle nodes of tool calls, and is the key means of intercepting and transforming raw output.
50%Unverifiedcontext-mode is an open-source tool based on TypeScript, focused on optimizing context windows for AI coding agents.
50%