All articles
Dev ToolsBy Petru Popa · 6 min read

context-mode Trims Claude Code Token Usage. Its Last Release Was June 29.

Claude Code token usage in a long session grows with tool output. Claude Code sends the full conversation with every request, so every page snapshot, log file and issue list an agent pulls in rides along with each later one. context-mode is an MCP server and hook set built to keep that output out of the context window, and it has 22,046 GitHub stars. Four issues filed on September 9 alone show people installing it now.

Read the repository, not the README: its release pipeline has not moved since June 29.

What it does for Claude Code token usage

context-mode intercepts tool calls and runs them in a sandbox, so a 56 KB Playwright snapshot reaches the model as 299 bytes instead of the raw dump. It also records session events in SQLite, so that after the agent compacts its conversation a resume snapshot can restore which files and tasks were in flight.

The README advertises 98%. The repository's BENCHMARK.md shows that is the subtotal for 14 execution scenarios, 315 KB of raw output reduced to 5.5 KB. Across all 21 scenarios the figure is 96%, and the seven knowledge-retrieval scenarios alone come to 82%. The unit is bytes kept out of context, not task success or dollars billed. It also has a boundary: the one scenario with a 0.4 KB input, Playwright network requests, saved 13%. If your agent's tool results are already short, expect little.

The problem you would otherwise hand-roll

Anthropic's cost documentation for Claude Code describes the same mechanism as a native pattern. A PreToolUse hook can rewrite a test command so only failures come back, and the page cites a log-filtering hook cutting context from tens of thousands of tokens to hundreds. It also recommends running /context to see what is consuming space.

So the real choice is not context-mode or nothing. It is a dependency that enforces routing across 17 agent platforms, or a hook you own for the one or two tools that actually flood your sessions.

The history, read through the GitHub API on September 11:

  • Releases. 195 in total, 77 of them in March and 12 in June, then nothing after 1.0.169 on June 29. The npm registry agrees: 1.0.169, published the same day, is the latest version.
  • Commits. 120 on main since that release, every one from github-actions[bot] with the message ci: update install stats. A workflow runs every six hours and commits stats.json whenever it changes.
  • Pull requests. 110 open, 100 of them opened after June 29. The most recent merge was June 24.
  • Issues. 120 open. Of the 100 most recent comments on issues and pull requests, spanning July 9 to September 10, one came from the owner account, on July 13.

The README's last-commit badge currently reads yesterday, in green. It is measuring the stats bot. On this repository the maintenance badge and the maintenance have come apart, and a dependency screen that reads the badge or the star count will score it as active. Nothing in the repository says why human activity stopped.

The fixes exist; they are queued. Issue #1022, open since August 1, reports that the resume snapshot the precompact hook advertises as under 2 KB ignores its byte budget. The source confirms it: the maxBytes option in src/session/snapshot.ts carries a comment saying it is kept for backward compatibility but ignored. PR #1123, a fix, has been open since September 5.

Issue #1141, filed September 9, reports that the debug script the bug template tells you to paste into a public issue captures config files with secrets intact. The script has a broad redaction function, but its config-file capture applies only three patterns of its own: sk- keys, and postgres and mongodb connection strings. A SONAR_TOKEN in a settings.json env block passes through unless its value happens to match one of those shapes. PR #1144, opened September 10, addresses it.

Issue #1142, filed the same day, reports that the plugin's own PreToolUse hook injects a cwd into shell calls and drops the permission decision, so an allow-listed tool prompts every time. That is the pattern we describe in why enterprise AI doesn't ship: the 96% is the demo, and the failures sit in integration, where the tool meets your permission model and your secrets.

License: read the file, not the API

The LICENSE file is the Elastic License 2.0, and package.json declares Elastic-2.0. GitHub's license API reports the key as other and the SPDX identifier as NOASSERTION, because GitHub detects licenses by matching the file against a short list of known ones with the Licensee gem. A scanner that trusts GitHub's field sees an unknown license; one that reads package.json sees Elastic-2.0. The license permits use, modification and redistribution, but bars offering the software to third parties as a hosted or managed service exposing a substantial set of its features.

Who should not use it

  • Hosted agent products that would expose its features to customers: the use the license carves out.
  • Teams that need fixes to ship on a schedule: the #1022 patch has waited since September 5.
  • Teams rolling it out as shared infrastructure. Deciding which agent tooling becomes a team dependency and which stays a hook someone owns is core to our AI agent development work.

An individual developer with large tool outputs can still pin 1.0.169 and use it; read #1141 before running the debug script.

The central claim: context-mode is a useful mechanism behind a stalled release pipeline, and as of September 11 the right call is to pin it or replace the one mechanism you need with a hook, not to roll it out as team infrastructure. This is wrong if a release after 1.0.169 ships, or if PRs #1123 and #1144 merge; either would show the queue moving again.

Check any agent dependency this way

REPO=mksglu/context-mode
SINCE=$(gh api repos/$REPO/releases/latest --jq .published_at)
gh api -X GET repos/$REPO/commits -f since=$SINCE -f per_page=100 --paginate --jq '.[] | .author.login // .commit.author.name' | sort | uniq -c
gh pr list -R $REPO --state merged --limit 1 --json mergedAt --jq '.[0].mergedAt'
gh api repos/$REPO/license --jq .license.spdx_id

On September 11 this printed 120 github-actions[bot], 2026-06-24T12:12:58Z and NOASSERTION. The threshold we use: if every commit since the latest release is a bot and the last merge is more than 60 days old, treat the project as unmaintained. Pin the exact version, vendor it, or replace it, and run /context before and after to confirm the replacement saves what you expected.

Ready to start?

Turn this into a plan for your team.

One week, fixed fee: a working session with your team, a prioritized use-case backlog, and an ROI model for the opportunities worth chasing.

Book an AI Opportunity Sprint