Is Context-Mode Open Source? The License

10 min read · · MoClaw Editorial
Is Context-Mode Open Source? The License

Context-mode switched from MIT to Elastic License 2.0 eight days after launch. What ELv2 restricts, what the 98% claim measures, and who should care.

Table of Contents

Share this

Most people install context-mode after reading a badge. The README carries a bright blue one that says ELv2, which almost nobody clicks, and until early March 2026 the same repository carried an MIT badge instead. Between those two states sits a licence change that was committed eight days after the project's first release and has been quietly governing every install since. If you are deciding whether context-mode belongs in your company's toolchain, that commit matters more than the compression number everyone quotes.

The engineering behind context-mode is not in question. mksglu/context-mode is an MCP server for AI coding agents that keeps raw tool output out of the model's context window, tracks session state in SQLite, and enforces routing across seventeen platforms through MCP plus hooks. As of September 8, 2026 it sits at 20,913 stars and 1,500 forks, with 111 open issues, and the last push was September 7. It hit the front page of Hacker News with 570 points and 107 comments under the title "MCP server that reduces Claude Code context consumption by 98%".

The context-mode LICENSE file on GitHub. The blame line reads "chore: switch license from MIT to Elastic License 2.0 (ELv2)", and the body opens with the ELv2 Limitations clause.
The context-mode LICENSE file on GitHub. The blame line reads "chore: switch license from MIT to Elastic License 2.0 (ELv2)", and the body opens with the ELv2 Limitations clause.

What context-mode does, before we get to the paperwork

The problem context-mode attacks is genuine and badly under-served. Every MCP tool call dumps its raw result into the conversation, and the results are enormous: the project's own README puts a Playwright snapshot at 56 KB, twenty GitHub issues at 59 KB, a single access log at 45 KB. Half an hour of real work and a large slice of the window is gone.

context-mode answers this more interestingly than "summarise the output". It sandboxes tool results so the raw bytes never enter the conversation, then indexes session events into SQLite with FTS5 and retrieves only what matches via BM25 when the agent compacts. There are eleven MCP tools, six of them sandbox operations like ctx_execute and ctx_index, the rest diagnostics such as ctx_doctor and ctx_stats.

If the underlying problem is new to you, our piece on how context engineering actually works for agents covers the ground this project is building on. The design idea worth stealing, licence aside, is the one the README calls "think in code": instead of reading fifty files into the window to count something, the agent writes a script that counts and prints only the answer. Their example goes from forty-seven Read() calls at 700 KB down to one ctx_execute() at 3.6 KB. That is a real technique and you can apply it today without installing anything.

A context window is only worth protecting if the session survives
Stretching a session from thirty minutes to three hours assumes the machine underneath stays awake for three hours. MoClaw is a hosted cloud AI computer running a Claude agent that keeps going when your laptop doesn't, sitting alongside your local setup rather than replacing it.
See the Claude integration

The Hacker News thread for context-mode: "MCP server that reduces Claude Code context consumption by 98%", 570 points and 107 comments, submitted by mksglu.
The Hacker News thread for context-mode: "MCP server that reduces Claude Code context consumption by 98%", 570 points and 107 comments, submitted by mksglu.

The relicense landed eight days after launch

Here are the two dates, both from the repository's own history. The first release, v0.4.0, was committed on February 23, 2026. On March 3, 2026 a commit titled "chore: switch license from MIT to Elastic License 2.0 (ELv2)" replaced the licence file.

The Hacker News thread that pushed the project to 20,000 stars is dated roughly six months ago, which puts it in the same few weeks as the switch. I can't establish from public data whether the front page came before or after the commit, so I won't claim it did either way. What is certain is that a large share of the people who starred, forked or vendored this repository in its first fortnight were looking at an MIT badge.

Worth knowing if you did: an MIT grant already made can't be withdrawn. Code released under MIT stays MIT for the version it was released in, so a fork taken from the February tree carries different terms from one taken today. Everything committed after March 3 is ELv2. That is a general property of how licences work rather than advice about your situation, and if this affects a shipping product it is a question for a lawyer, not a blog.

