tokenade
GitHubenfr
Install

Context-mode Alternatives: 6 Tools Compared

Six context-mode alternatives for AI coding agents, ranked on measured session cost, what they keep out of the context window, setup weight and licence, with the honest limits of each.

TL;DR — Tokenade is the context-mode alternative to pick if you want a lower bill: it is the only tool on the open THOL benchmark that measurably cut session cost, while context-mode has not been measured there. lean-ctx is the closest open-source swap, rtk the simplest shell filter, serena cuts reads with symbol-level navigation, caveman works on the reply side and ccusage only meters spend.

Profile photo of Paul Irolla

By Paul Irolla

Founder · AI & developer tools · Tokenade

Ph.D. in AI · builds token-optimization tooling for AI agents

View author page
11 min read
Cite this page

What should you use instead of context-mode?

If you want the bill to go down, use Tokenade: it is the only one of the twelve tools in the open THOL benchmark that measurably lowered what a session costs. context-mode is not in that benchmark, so nobody has a session-cost number for it yet.

If you want an open-source toolkit in the same spirit, lean-ctx is the closest swap.

context-mode is one of the most thoughtful projects in this space. Mert Koseoglu built it as an MCP server and a Claude Code plugin that runs tool calls in a sandbox, so raw output never reaches the context window. It had about 29,600 GitHub stars when I checked, and it ships updates constantly.

It does more than sandboxing:

  • 11 MCP tools. Six sandbox tools (ctx_batch_execute, ctx_execute, ctx_execute_file, ctx_index, ctx_search, ctx_fetch_and_index) and five meta tools (ctx_stats, ctx_doctor, ctx_upgrade, ctx_purge, ctx_insight).
  • 12 language runtimes in the sandbox, from JavaScript and Python to Go, Rust and C#.
  • A per-project SQLite FTS5 knowledge base for indexed output, searched with BM25.
  • Session continuity. Edits, git operations, tasks and errors are logged, then retrieved after compaction or --continue instead of replayed.
  • Six Claude Code hooks: PreToolUse, PostToolUse, UserPromptSubmit, PreCompact, SessionStart and Stop.

The reasons people look elsewhere are specific:

  • The licence. It is Elastic License 2.0: source-available, not open source. You can use it for free, including at work, but you cannot offer it to others as a hosted service.
  • Claude Code gets the best of it. The README lists about 17 platforms, but slash commands are a Claude Code plugin feature, and some hosts lack the hooks that enforce routing.
  • The model has to call the ctx_* tools. Routing instructions nudge it there; a plain Read or Bash call is a different path.
  • The headline number has a scope. More on that below.

Disclosure before the ranking: I maintain the THOL benchmark and I build Tokenade. The benchmark is public and reproducible, and it includes results that don't flatter my tool, but it is not an independent third party.

Features read on each project's GitHub README on 2026-10-15. Session-cost figures come from the published THOL campaign (Claude Code 2.1.206, Claude Sonnet 4.6, long sessions), the only one this site quotes.

The short list

ToolWhat it isEntry priceBest for
TokenadeA binary between your agent and its tools: output filtering, file-read trimming, script execution, code search, MCP foldingFree, open source (MIT/Apache-2.0)A measured drop in session cost
lean-ctxA Rust context toolkit: ctx_* MCP tools, read cache, shell compression, session memoryFree locally, paid enterprise controlsThe closest open-source swap
rtkA Rust proxy that filters shell command outputFree (Apache-2.0 + BUSL-1.1 engine)The simplest shell filter
serenaAn MCP toolkit that drives real language serversFree (MIT + GPL-3.0)Reading symbols instead of whole files
cavemanA Node CLI: terse output voice plus read-side compressionFree (Apache-2.0)The reply side, which context-mode leaves alone
ccusageA CLI that reads local transcripts and reports spendFree, open sourceSeeing the numbers, not changing them

How we picked

Five criteria, applied identically to every entry including mine:

  • Measured session cost. End to end, against a no-tool control, from THOL. Where a tool isn't in the campaign, the table says "Not measured" and any vendor figure stays in prose, attributed, with its scope.
  • What it keeps out of context. Shell output, file reads, MCP results, fetched pages or the model's own replies.
  • Does the model have to opt in? A hook that sees every tool call, or special tools the model must choose.
  • Fixed cost per session. Tool definitions and instructions are re-sent at every step, so a tool set has to earn its keep.
  • Licence and where data goes. Open source, source-available or proprietary; local or hosted.

1. Tokenade — the one measured to lower session cost

