Open-source plugin **context-mode** cuts AI programming costs down to 2%

The MCP plugin **context-mode**, which topped GitHub and Hacker News, reduces AI programming token consumption by 98% through dynamic context management and extends model memory from 30 minutes to 3 hours. It has already been adopted by teams from Microsoft, Google, ByteDance, Cursor, and others.
An MCP Plugin That Cuts API Bills Down to 2%
If you’ve recently been worrying about your Cursor or Claude Code bills, or just ran a long task halfway through only to find the model forgot all the APIs it had written earlier—chances are you’ve already heard the name context-mode.
This open-source MCP plugin, developed by a small multinational team, first shot to the top of GitHub Hacker News last month, and by this week (as of June 9, 2026) its GitHub stars have surpassed 15k, with over 243k developers integrating it. The team’s figures are bold: in AI programming scenarios, context-mode can reduce token consumption by 98%, effectively bringing costs down to just 2% of the original; at the same time, it extends the model's "effective memory span" from about 30 minutes to 3 hours.
These two numbers alone aren’t novel—there are plenty of tools on the market for context compression. But being able to achieve both at once inside a single MCP plugin, and adapt it to 15 platforms, is still a rare engineering feat.

What Problem Does It Actually Solve?
To understand why context-mode became popular, you have to go back to the daily life of developers in the Vibe Coding era.
Over the past year, fully automated AI programming agent frameworks like "Lobster" have made the development barrier extremely low—you describe a requirement, the agent automatically breaks down the tasks, writes code, runs tests, and opens PRs. Sounds great, until you see the month-end API bill.
The problems lie in two areas:
- Token Black Hole: Every time an automated agent runs a cycle, it stuffs the entire conversation history, tool invocation results, and relevant file contents into the context. For a medium-sized project, it’s normal for a single task to consume millions of tokens. Even though top models like Claude Sonnet and GPT series are dropping token prices, this kind of consumption will drain a monthly plan within days.
- Model Memory Loss: No matter how large the context window, there’s always a limit; beyond 100K tokens, attention drops noticeably. A common scenario: in the morning, you have the model refactor the auth module; in the afternoon, you ask it to connect a new API, but it has already forgotten the middleware signatures from the morning, introducing all sorts of mismatched types.
context-mode’s approach isn’t to expand the context window, but to do the opposite—make the content entering the window as concise and relevant as possible. It inserts a “context router” layer between the agent and the model, performing vector indexing and semantic slicing on the project’s code, conversation, and tool invocation results, only feeding the model the fragments truly relevant to the current task.
This is a typical application of the MCP (Model Context Protocol). When Anthropic released MCP last year, the community’s first reaction was “just another tool invocation spec,” but plugins like context-mode demonstrate MCP’s real value lies in the “context layer”: it provides third parties a standard interface to control what the model sees and how much it sees.
Technical Implementation
From the open-source repository, context-mode’s core modules can be roughly divided into three layers:
1. Semantic Slicing and Indexing Layer
Instead of simply splitting by file or function, it combines AST structure and call relationships to produce “semantic units.” A class’s method definition, invocation locations, and related type declarations are bound into a minimal comprehensible unit. Thus, upon retrieval, the model isn’t receiving isolated code snippets but “fragment bundles” with upstream/downstream relationships.
2. Dynamic Memory Compression
This is the key to extending “memory” from 30 minutes to 3 hours. context-mode performs layered summarization of conversation history: recent rounds are kept verbatim, older content is gradually compressed into structured notes by importance, and the oldest content preserves only “decision summaries” (e.g., “auth module uses JWT, expiration time 2 hours”). When the model asks related questions, finer-grained content is recalled from deeper layers.
This method is somewhat similar to MemGPT’s approach, but context-mode makes it an MCP plugin, meaning any MCP-compatible client—Claude Desktop, Cursor, Cline, Continue—can use it directly without modifying the agent framework.
3. Context Budget Scheduler
Developers can set token budgets per project, e.g., “no more than 50K tokens per task.” The scheduler adjusts the number and compression level of recalled fragments dynamically based on task complexity. This layer is the most direct source of the “cost reduction of 98%”—most of the time, the model doesn’t need to see the entire project; the agent framework just isn’t doing enough filtering.
The Team: A Small Squad Working Asynchronously Across 4 Countries
Behind context-mode is a classic open-source “light team.” Core members are spread across Turkey, France, and two other countries, collaborating asynchronously via GitHub issues and PRs, with no formal office.
Founder Mert Köseoğlu is Turkish, a former OpenAI technical advisor with over ten years of full-stack and systems architecture experience, having worked as a senior engineer at SaaS companies like Countly, Planhat, and JotForm. In his Hacker News project introduction, he bluntly stated: “I’m sick of paying thousands of dollars for Claude every month.”
Another core developer, Sun Yicheng, is the Chinese face in the team, currently a sophomore responsible for multi-platform adaptation. He previously independently developed the Temporal-RAG (temporal data retrieval augmented) engine, won a silver medal at Zhihu’s global A2A hackathon, was shortlisted for China’s elite “Strong Foundation” program, and ranked top 18 provincially in mathematics—a classic teenage geek trajectory.
This kind of team structure is very era-specific: four time zones, five or six people, producing a foundational plugin used by R&D teams at Microsoft, Google, Meta, ByteDance, and Cursor.
How Effective Is It Really?
That 98% figure sounds almost too good, naturally making people wonder if it’s cherry-picked extreme cases. I checked GitHub issues and Reddit feedback, and actual community testing is roughly in this range:
- For small-to-medium projects (10–50K lines of code), daily AI programming token consumption dropped by 85%–95%, consistent with marketing claims;
- For large monorepos (over 100K lines), reductions are 70%–90%, though initial indexing is slower;
- In rare purely exploratory tasks (e.g., letting AI freely develop a new module), savings are minimal or even slightly increased—due to the extra routing overhead.
The “memory extended from 30 minutes to 3 hours” claim is fuzzier, since different models and tasks inherently have different “forgetting points.” But community examples show that during long-running tasks (e.g., full project refactoring, multi-file linked debugging), models indeed maintain consistency longer, and consensus on this is fairly strong.
Will It Become the Next Piece of Infrastructure?
Notably, context-mode is not alone. Recently, projects like Claude Context topping GitHub Trending, and MCP tools like Context7 and sequential-thinking, all aim to solve the same problem—making models see more relevant content with fewer tokens.
The engineering significance of this has been underestimated. In the past two years, everyone has focused on the models themselves: more parameters, bigger windows, stronger reasoning. But in actual production, what often determines whether AI programming can be sustained is this “context engineering” layer. A model, however strong, produces nothing if fed irrelevant content; a less capable model can perform better if fed precisely.
context-mode abstracts this layer into a protocol-based plugin, which means it has the potential to become a standard component in the AI programming toolchain—like webpack in frontend, nginx in backend: invisible most of the time, but without it the whole system runs poorly.
Incidentally, Chinese developers trying context-mode shouldn’t ignore the model side: context-mode saves tokens, but token unit prices and access stability also affect final costs. Platforms like OpenAI Hub already unify GPT, Claude, Gemini, DeepSeek, and other models behind a single key, compatible with the OpenAI format and directly accessible domestically; pairing this with context-mode lets you “save tokens” and “save scheduling costs” at the same time.
What to Watch Next
In the short term, the context-mode team’s roadmap mentions several points:
- Switching semantic indexing from Tree-sitter to a self-developed incremental parser to further reduce initial index-building time;
- Supporting shared team contexts to avoid redundant index building in collaborative work;
- Launching a hosted version for small teams that don’t want to run their own vector databases.
In the long term, the more interesting question is: When context engineering is standardized and pluginified, how will model vendors respond? If a third-party plugin alone can cut token usage by 98%, the “pay-per-usage” logic that large model companies rely on will be under pressure. Even Anthropic, when pushing MCP, may not have fully anticipated the ecosystem evolving in this direction.
This is quite a story to watch: a tiny team, with a protocol and an abstraction layer, rewriting the cost structure of AI programming. Next, let’s see who reacts first.
References
- Awesome-MCP-ZH Curated Resources - GitHub: Chinese MCP ecosystem resource compilation, showing other context-related plugins besides context-mode.
- Claude Context Open Source Project - Zhihu: Technical analysis of similar projects, useful for understanding dynamic context management.