The GitHub API is no help here, incidentally. It reports the licence as NOASSERTION, which is what it returns for anything outside its recognised list. Any tool in your supply chain that reads that field sees "unknown" rather than "restricted", so an automated licence scan can pass a repository like this without comment.

What ELv2 actually forbids

Elastic License 2.0 is short, readable and not an open source licence by the OSI definition. The project's homepage nonetheless labels itself "open-source plugin" and puts "OSS" above the words "ELV2 LICENSE" in its statistics row. Both halves of that are doing work: the source really is public and readable, and the licence really does fail the OSI criteria on field-of-use restriction. If your procurement process treats "open source" as a category with legal meaning, the badge will not survive contact with it. Three limitations sit at the centre of it, and the first is the one with teeth:

You may not provide the software to third parties as a hosted or managed service where that service gives users access to any substantial set of the software's features. You may not move, change, disable or circumvent licence key functionality. You may not alter or obscure the licensing and copyright notices.

For an individual developer running context-mode against their own Claude Code sessions, none of this bites. Internal company use is fine too. What it stops is building a product on top of it: if you were planning to offer managed agent infrastructure with this compression baked in as a feature your customers touch, that is the exact activity the limitation names.

The licence key clause deserves a second look, because it implies the software either has or expects gated functionality. The repository doesn't advertise a paid tier, but the project's own site does: alongside the free plugin sits Context Mode Platform at $20 per seat per month, pitched as an organisation layer over the same engine that shows managers what their team is doing with the AI tools they already run. Read the licence and the price list together and the March relicense stops looking arbitrary. ELv2 exists precisely to let a company publish source while reserving the hosted business for itself, and that is what happened here.

The context-mode homepage on September 8, 2026. The stats row reads "OSS / ELV2 LICENSE" beside "#1 ON HACKER NEWS", and the two cards split a free plugin from Context Mode Platform at $20 per seat per month.
The context-mode homepage on September 8, 2026. The stats row reads "OSS / ELV2 LICENSE" beside "#1 ON HACKER NEWS", and the two cards split a free plugin from Context Mode Platform at $20 per seat per month.

What the install actually gets permission to do

Licence aside, there is a second thing worth reading before you install context-mode, and it is the hook list.

On Claude Code the plugin registers PreToolUse, PostToolUse, UserPromptSubmit, PreCompact, SessionStart and Stop. That is every lifecycle event the client exposes. It has to be, because the whole design depends on catching tool output before it reaches the window and on writing session state at the right moments; you can't do interception halfway. But be clear about what you're agreeing to: a piece of software with a hook on UserPromptSubmit sees every prompt you type, and one with PostToolUse sees every result your agent gets back. It also writes a SQLite database of your file edits, git operations, tasks, errors and decisions to disk.

None of that is hidden and none of it is unusual for this category; the same reach is what makes Claude skills and agent workflows powerful, and worth auditing. The README is upfront that session data is deleted unless you pass --continue. Still, the reach is total, and the answer to "what is the blast radius if this project's npm package is ever compromised" is "everything that passed through your coding agent". Pin the version and read the diff when you upgrade.

This is one of the arguments for keeping agent work on a machine that isn't the one holding your production credentials and your personal SSH keys. Running an agent inside a hosted environment like MoClaw puts a real process boundary between the tooling you're evaluating and the things you'd rather not hand it, which is a cheaper safeguard than auditing every hook a plugin installs.

Hook-capable clients get this enforcement automatically. The platforms without hooks, which is most of the seventeen, rely on a routing file copied into the project instead, and a routing rule is a request rather than a guarantee. context-mode's own documentation notes that one unrouted command dumps 56 KB straight into the window. On those clients the compression figure is a ceiling, not a floor.

The 98% figure, and what it counts

Take the headline as the project's claim rather than an independent finding, because that's what it is. The README describes 315 KB of raw tool output becoming 5.4 KB, which is where the 98% comes from.