Tokenade is the strongest context-mode alternative on the criterion that matters most: it is the only tool of the twelve in the open benchmark that measurably reduced what a session costs.

  • What it is: a binary between your AI agent and its tools. It filters every tool's output, trims file reads to structure first, folds MCP results and runs on-device code search, with a savings dashboard.
  • Strengths: on long sessions it makes a session 39% cheaper than the agent on its own. It works through the agent's hooks, so ordinary reads, searches and commands are covered without the model choosing a special tool.
  • The context-mode ideas, in another shape: tokenade execute runs a script and hands back only what it prints. Oversized output is folded into a local stash the agent can query with tokenade expand-ref <hash> --prompt "…", described in the compaction docs.
  • Limitations: it's my product, so weight this accordingly. It keeps no event log of your session to rebuild after compaction, which is context-mode's most distinctive feature.
  • Best for: anyone who wants the bill to move, on more than one AI agent. The attribute view is on Tokenade vs context-mode.

2. lean-ctx — the closest open-source swap

lean-ctx is the context-mode alternative if you liked the toolkit approach and want it under a mostly open-source licence.

  • What it is: a Rust binary working on two planes. On the read path, an MCP server exposes ctx_* tools (read modes, caching, deltas, search, memory) beside a shell hook. On the wire path, an opt-in local proxy can trim prompts, history and tool results.
  • Strengths: the widest feature surface in open source, with session memory like context-mode's. It is unusually candid about its own overhead and ships a command to measure it.
  • Limitations: no measurable difference in THOL. A large MCP tool set carries a fixed cost every session. The licence is mixed: an Apache-2.0 core, with some modules under commercial source-visible terms.
  • Best for: tinkerers in large, shell-heavy repos. The full field is on lean-ctx alternatives.

3. rtk — the simplest shell filter

rtk is the context-mode alternative if noisy command output was the only reason you installed it, and you want the least possible setup.

  • What it is: a Rust CLI proxy with 100+ command-specific filters and a transparent hook.
  • Strengths: the easiest install in this category (brew, curl or cargo), no MCP tool set to carry, and rtk gain shows per-command savings. The hook is transparent, so the model doesn't need to pick a special tool.
  • Limitations: no measurable difference in THOL. It sees shell commands only, not the agent's file reads, fetched pages or MCP results. The default build ships its compression engine under BUSL-1.1, next to an Apache-2.0-only rtk-oss edition.
  • Best for: build-heavy and test-heavy sessions. See rtk alternatives.

4. serena — read less by reading symbols

serena is the context-mode alternative if the waste you saw came from the agent reading whole files to find one function.

  • What it is: an MCP toolkit giving the agent IDE-like retrieval, editing and refactoring at the symbol level, through language servers for over 40 languages. Installed with uv tool install -p 3.13 serena-agent.
  • Strengths: references, renames and type hierarchy come from the same engine your IDE uses, so the agent fetches the symbol, not the file. No index to rebuild.
  • Limitations: code only. It does nothing for command output or fetched pages. Not in the published THOL campaign, so not measured. The licence is split: MIT for the language-server layer, GPL-3.0-or-later for the application.
  • Best for: large typed codebases. See Tokenade vs serena.

5. caveman — the side context-mode deliberately skips

caveman is the context-mode alternative if your complaint is how much the agent writes, not how much it reads.

  • What it is: a Node CLI (npx @caveman-ai/cli@latest, Node 22.13+) that bundles a terse output voice, read-side compression of logs, JSON, CSV and test output, a model picker and smaller fixes. Apache-2.0.
  • Strengths: context-mode's README says it never dictates how the model writes, and cites research that aggressive brevity prompts can hurt reasoning. caveman takes the opposite bet. Its README cites a JetBrains paired A/B on 86 coding tasks that found no measurable quality loss.
  • Limitations: the published THOL campaign shows no measurable difference for caveman, and I haven't re-measured version 4.0. The voice isn't to everyone's taste.
  • Best for: people who find agent replies padded. See caveman alternatives.

6. ccusage — if you mostly watched ctx_stats

ccusage is the context-mode alternative if what you used was the visibility, and you'd rather see real spend than an estimate of savings.

  • What it is: a CLI usage meter that reads your agents' local JSONL transcripts and reports spend by day, week, month, session and Claude's 5-hour billing blocks.
  • Strengths: zero install with npx, nothing in the agent's path, and the spend it shows comes from your own transcripts.
  • Limitations: zero token reduction. It is a thermometer, not a thermostat, and it has no team dashboard like context-mode's hosted Insight.
  • Best for: checking whether anything you install actually moves the bill. See ccusage alternatives.

