context-mode: 98% less tool output for AI agents
context-mode sandboxes tool output, persists session memory, and enforces routing across 17 agent platforms through MCP and hooks. 24,793 stars.
TL;DR: context-mode is a TypeScript layer for AI coding agents that sandboxes tool output, persists session memory, and routes calls across 17 platforms. The project claims a 98% output reduction on its own description, which is worth treating as a vendor number until you measure it.
What it claims
The description is dense and specific: “Context window optimization for AI coding agents. Sandboxes tool output (98% reduction), persists session memory, and enforces routing across 17 platforms via MCP + hooks.”
Three mechanisms, one goal. Sandboxing tool output means an agent’s file reads and command results do not flood the transcript. Session memory means state survives across turns rather than living only in the context window. Routing means the same setup drives whichever agent platform you happen to be using that day.
Both numbers worth scrutinizing live in that description: the 98% reduction and the 17 platforms. Neither is independently verified here. They are the project’s own claims, stated by its authors, about their own tool. Treat them as a starting hypothesis and measure against your own transcripts, because the real reduction depends entirely on how verbose your tools already are.
The routing claim is more falsifiable than the percentage, and it is the one you can check in an afternoon.
Where it hooks in
GitHub reports these topics, and they describe the integration surface precisely:
claude,claude-code,claude-code-hooks,claude-code-plugins,claude-code-skillantigravity
The Claude Code entries outnumber everything else in the list, which tells you where most of the attention sits. Hooks are the mechanism that makes the routing stick, since a hook can intercept a tool call before it reaches the model and decide what the model actually sees.
The home page is context-mode.com.
| Field | Value |
|---|---|
| Stars | 24,793 |
| Forks | 1,784 |
| Language | TypeScript |
| License | Not recognized by GitHub |
| Created | 2026-02-23 |
| Last push | 2026-10-02 |
| Size on disk | 32 MB |
The license field deserves a flag. GitHub returned NOASSERTION, which means it found a license file but could not map it to a standard SPDX identifier. That is different from no license at all, and it often means a custom or non-standard grant. Read the file before you depend on it commercially.
The repository received a push on the day this was written.
Before you install it
This is a layer that sits between your agent and its tools. That is a powerful position and it is worth being deliberate about it:
- Anything that sees your tool output sees your source code, your file paths, and anything else your commands return
- Hooks run on your machine, so you are installing executable code into the critical path of your editing loop
- The 98% figure is self-reported and unreplicated here
Cloning to read before you wire it in:
git clone https://github.com/mksglu/context-mode
At 32 MB it is large enough that a real read is worth doing, especially given where it sits in your workflow. Start by confirming what it logs and what it retains.
When it fits
It fits if your sessions are genuinely context-bound. That is a real and common failure mode, and the symptom is obvious once you have seen it: the agent keeps re-reading files it already read, and your per-task cost climbs for no gain.
It does not fit if your tool output is already terse. Sandboxing something that was never verbose adds a layer of indirection for no gain.
Judge it on your own transcripts. The claim is plausible, the mechanism is reasonable, and the 98% is not a number you should take on faith.
Source and Accuracy Notes
- Project page: https://github.com/mksglu/context-mode
- Source repository: mksglu/context-mode (verified via GitHub API
html_url) - License:
NOASSERTION, GitHub found a license file it could not match to an SPDX identifier - Stars at time of writing: 24,793
- The 98% reduction and 17 platform figures are claims from the repository description and were not independently benchmarked. Counts, topics, and dates were read from the GitHub REST API.
Related Posts
ai-setup
Recall – Persistent Memory for Claude Code via MCP Hooks
Recall gives Claude Code a permanent memory store that survives session restarts and context compaction. Four hooks capture and restore context automatically — with cloud SaaS or self-hosted options.
2/28/2026
dev-tools
Automotive Skills Suite for AI Engineering
Evaluate Automotive Skills Suite for APQP, ASPICE, HARA, safety-plan, and DIA workflows with setup notes, governance risks, and SME review guidance.
5/28/2026
dev-tools
awesome-agentic-ai-zh Roadmap Guide
Explore awesome-agentic-ai-zh as a Chinese agentic AI learning roadmap, with setup notes, track selection, study workflow, and evaluation guidance.
5/28/2026