The number is not dishonest, but read what it measures. It compares raw tool output against sandboxed output for the same operations. It is not a benchmark of task success, code quality or how often the agent needed the bytes it no longer has. The claim that sessions which used to stall after thirty minutes now run for three hours is a report of the author's experience, not a controlled result.

The README does one thing here I wish more projects copied: it explicitly refuses to enforce a terse output style, and cites Moonshot AI's report that aggressive brevity prompts degrade coding and reasoning benchmarks as the reason. A project that turns down an easy compression win because it might hurt the model's answers has thought about the failure mode.

One detail the enthusiastic coverage skips. Near the top of the README sits a row of company badges under the caption "Used across teams at": Microsoft, Google, Meta, Amazon, NVIDIA, Stripe, Notion, Cursor and about nine more.

Every one of those badges is wrapped in href="#". There is no case study, no testimonial, no link. For a tool with over 20,000 stars the claim is plausible on its face, since engineers at big companies install things. It is also completely unevidenced, and presenting it as a logo wall borrows the visual grammar of a customer list. Treat it as decoration.

That is not a reason to avoid context-mode. It is a reason to weight the README's other unbacked numbers the same way.

So should you install it?

Install context-mode if you are an individual or a team using it internally, and if you have read the licence first. The context problem it targets is the most annoying limitation of long agent sessions, and the sandboxing approach is better than the summarisation most alternatives reach for.

No, or at least not without counsel, if what you are building is a service other people log into. The hosted-service limitation is not ambiguous.

There is a third option people forget, which is to take the idea and skip the dependency. Routing bulky tool output through a script that prints only the answer needs no MCP server, and it works on any agent that can execute code. If you use a hosted environment such as MoClaw, where the machine running the agent stays up between sessions, most of what context-mode's session-continuity layer rebuilds after a compaction is simply still there in the running environment; the two solve overlapping problems from different directions, and they cost different things.

If you're assembling a toolchain rather than picking one tool, our running list of the skills worth installing is a better starting point than a star count. Whatever you choose, pin a version. A project that changed licence once, at eight days old, can change it again.

FAQ

Is context-mode open source?

No, not under the OSI definition. It moved from MIT to Elastic License 2.0 on March 3, 2026. The source is public and you may read, modify and use it, but the licence restricts offering it to third parties as a hosted service.

Is context-mode free?

The plugin is free to install and run on your own machine. There is also a paid product: Context Mode Platform, listed on the project's site at $20 per seat per month, which adds an organisation layer over the same engine. The ELv2 restriction on hosted services and the existence of that platform are the same fact viewed from two sides.

Does it work with Claude Code and Codex?

Yes. The project lists seventeen supported platforms, with Claude Code installed through the plugin marketplace and hook-capable clients getting automatic routing. Clients without hook support need a one-time routing file copied in by hand.

What does "98% compression" actually mean?

It is the project's own measurement of raw tool output versus sandboxed output, quoted as 315 KB becoming 5.4 KB. It says nothing about task success rates, and no third party has reproduced it.

Can my company use context-mode internally?

Internal use is permitted by ELv2. The restriction applies to providing the software to third parties as a hosted or managed service. If your product would expose its functionality to your own customers, get that reviewed.

Repository facts, star counts and commit dates in this article were pulled from the GitHub API on September 8, 2026.

Continue Reading

M
MoClaw Editorial MoClaw editorial team

The MoClaw editorial team writes about workflow automation, AI agents, and the tools we build. Default byline for industry overviews, listicles, and collaborative pieces.

Turn insights into action.

MoClaw automates the recurring work your analysis points to. No engineering required.

context-mode license context-mode elastic license is context-mode free context-mode mcp reduce claude code context

References: https://github.com/mksglu/context-mode · https://github.com/mksglu/context-mode/blob/main/LICENSE · https://news.ycombinator.com/item?id=47193064 · https://context-mode.com · https://www.elastic.co/licensing/elastic-license