At a glance

ToolMeasured session cost (THOL)Keeps out of contextModel has to opt in?Licence
Tokenade39% cheaper on long sessionsAll tool output, file reads, MCP, fetched pagesNo, hooksFree, open source (MIT/Apache-2.0)
lean-ctxNo measurable differenceReads, shell output, MCP resultsPartly, ctx_* tools plus a shell hookApache-2.0 core + commercial modules
rtkNo measurable differenceShell output onlyNo, hookApache-2.0 + BUSL-1.1
serenaNot measuredWhole-file readsYes, its MCP toolsMIT + GPL-3.0
cavemanNo measurable differenceReply verbosity, some readsNoApache-2.0
ccusageNot a reducerNothingNoOpen source
context-mode (baseline)Not measuredSandboxed tool output, fetched pages, session eventsYes, ctx_* tools, steered by hooksElastic License 2.0
Change in the cost of a long session, compared with the agent on its own
Change in the cost of a long session, compared with the agent on its own
Tokenade
measurably cheaper
-39%
caveman
no measurable difference
-13.6%
lean-ctx
no measurable difference
+10.3%

7 long tasks (over 200,000 tokens), 70 runs per tool, Claude Code 2.1.206 with Claude Sonnet 4.6. “No measurable difference”: the gap is within the run-to-run noise. context-mode is not in this campaign. Source: THOL, 2026.

The full table, including the tools that don't favour mine, is on the THOL explainer.

What does context-mode's 98% actually measure?

It measures how much smaller one tool's output gets, not what a whole session costs. context-mode advertises a 98% reduction, illustrated in its README by 315 KB of raw output becoming 5.4 KB once it goes through the sandbox.

That example is real, and keeping 315 KB out of the window is genuinely useful. But it describes the slice of traffic the sandbox touches. A long session also pays for history re-sent at every step, the tool definitions, the model's replies and every read that doesn't go through a ctx_* tool.

In THOL's no-tool runs, nine tokens out of ten are conversation history re-sent at every step. A 98% cut on one slice can be a much smaller cut on the bill, and nobody has published a paired session-cost measurement for context-mode yet. I'd like to see one; until then it stays "Not measured" on this page.

Is the session memory worth keeping context-mode for?

It can be, if your sessions regularly compact and you lose the thread. No other tool in this list rebuilds the agent's working state from a log of edits, tasks and errors.

Two details from its README matter here. Indexed content lives in a per-project SQLite database under ~/.context-mode/content/. And if you don't resume with --continue, previous session data is deleted immediately, so a fresh session starts clean.

If that continuity is the feature you rely on, staying is reasonable. Judge the cost side separately: measure the bill with and without it.

Which one should you choose?

  • You want the bill to go down, on more than one AI agent: Tokenade.
  • You want the toolkit approach under a mostly open licence: lean-ctx.
  • Shell output is your only problem: rtk.
  • Your agent reads whole files to find one symbol: serena.
  • The agent's replies are what feels bloated: caveman.
  • You only wanted to see the numbers: ccusage.
  • You're staying on context-mode: reasonable for long Claude Code sessions that compact often, and if the Elastic License 2.0 fits how you use it. Watch your provider's bill, not only ctx_stats.

Tokenade is free and open source (MIT/Apache-2.0). Setup takes two commands; see the install guide.

FAQ

Is context-mode free?

Yes to use, including at work. It is licensed under the Elastic License 2.0, which makes it source-available rather than open source: the main restriction is that you cannot offer it to others as a hosted or managed service. Check the licence before building a product on top of it.

Does context-mode reduce token usage?

It keeps raw tool output out of the window on the calls that go through its sandbox, and it advertises a 98% reduction on that output, with a 315 KB to 5.4 KB example. It is not in the published THOL campaign, so its effect on whole-session cost has not been measured.

Which agents does context-mode support?

Its README lists about 17 platforms, including Claude Code, Cursor, Codex CLI, OpenCode, Copilot and Antigravity. Hook-capable platforms get automatic routing; the others need a routing file copied once. Slash commands are a Claude Code plugin feature. It needs Node.js 22.5 or later, or Bun.

Can I use context-mode and Tokenade together?

You can, but they overlap: both intercept tool output through hooks, so the two savings counters stop meaning much. If you keep context-mode for its session memory, measure your provider's bill before and after rather than trusting either counter.


See also:

FAQ

Cut your AI agent's token bill.

Ranked #1 on the Token-Harness Optimizer Leaderboard. Zero config.

Tokenade cuts the token bill of AI agents: one install, zero config, and it trims what your agent sends to the model.