mksglu/context-modePublic

Free, local plugin that keeps tool output out of your coding agent's context window. Sandbox and SQLite FTS5 search, 99% fewer bytes in context. Works with Claude Code, Codex, Pi, OMP, OpenCode, Gemini CLI, Copilot CLI and 4 more agents. Zero telemetry.

AI summary: A persistent context management framework that helps AI agents retain architectural knowledge across sessions.

Stars
34.3K
+170 today
Forks
2.4K
Watchers
109
Open issues
13
Open PRs
0
Contributors
~111
Commits
4.7K
Branches
1
Views (30d)
11

JavaScriptOtherCreated Feb 23, 2026Last push 2d agoLatest release v2.2.0+357 stars this week+3K this month

Quick answers

What is context-mode?
A persistent context management framework that helps AI agents retain architectural knowledge across sessions.
What does context-mode do?
Claude Context Mode is a conceptual framework and toolset designed to solve the context memory problem for large language models like Claude. It establishes strategies for effectively managing and maintaining critical context, ensuring that models retain architectural patterns across long AI sessions. Rather than starting from scratch on every run, developers can structure project data to maximize model comprehension and enforce routing via tools like MCP. It provides token optimization techniques to prune irrelevant history so the agent focuses exclusively on critical snippets. This framework allows engineers to inject proprietary conventions into the agent's memory without polluting global context.
Who is context-mode for?
Software engineers and teams relying on Claude Code for complex, context-heavy coding tasks. It requires familiarity with agentic workflows and context window constraints.
How do I get started with context-mode?
npm i -g @anthropic-ai/claude-code
How popular is context-mode on GitHub?
mksglu/context-mode has 34,310 stars and 2,358 forks on GitHub, and gained 357 stars in the last 7 days.
What license does context-mode use?
mksglu/context-mode is released under the Other license.

Star history

since Jul 29, 2026
010K20K30KJul 2026Sep 2026Oct 2026Nov 2026
34.3K stars as of Nov 19, 2026. Measured daily since Jul 29, 2026; GitHub no longer exposes earlier star timestamps.

Update history

6 recorded
  • Nov 15, 2026New release v2.2.0 (previously v2.1.0).
  • Nov 15, 2026Description changed from "Free, local plugin that keeps tool output out of your coding agent's context window. Sandbox and SQLite FTS5 search, 99%" to "Free, local plugin that keeps tool output out of your coding agent's context window. Sandbox and SQLite FTS5 search, 99%".
  • Nov 5, 2026New release v2.1.0 (previously v1.0.169).
  • Nov 5, 2026Primary language changed from TypeScript to JavaScript.
  • Nov 5, 2026Description changed from "Context window optimization for AI coding agents. Sandboxes tool output (98% reduction), persists session memory, and " to "Free, local plugin that keeps tool output out of your coding agent's context window. Sandbox and SQLite FTS5 search, 99%".
  • Oct 4, 2026Previously tracked as mksglu/claude-context-mode; its 1 daily snapshot and 1 trending appearance were merged into this profile. Stars: 19,432 on 2026-07-29 under the old name, 25,014 on 2026-10-02 (+5,582).

Contribution activity

commits per day, last 52 weeks
NovDecJanFebMarAprMayJunJulAugSepOctNovMonWedFri2025-11-23: 0 commits2025-11-24: 0 commits2025-11-25: 0 commits2025-11-26: 0 commits2025-11-27: 0 commits2025-11-28: 0 commits2025-11-29: 0 commits2025-11-30: 0 commits2025-12-01: 0 commits2025-12-02: 0 commits2025-12-03: 0 commits2025-12-04: 0 commits2025-12-05: 0 commits2025-12-06: 0 commits2025-12-07: 0 commits2025-12-08: 0 commits2025-12-09: 0 commits2025-12-10: 0 commits2025-12-11: 0 commits2025-12-12: 0 commits2025-12-13: 0 commits2025-12-14: 0 commits2025-12-15: 0 commits2025-12-16: 0 commits2025-12-17: 0 commits2025-12-18: 0 commits2025-12-19: 0 commits2025-12-20: 0 commits2025-12-21: 0 commits2025-12-22: 0 commits2025-12-23: 0 commits2025-12-24: 0 commits2025-12-25: 0 commits2025-12-26: 0 commits2025-12-27: 0 commits2025-12-28: 0 commits2025-12-29: 0 commits2025-12-30: 0 commits2025-12-31: 0 commits2026-01-01: 0 commits2026-01-02: 0 commits2026-01-03: 0 commits2026-01-04: 0 commits2026-01-05: 0 commits2026-01-06: 0 commits2026-01-07: 0 commits2026-01-08: 0 commits2026-01-09: 0 commits2026-01-10: 0 commits2026-01-11: 0 commits2026-01-12: 0 commits2026-01-13: 0 commits2026-01-14: 0 commits2026-01-15: 0 commits2026-01-16: 0 commits2026-01-17: 0 commits2026-01-18: 0 commits2026-01-19: 0 commits2026-01-20: 0 commits2026-01-21: 0 commits2026-01-22: 0 commits2026-01-23: 0 commits2026-01-24: 0 commits2026-01-25: 0 commits2026-01-26: 0 commits2026-01-27: 0 commits2026-01-28: 0 commits2026-01-29: 0 commits2026-01-30: 0 commits2026-01-31: 0 commits2026-02-01: 0 commits2026-02-02: 0 commits2026-02-03: 0 commits2026-02-04: 0 commits2026-02-05: 0 commits2026-02-06: 0 commits2026-02-07: 0 commits2026-02-08: 0 commits2026-02-09: 0 commits2026-02-10: 0 commits2026-02-11: 0 commits2026-02-12: 0 commits2026-02-13: 0 commits2026-02-14: 0 commits2026-02-15: 0 commits2026-02-16: 0 commits2026-02-17: 0 commits2026-02-18: 0 commits2026-02-19: 0 commits2026-02-20: 0 commits2026-02-21: 0 commits2026-02-22: 0 commits2026-02-23: 26 commits2026-02-24: 40 commits2026-02-25: 22 commits2026-02-26: 4 commits2026-02-27: 1 commit2026-02-28: 4 commits2026-03-01: 58 commits2026-03-02: 21 commits2026-03-03: 30 commits2026-03-04: 16 commits2026-03-05: 47 commits2026-03-06: 24 commits2026-03-07: 16 commits2026-03-08: 4 commits2026-03-09: 2 commits2026-03-10: 14 commits2026-03-11: 4 commits2026-03-12: 2 commits2026-03-13: 32 commits2026-03-14: 22 commits2026-03-15: 16 commits2026-03-16: 34 commits2026-03-17: 7 commits2026-03-18: 6 commits2026-03-19: 34 commits2026-03-20: 25 commits2026-03-21: 23 commits2026-03-22: 7 commits2026-03-23: 4 commits2026-03-24: 11 commits2026-03-25: 7 commits2026-03-26: 1 commit2026-03-27: 2 commits2026-03-28: 19 commits2026-03-29: 5 commits2026-03-30: 1 commit2026-03-31: 2 commits2026-04-01: 2 commits2026-04-02: 50 commits2026-04-03: 30 commits2026-04-04: 32 commits2026-04-05: 20 commits2026-04-06: 1 commit2026-04-07: 1 commit2026-04-08: 2 commits2026-04-09: 2 commits2026-04-10: 2 commits2026-04-11: 2 commits2026-04-12: 1 commit2026-04-13: 47 commits2026-04-14: 44 commits2026-04-15: 3 commits2026-04-16: 5 commits2026-04-17: 2 commits2026-04-18: 2 commits2026-04-19: 2 commits2026-04-20: 1 commit2026-04-21: 3 commits2026-04-22: 3 commits2026-04-23: 3 commits2026-04-24: 2 commits2026-04-25: 63 commits2026-04-26: 34 commits2026-04-27: 10 commits2026-04-28: 15 commits2026-04-29: 1 commit2026-04-30: 2 commits2026-05-01: 2 commits2026-05-02: 49 commits2026-05-03: 21 commits2026-05-04: 27 commits2026-05-05: 3 commits2026-05-06: 3 commits2026-05-07: 12 commits2026-05-08: 9 commits2026-05-09: 39 commits2026-05-10: 83 commits2026-05-11: 57 commits2026-05-12: 89 commits2026-05-13: 27 commits2026-05-14: 45 commits2026-05-15: 20 commits2026-05-16: 3 commits2026-05-17: 8 commits2026-05-18: 24 commits2026-05-19: 18 commits2026-05-20: 23 commits2026-05-21: 2 commits2026-05-22: 2 commits2026-05-23: 7 commits2026-05-24: 24 commits2026-05-25: 7 commits2026-05-26: 4 commits2026-05-27: 2 commits2026-05-28: 2 commits2026-05-29: 4 commits2026-05-30: 2 commits2026-05-31: 43 commits2026-06-01: 28 commits2026-06-02: 19 commits2026-06-03: 14 commits2026-06-04: 3 commits2026-06-05: 4 commits2026-06-06: 34 commits2026-06-07: 11 commits2026-06-08: 1 commit2026-06-09: 3 commits2026-06-10: 4 commits2026-06-11: 3 commits2026-06-12: 16 commits2026-06-13: 5 commits2026-06-14: 3 commits2026-06-15: 1 commit2026-06-16: 4 commits2026-06-17: 2 commits2026-06-18: 2 commits2026-06-19: 2 commits2026-06-20: 1 commit2026-06-21: 30 commits2026-06-22: 12 commits2026-06-23: 6 commits2026-06-24: 4 commits2026-06-25: 6 commits2026-06-26: 26 commits2026-06-27: 0 commits2026-06-28: 0 commits2026-06-29: 3 commits2026-06-30: 2 commits2026-07-01: 2 commits2026-07-02: 2 commits2026-07-03: 2 commits2026-07-04: 2 commits2026-07-05: 1 commit2026-07-06: 1 commit2026-07-07: 2 commits2026-07-08: 2 commits2026-07-09: 1 commit2026-07-10: 2 commits2026-07-11: 2 commits2026-07-12: 1 commit2026-07-13: 1 commit2026-07-14: 2 commits2026-07-15: 2 commits2026-07-16: 2 commits2026-07-17: 2 commits2026-07-18: 2 commits2026-07-19: 1 commit2026-07-20: 1 commit2026-07-21: 2 commits2026-07-22: 2 commits2026-07-23: 2 commits2026-07-24: 2 commits2026-07-25: 2 commits2026-07-26: 1 commit2026-07-27: 1 commit2026-07-28: 2 commits2026-07-29: 2 commits2026-07-30: 2 commits2026-07-31: 2 commits2026-08-01: 2 commits2026-08-02: 1 commit2026-08-03: 1 commit2026-08-04: 2 commits2026-08-05: 2 commits2026-08-06: 1 commit2026-08-07: 1 commit2026-08-08: 2 commits2026-08-09: 2 commits2026-08-10: 2 commits2026-08-11: 2 commits2026-08-12: 2 commits2026-08-13: 2 commits2026-08-14: 2 commits2026-08-15: 1 commit2026-08-16: 2 commits2026-08-17: 2 commits2026-08-18: 2 commits2026-08-19: 1 commit2026-08-20: 1 commit2026-08-21: 1 commit2026-08-22: 2 commits2026-08-23: 2 commits2026-08-24: 2 commits2026-08-25: 1 commit2026-08-26: 2 commits2026-08-27: 1 commit2026-08-28: 2 commits2026-08-29: 1 commit2026-08-30: 2 commits2026-08-31: 2 commits2026-09-01: 1 commit2026-09-02: 1 commit2026-09-03: 2 commits2026-09-04: 1 commit2026-09-05: 1 commit2026-09-06: 1 commit2026-09-07: 1 commit2026-09-08: 1 commit2026-09-09: 1 commit2026-09-10: 2 commits2026-09-11: 2 commits2026-09-12: 2 commits2026-09-13: 2 commits2026-09-14: 1 commit2026-09-15: 2 commits2026-09-16: 1 commit2026-09-17: 2 commits2026-09-18: 1 commit2026-09-19: 1 commit2026-09-20: 1 commit2026-09-21: 1 commit2026-09-22: 2 commits2026-09-23: 1 commit2026-09-24: 1 commit2026-09-25: 1 commit2026-09-26: 2 commits2026-09-27: 2 commits2026-09-28: 1 commit2026-09-29: 1 commit2026-09-30: 2 commits2026-10-01: 2 commits2026-10-02: 2 commits2026-10-03: 2 commits2026-10-04: 3 commits2026-10-05: 2 commits2026-10-06: 1 commit2026-10-07: 2 commits2026-10-08: 1 commit2026-10-09: 2 commits2026-10-10: 2 commits2026-10-11: 3 commits2026-10-12: 2 commits2026-10-13: 1 commit2026-10-14: 166 commits2026-10-15: 120 commits2026-10-16: 11 commits2026-10-17: 106 commits2026-10-18: 97 commits2026-10-19: 179 commits2026-10-20: 85 commits2026-10-21: 149 commits2026-10-22: 153 commits2026-10-23: 98 commits2026-10-24: 111 commits2026-10-25: 92 commits2026-10-26: 91 commits2026-10-27: 176 commits2026-10-28: 85 commits2026-10-29: 38 commits2026-10-30: 69 commits2026-10-31: 23 commits2026-11-01: 49 commits2026-11-02: 28 commits2026-11-03: 39 commits2026-11-04: 17 commits2026-11-05: 30 commits2026-11-06: 9 commits2026-11-07: 6 commits2026-11-08: 19 commits2026-11-09: 1 commit2026-11-10: 1 commit2026-11-11: 69 commits2026-11-12: 34 commits2026-11-13: 24 commits2026-11-14: 60 commits2026-11-15: 13 commits2026-11-16: 0 commits2026-11-17: 0 commits2026-11-18: 0 commits2026-11-19: 0 commits2026-11-20: 0 commits2026-11-21: 0 commits
4,308 commits in the last yearLessMore

Signals and awards

derived from tracked data
  • Widely adopted

    34,310 stars

  • Very active

    4,308 commits in 52 weeks

  • Community-driven

    ~111 contributors

  • Continuous integration

    Automated checks passing

What context-mode does

Claude Context Mode is a conceptual framework and toolset designed to solve the context memory problem for large language models like Claude. It establishes strategies for effectively managing and maintaining critical context, ensuring that models retain architectural patterns across long AI sessions. Rather than starting from scratch on every run, developers can structure project data to maximize model comprehension and enforce routing via tools like MCP. It provides token optimization techniques to prune irrelevant history so the agent focuses exclusively on critical snippets. This framework allows engineers to inject proprietary conventions into the agent's memory without polluting global context.

Software engineers and teams relying on Claude Code for complex, context-heavy coding tasks. It requires familiarity with agentic workflows and context window constraints.

  • Context Structuring: Defines approaches for organizing project data to maximize a language model's comprehension.
  • Session Memory: Implements strategies to maintain and recall crucial architectural details across long AI coding sessions.
  • Token Pruning: Automatically optimizes the context window by pruning irrelevant conversational history to preserve limits.
  • Workflow Integration: Designed to support the complex routing and integration needs common in enterprise organizations.
  • Claude Optimization: Specifically tailored to align with Anthropic's Claude and its contextual processing behaviors.

Where teams use it

Large Codebase Navigation

Engineers apply the guidelines to feed repository structures into Claude effectively without losing critical context.

Extended Debugging

Developers maintain a coherent thread of errors and previous decisions across long debugging sessions.

Convention Enforcement

Teams inject internal documentation into Claude's context to ensure generated code matches specific architectural norms.

Context Window Management

Users prune irrelevant history to ensure Claude focuses on critical snippets within token limits.

Getting started: npm i -g @anthropic-ai/claude-code

README

main branch

Context Mode

A free, local plugin for 11 coding agents. It keeps tool output out of your agent's context window and keeps all usage data on your machine. The plugin is free forever.

npm downloads GitHub stars Discord License: ELv2

34K GitHub stars · 835K npm downloads (read 2026-11-15, stats.json) · on the Hacker News front page and GitHub Trending: charts and sources

The Context Mode plugin is free and local, with its source open on GitHub. Context Mode Gateway is a separate hosted service with its own account and subscription. It takes the same idea from tool output to the whole conversation: Gateway Recall keeps long sessions searchable, and Gateway Memory shares what your agents learn across sessions and tools. See how the Gateway works

Context Mode plugin: free and local, zero telemetry, the plugin keeps your data on your machine. Bench of 2026-11-01: 99.4% of output bytes saved (median of 36 rows with 10 KB or more of raw output). A full debugging session (row g-session-total): 281,261 B raw to 3,266 B in context, about 70K to 817 tokens (an estimate at 4 B per token). Resume after compaction (row e-long-session): a 442,893 B transcript to a 2,019 B block, about 111K to 505 tokens (an estimate). Runs in 10 coding agents with 9 MCP tools.

Contents: Why · Adoption · Install · Try it · Use cases · Benchmarks · How it works · Tools · Security and privacy · Context Mode Gateway · License · Community

Why

A coding agent reads files, runs commands and fetches pages, and every result goes into its context window. The Context Mode plugin runs that work in a local sandbox, keeps the full output in a SQLite index on your machine, and gives the agent the part it asks for.

  • The plugin is free forever. Use it at home and at work, free of charge, under a source-available license.
  • Runs on your machine. The hooks, the sandbox and search run as local processes next to your agent.
  • The plugin keeps your data on your machine. Every index lives in ~/.context-mode: one context.db per project.
  • Zero telemetry. The plugin keeps all usage data on your machine. Security and privacy lists each network call it makes.
  • Works offline after install. Sandbox runs, file indexing and search use local SQLite and your own runtimes.
  • Code Mode. The agent writes a short script instead of reading the data, and only what the script prints reaches the context: see How it works, step 5.
  • Small replies. On the 36 bench rows with 10 KB or more of raw output, the plugin's median reply is 99.4% smaller than the raw output.

Adoption: stars and npm downloads

Line chart of cumulative GitHub stars for mksglu/context-mode since 2026-02-23. A daily job redraws it. Area chart of npm downloads per day for context-mode, the last 90 days. A daily job redraws it.

Open the interactive chart and point at a bar to read its value. Tabs there show days, weeks, months and years. Stars come from the GitHub GraphQL API (starredAt); npm downloads come from api.npmjs.org/downloads/range. The total up to 2026-10-29 is 683K npm downloads (stats.json keeps a daily copy). A daily job redraws both charts.

  • Hacker News. "MCP server that reduces Claude Code context consumption by 98%" reached the front page with 570+ points and 107 comments on 2026-02-28 (thread).
  • GitHub Trending. A bot that watches GitHub Trending logged the repo there on 14 days from 2026-04-24 to 2026-10-17 (uibm/trending-watcher).
Companies that stargazers of mksglu/context-mode name in their GitHub profile, Microsoft, Tencent, Alibaba, ByteDance, Google and more.

Starred by engineers at these companies: each name is the company field of 2 or more stargazer profiles, read with the GitHub GraphQL API on 2026-11-01 (data).

Install

Pick your agent: Claude Code · Codex · Gemini CLI · Qwen Code · Pi · OMP · OpenCode · Copilot CLI · Kiro · VS Code · ZCode

Open its block and copy its own install command. Each block also holds the update, check and remove steps, and the Install guide walks through them.

The plugin needs Node 24.15.0 or later, from the engines field in package.json. On Windows, add Git for Windows: the shell tools run in Git Bash, and doctor checks for it. contextmode installs as the npm package and command context-mode. Claude Code, Codex, Gemini CLI and Qwen Code install from GitHub, and each of their commands names the release branch.

Claude Code
claude plugin marketplace add mksglu/context-mode
claude plugin install context-mode@context-mode
# update
claude plugin update context-mode@context-mode
# check
claude plugin list
# remove
claude plugin marketplace remove context-mode

Hooks ✓ (package) · MCP ✓ · Skills ✓

Codex
codex plugin marketplace add mksglu/context-mode
codex plugin add context-mode@context-mode
# one-time step: trust the plugin hooks
npm i -g context-mode
context-mode setup --agents codex
# update
codex plugin marketplace upgrade context-mode
# check
codex mcp list
# remove
codex plugin remove context-mode@context-mode

Hooks ✓ (hook file) · MCP ✓ · Skills ✓

Gemini CLI
gemini extensions install https://github.com/mksglu/context-mode
# update
gemini extensions update context-mode
# check
GEMINI_CLI_TRUST_WORKSPACE=true gemini mcp list
# remove
gemini extensions uninstall context-mode

Hooks ✓ (package) · MCP ✓ · Skills ✓

Qwen Code
qwen extensions install https://github.com/mksglu/context-mode:context-mode
# update
qwen extensions update context-mode
# check
qwen extensions list
# remove
qwen extensions uninstall context-mode

Hooks ✓ (package) · MCP ✓ · Skills ✓

Pi
pi install npm:context-mode
# update
pi update --extensions
# check
pi list
# remove
pi remove npm:context-mode

Hooks ✓ (the plugin's own event handlers) · MCP ✓ (ctx tools built into the plugin) · Skills ✓

OMP
omp plugin install context-mode
# update
omp plugin upgrade context-mode
# check
omp plugin list
# remove
omp plugin uninstall context-mode

Hooks ✓ (the plugin's own event handlers) · MCP ✓ (ctx tools built into the plugin) · Skills ✓

OpenCode
opencode plugin add context-mode
# update
opencode plugin update
# check
opencode mcp list --pure          # OpenCode 1.19
opencode mcp list --standalone    # OpenCode 2
# remove
opencode plugin remove context-mode

Hooks ✓ (the plugin's own event handlers) · MCP ✓ · Skills ✓

Copilot CLI
npm i -g context-mode
context-mode setup --agents copilot-cli
# update
context-mode upgrade
# check
context-mode doctor --agents copilot-cli
copilot mcp list
# remove
context-mode setup --remove --agents copilot-cli

Hooks ✓ (hook file) · MCP ✓ · Skills ✓

Kiro
npm i -g context-mode
context-mode setup --agents kiro
# update
context-mode upgrade
# check
context-mode doctor --agents kiro
# remove
context-mode setup --remove --agents kiro

Hooks ✓ (hook file) · MCP ✓ · Skills ✓

VS Code (Copilot)
npm i -g context-mode
context-mode setup --agents vscode
# update
context-mode upgrade
# check
context-mode doctor --agents vscode
# remove
context-mode setup --remove --agents vscode

Hooks ✓ (hook file) · MCP ✓ · Skills ✓

ZCode
zcode plugins marketplace add mksglu/context-mode
zcode plugins install context-mode@context-mode
# update
zcode plugins update context-mode@context-mode
# check
zcode plugins list
# remove
zcode plugins uninstall context-mode@context-mode

Hooks ✓ (hook file) · MCP ✓ · Skills ✓

The npm route works for every agent:

npm i -g context-mode
context-mode setup

Setup is also the repair. It shows a plan, saves your earlier config, then applies the plan; when a step ends early, it restores the saved config. To uninstall:

context-mode setup --remove
npm rm -g context-mode

Restart the agent, then run /ctx-doctor in it. Each check prints PASS or a fix command, and the Doctor guide explains each check.

How we tested the install

Every agent gets hooks, the MCP server and the plugin skills; the last line of each block above says how. Hooks reach each agent in one of three ways: in the plugin package (Claude Code, Gemini CLI, Qwen Code), in a hook file (Codex, Copilot CLI, Kiro, VS Code, ZCode), or in a plugin inside the agent (OpenCode, Pi, OMP). The Agents guide shows what each agent runs. We ran the real binary of each agent with the plugin hook: Claude Code, Codex, Gemini CLI, Qwen Code, Pi, OpenCode, Copilot CLI and ZCode. Each run used a clean temp home and a local test model, on 2.0.0-next.15. OMP 18.20.0 ran the same way with ADR-0026, and CI installs the real OMP on Linux, macOS and Windows. For VS Code and Kiro, the check covers the hook setup: VS Code runs the hook command with the documented payload, and kiro-cli 2.35.2 loads all 6 hook entries. CI runs setup, doctor, a hook and an MCP handshake for all 11 agents from the packed package on Linux, macOS and Windows. Record: HOOKS-FIRE.md. Each agent uses its own install command, and ADR-0023 says why.

Your first task with the plugin, step by step: First session. Or paste a prompt from Try it right now.

Try it

Paste one of these prompts into your agent after the install. Each one ran once, live, in Claude Code 2.1.312, and its answer matched the source data (evidence and rerun steps). The headline numbers in Benchmarks use the median of 5 runs. Other agents do the same job with the same tools: ctx_execute, ctx_index and ctx_search. After a prompt, run the stats skill and read the report yourself (See the saving).

On https://react.dev/reference/react/useEffect, show me the example that connects to a chat server and cleans up, and list the rules for the dependency array.

The hook sends WebFetch to the sandbox, and the agent searches the page for the example and the rules. 601,984 B raw, 20,860 B reached the context, 96.5% saved (2026-11-02, 2.0.0-next.26, claude-haiku-5-5).

Fetch https://jsonplaceholder.typicode.com/photos. Which photo has the longest title (give its id and title), and how many photos have a title that contains the word "est"?

The agent runs code over 5,000 JSON records in the sandbox and gets back two answers. 1,039,898 B raw, 393 B reached the context, 99.96% saved (2026-11-02, 2.0.0-next.26, claude-haiku-5-5). The answer is two short facts, so this is the best case of the four.

Here is a Linux syslog sample: https://raw.githubusercontent.com/logpai/loghub/master/Linux/Linux_2k.log. How many authentication failures does it contain, and which 3 remote hosts caused the most?

The agent counts failures in a 1,999-line syslog in the sandbox. 216,485 B raw, 566 B reached the context, 99.7% saved (2026-11-02, 2.0.0-next.26, claude-haiku-5-5).

What are the top 10 stories on the Hacker News front page right now? Give title, points and domain for each.

The hook sends WebFetch to the sandbox, and the agent reads ten stories from the page. 35,087 B raw, 1,501 B reached the context, 95.7% saved (2026-11-02, 2.0.0-next.26, claude-haiku-5-5). The front page changes, so the raw size changes with each run.

See the saving

Run the stats skill right after a prompt. Each agent uses its own command; the skill calls ctx_stats and shows its report unchanged.

Agent Command
Claude Code /ctx-stats
Codex $ctx-stats
Copilot CLI /ctx-stats
Gemini CLI Call ctx_stats and show me the report.
Kiro Call ctx_stats and show me the report.
OMP /skill:ctx-stats
OpenCode Call ctx_stats and show me the report.
Pi /skill:ctx-stats
Qwen Code Call ctx_stats and show me the report.
VS Code (Copilot) /ctx-stats
ZCode Call ctx_stats and show me the report.

The first lines of a real report, after the JSON prompt above ran as one ctx_execute call:

context-mode stats
────────────────────────────────────────────────────────────────────────────────

This session · 1 call · <1m active
  1015.5 KB became 3.7 KB: 1011.8 KB kept out (99.6%)
  Without context-mode |████████████████████████████████████████|  1015.5 KB
  With context-mode    |█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░|     3.7 KB
  about 259K tokens kept out, 1.3 times a 200K window

Captured 2026-11-03 with 2.0.0-next.35: release-out/server.mjs over MCP in a temp HOME.

Next, the same numbers for 20 real tools, in Use cases.

Use cases

Real tool output from public projects, run through Context Mode. Bench of 2026-11-01 on 2.0.0-next.23 (commit 16a4bcc5), median of 5 runs.

What you do Tool Raw Reaches the context Saved
Read a browser page Chrome DevTools MCP take_snapshot, Code Mode 136,514 B 463 B 99.7%
List 40 issues GitHub CLI gh issue list --json, Code Mode 182,943 B 850 B 99.5%
List 25 pull requests with checks GitHub CLI gh pr list --json, Code Mode 195,471 B 776 B 99.6%
Look up library docs Context7 query-docs, Code Mode 6,917 B 473 B 93.2%
Run 1,106 tests Vitest vitest run --reporter=verbose, Code Mode 62,909 B 429 B 99.3%
Lint a source folder Biome biome lint --reporter=json, Code Mode 288,523 B 577 B 99.8%
Install a workspace pnpm pnpm install --frozen-lockfile, Code Mode 14,988 B 199 B 98.7%
Install packages npm npm install --loglevel http, Code Mode 37,761 B 435 B 98.8%
Read container logs Docker docker logs, Code Mode 60,374 B 587 B 99.0%
Plan 72 resources Terraform terraform plan, Code Mode 34,081 B 166 B 99.5%
Read 300 commits with file stats git git log --stat, Code Mode 164,385 B 268 B 99.8%
Read an 89 KB source file Read, sent to ctx_execute by the hook 91,362 B 375 B 99.6%
Fetch a 265 KB docs page WebFetch, sent to ctx_index and ctx_search 271,731 B 439 B 99.8%
Fetch a 214 KB API reply curl in Bash, replaced after it runs 219,175 B 291 B 99.9%
Print a 187 KB git log in Bash Bash, output replaced after it runs 191,120 B 204 B 99.9%
Print the same git log through a host tool Host tool output over the cap, indexed whole 191,120 B 2,842 B 98.5%
Print a 214 KB GitHub API reply through a host tool Host tool output over the cap, indexed whole 219,175 B 4,060 B 98.1%
Read a 45 KB log file Read, sent to ctx_execute by the hook 46,216 B 371 B 99.2%
Read a 60 KB source file Read, sent to ctx_execute by the hook 61,576 B 374 B 99.4%
Debug for a full session: 8 outputs, 3 searches All hooks and tools 281,261 B 3,266 B 98.8%

Source: bench/results/2026-11-01-darwin-arm64.json, one row per line; SOURCE.md names where each input comes from. Click a task to open its case: the command, the input file with its sha256, and the run command, so you can run the same row on your machine.

The agent gets the part it asks for. The full output stays in the local index, and ctx_search reads it back. Rows with a command run in the sandbox; the agent then finds the rest with search. The Context7 row has 6,917 B of raw output, under the 10 KB line of the headline rule, so the headline leaves it out.

Next, how the bench counts these bytes, in Benchmarks.

Benchmarks

Bar chart: median output bytes saved per category for rows of 10 KB or more. Sandbox 99.5%, Batch 93.1%, Externalize 98.3%, Hook redirect 99.8%, Session total 98.8%. The table below adds Retrieval, 77.2%.

Rule for every headline number in this README: rows with 10 KB or more of raw output, median of 5 runs per row, measured with ctx_bytes against raw_bytes; a category is the median of its rows; 1 KB = 1,024 B. All 36 such rows, the six categories below: the plugin keeps a median of 99.4% of output bytes out of the context. Bench on 2.0.0-next.23 (commit 16a4bcc5 and the local edits that the file records), macOS arm64, 2026-11-01.

Category What runs Rows Median saved
a. Sandbox ctx_execute on a file or command 19 99.5%
b. Retrieval ctx_search over the local index 3 77.2%
c. Batch ctx_batch: many commands, then search 2 93.1%
d. Externalize Host tool output over the cap, indexed whole 4 98.3%
f. Hook redirect A big Read, curl or WebFetch sent to the sandbox 7 99.8%
g. Session total One full scripted session 1 98.8%

Search replies (category b) carry the matching text, so they save 77.2%. Category e (long sessions) is in Longer sessions. The full file lists every row, small ones too: 2026-11-01-darwin-arm64.md. Reproduce with cd bench && node run.mjs. It needs plain Node and runs offline; bench/README.md lists each scenario and its options. Method, data files and rerun steps: Benchmarks guide.

Longer sessions

A session grows, the context stays small. The PreToolUse hook sends a tool call to ctx_execute or ctx_index; the full output goes into context.db and a small reply returns. At compaction a snapshot keeps the state, and ctx_resume and ctx_search read it back.

Say you debug a slow test all afternoon. The agent reads files, runs the suite and fetches docs, and each result goes into the context window. When the window is full, the host compacts it, and from then on the agent sees a short summary plus your next message.

Context Mode keeps the full output of each large tool call in context.db on your machine and gives the agent a small reply. At compaction, a snapshot of at most 2,048 B keeps the session state. After the compaction, the agent calls ctx_resume to read that snapshot back and ctx_search to find any earlier output by keyword.

In the bench, a scripted session of 40 tool outputs and one compaction made a 442,893 B transcript, and the ctx_resume block that brought the agent back was 2,019 B (row e-long-session in the bench file; open the case). In the same bench, one large log of 666,796 B put 3,380 B into the context, and the full log stayed in the index for ctx_search (row d-synth-1m; open the case). How the snapshot picks what to keep: the Long sessions guide and ADR-0009.

Speed

Median of 5 runs, bench of 2026-11-01.

Measure Result
Hook time over a bare node start, per agent 7.5 ms to 12.3 ms
ctx_search, 20 queries over 8 indexed files 1.62 ms median, 6.70 ms max
ctx_index, 3 real files, 625,649 B 150 ms per MB

Source: rows g-hook-kiro to g-hook-claude-code, g-search-latency and g-index-per-mb of the bench file, with every agent and query. The overhead cases show how each one runs.

Next, what happens inside one tool call, in How it works.

How it works

One tool call, step by step: the agent runs a tool, the PreToolUse hook denies a big Read and names the ctx_execute call, the MCP server runs it in the sandbox, SQLite FTS5 keeps the output, and after compaction a state block of at most 2,048 B comes back.

One tool call, in time order, from the install to a hook error.

  1. Install. Each agent's own install command adds the MCP server, the hooks and the skills ctx-doctor, ctx-stats and ctx-upgrade to that agent's config folder, for example ~/.codex/skills/<name>/SKILL.md. context-mode setup writes or repairs any part the native command leaves out (ADR-0023).

  2. Session start. The SessionStart hook opens the project database. When the session ran before, the agent gets one line that tells it to call ctx_resume (dispatch.ts).

  3. PreToolUse checks. Before a tool runs, the PreToolUse hook checks the call in a fixed order: the user's deny list, WebFetch, curl and wget, inline HTTP and build commands, then a full-file Read over OUTPUT_CAP (16,384 B) and one-file shell dumps such as cat or tail. A Read with a line range runs as usual (decide.ts).

  4. The exact call. When a check matches, the hook stops the call and its reply names the exact ctx_* call to use, for example ctx_execute with {"language":"shell","code":"<the command>","intent":"<what you need>"}. For WebFetch the reply names ctx_index, then ctx_search (read-deny.ts).

  5. The sandbox. This is the Code Mode step: the agent's script runs here, and only what it prints comes back. ctx_execute writes the script to a temp folder and spawns the runtime from an argument list in the project folder. The timeout is EXEC_TIMEOUT_MS (600,000 ms, default and maximum); on timeout it stops the whole process group (taskkill /F /T on Windows). The child gets your environment minus preload variables such as NODE_OPTIONS, and the agent gets what the script prints, at most OUTPUT_CAP (execute.ts). Code Mode. The agent sends a short script as a tool parameter, the script reads the data in the sandbox, and only what it prints goes into the context. Two real calls, in the form the Claude Code terminal shows them:

    ctx_execute on 5,000 JSON records, from the Claude Code 2.1.312 stream of the Try-it run with Context Mode 2.0.0-next.26 (04-api-json.json). The data is 1,039,898 B; the agent gets 254 B.

    ⏺ context-mode - ctx_execute (MCP)(language: "javascript", c…jsonplaceholder.typicode.com/photos\");
      if (!res.ok) throw new Error(\"HTTP \" + res.status);
      const photos = await res.json();
      let longest = null;
      for (const p of photos) {
        if (!longest || p.title.length > longest.title.length) longest = p;
      }
      const withEst = photos.filter(p => p.title.includes(\"est\")).length;
      const ties = photos.filter(p => p.title.length === longest.title.length).map(p => p.id);
      console.log(JSON.stringify({ total: photos.length, longest…nd count of titles containing \"est\"")
      ⎿  exit 0 · 239 B
         {
           "total": 5000,
           "longest": {
             "id": 653,
             "title": "temporibus commodi et fugit doloremque re…rit exercitationem necessitatibus aut",
             "length": 86
           },
           "longestTieIds": [
             653
           ],
           "titlesContainingEst": 892
         }
    

    ctx_batch on an install log and a long git log, one live MCP call to release-out/server.mjs of Context Mode 2.0.0-next.36 on 2026-11-03 (2026-11-03-ctx-batch.json). The commands print 228,881 B; the agent gets 8,667 B, the parts that match its two queries, and the full output stays in the index.

    ⏺ context-mode - ctx_batch (MCP)(commands: ["cat npm-install… queries: ["cache miss","feat commit"])
      ⎿  ## cache miss
         js.org/@esbuild%2fwin32-x64 282ms (cache miss)
         npm http fetch GET 200 https://registry.npmjs.org/@esbuild%2flinux-s390x 79ms (cache miss)
         npm http fetch GET 200 https://registry.npmjs.org/@esbuild%2fopenbsd-x64 101ms (cache miss)
         npm http fetch GET 200 https://registry.npmjs.org/@esbuild%2fwin32-arm64 99ms (cache miss)
         npm http fetch GET 200 https://registry.npmjs.org/@esbuild%2fdarwin-arm64 99ms (cache miss)
         … +95 lines (ctrl+o to expand)
    
  6. Indexing. The full output goes into the index in chunks of at most MAX_CHUNK_BYTES (4,096 B). A Markdown chunk stays inside one heading section, and a code block that fits stays whole. Each chunk goes into two SQLite FTS5 tables: a Porter-stemmed table for words and a trigram table for paths, names and parts of words (fts.ts).

    ctx_index on a copy of this repo's docs/how-it-works.md, one live MCP call to release-out/server.mjs of Context Mode 2.0.0-next.36 on 2026-11-03 (calls.json). The file is 11,577 B; the agent gets 64 B.

    ⏺ context-mode - ctx_index (MCP)(path: "how-it-works.md")
      ⎿  Indexed 1 source(s), 17 chunk(s) from s1. Label: how-it-works.md
    
  7. Search. ctx_search ranks each table with BM25 and joins the two lists with Reciprocal Rank Fusion: a hit scores 1/(RRF_K + rank), with RRF_K = 60. Before it returns an empty list, it tries a spelling fix from the indexed words. Search covers this session, this worktree (the default) or the whole project, and each snippet is at most SNIPPET_MAX_BYTES (800 B) (search.ts).

    ctx_search on that index, in the same run, in a project that also holds an AGENTS.md. One search reads the index and every agent's memory files. The agent gets 1,268 B: one content hit and one memory hit, each with its source and heading. For memory shared across machines, agents and sessions, see Context Mode Gateway Memory.

    ⏺ context-mode - ctx_search (MCP)(queries: ["compaction state block"])
      ⎿  Query "compaction state block":
         how-it-works.md #14: ### Session continuity
         
         The hooks log each prompt, edit, command, tool error, i…e same rows always give the same bytes.
         memory AGENTS.md #0: # Agent rules
         … +10 lines (ctrl+o to expand)
    
  8. Run, then replace. On hosts that run the tool first, the PostToolUse hook checks the result. Output over REPLACE_TRIGGER_BYTES (4,096 B) goes into the index whole, and the agent gets the best-matching chunks and one ctx_search line for the rest (dispatch.ts).

  9. Journal and compaction. The hooks log each prompt, edit, command, tool error and decision in a journal. After a compaction the agent gets a state block of at most STATE_BUDGET (2,048 B), and each long line becomes a ctx_resume(seq) pointer to the full row; one ctx_resume reply is at most RESUME_CAP (2,048 B). On the next prompt, a prompt-match block brings back the journal rows that match it by BM25 (ADR-0009).

    ctx_resume with empty parameters returns the state block, in the same run: 209 B.

    ⏺ context-mode - ctx_resume (MCP)()
      ⎿  <context_mode_state session="mcp:85e67fa2-28ef-45eb-9d5b-a967129b74c0" upto="2">
         indexed how-it-works.md
         source s1: how-it-works.md (11536 B)
         more: ctx_search(queries:[], scope:"session")
         </context_mode_state>
    
  10. The database. Each project has one context.db under ~/.context-mode, in Node's built-in node:sqlite. The database runs in WAL mode and runs a PASSIVE checkpoint on close. A new database gets built under a temp name and moves into place in one atomic step, and the busy timeout is DB_TIMEOUT_MS (5,000 ms) (db.ts).

  11. A hook error. A hook always ends with exit 0. On any error it gives the host's allow reply and writes one log line to ~/.context-mode/hook-errors.log, so your agent keeps working. A spawned hook has HOOK_TIMEOUT_MS (5,000 ms) (fallback.ts).

Every number with its reason: How it works. The rules the hook follows: ADR-0008. Next, the Tools the agent calls.

Tools

Tool What it does
ctx_execute Runs code or a shell command in a sandbox; returns what it prints
ctx_batch Runs many commands, indexes the output, and searches it in one call
ctx_index Indexes a file, a text or a URL into the project database
ctx_search Searches the local index; returns the matching parts
ctx_resume Returns the plugin's local state block (at most 2,048 B), or one full row by seq
ctx_stats Shows how much output stayed out of context
ctx_doctor Checks the install; each check prints PASS or a fix command
ctx_upgrade Installs, upgrades or uninstalls; replaces old contextmode entries
ctx_purge Deletes indexed data by session, source or project

Three more real calls, from the same live run of Context Mode 2.0.0-next.36 on 2026-11-03 (calls.json).

ctx_stats: the agent gets 3,097 B, the first line is the summary.

⏺ context-mode - ctx_stats (MCP)()
  ⎿  ctx_stats: 82.5% kept out all-time, 82.5% this session.
     … +59 lines (ctrl+o to expand)

ctx_doctor after context-mode setup --agents claude-code: 862 B, one row per check.

⏺ context-mode - ctx_doctor (MCP)()
  ⎿  Environment: context-mode 2.0.0-next.36 (8facf27), agent claude-code 0 (client r20-live)
     Environment: darwin-arm64, Node v26.8.1, shell /bin/zsh
     | Check | Status | Detail | Fix |
     |---|---|---|---|
     | D1 version | PASS | 2.0.0-next.36 (8facf27): ahead of next on npm (2.0.0-next.34) |  |
     | D2 node | PASS | ok |  |
     … +11 lines (ctrl+o to expand)

ctx_purge deletes one source: 66 B.

⏺ context-mode - ctx_purge (MCP)(source: "how-it-works.md")
  ⎿  ctx_purge: deleted 18 rows (scope: source). This cannot be undone.

Full reference: Tools.

Commands in the agent: /ctx-stats shows the ctx_stats result, /ctx-doctor runs ctx_doctor (send its report with a defect report), and /ctx-upgrade runs ctx_upgrade, then ctx_doctor.

Security and privacy

  • The plugin keeps all its data on your machine, one database per project in ~/.context-mode, and ctx_purge deletes it by session, source or project. Read the Security guide.
  • The plugin has zero telemetry: usage data, events and crash reports stay on your machine. It uses the network for four calls, each one started by you or your agent:
Call When File
Fetch of a URL, for ctx_index Your agent asks for a page. The fetch blocks private and link-local addresses, checks each address the host name points to, connects to the address it checked, and checks again at each redirect. fetch.ts
One read of the npm dist-tags, with git ls-remote of the release tags as the fallback You run context-mode doctor, to check for a new version doctor-env.ts
npm i -g context-mode, or gh issue create You run context-mode upgrade, or you press a key to send the debug report commands.ts
Your agent's own install command, npm or git You install or update Your agent
  • The guard test D-PRIVACY-NET-1 in tests/0008-enforcement.test.mjs scans the source for HTTP clients, sockets, DNS lookups, git network calls and gh or npm spawns. It flags each new call site, so this table stays true.
  • Doctor and the debug report remove secrets by their structure before they print.

Code from ctx_execute runs on your host as your user, with your files, your network and your environment except the preload variables, so keep your agent's own permission prompts on. Here "sandbox" means the output stays in the sandbox and out of the context. What the plugin stores, where, and how to delete it: Privacy.

Context Mode Gateway

The plugin works on tool output, on your machine, and it is complete on its own. Context Mode Gateway is a separate hosted service with its own account and subscription. It works on every request, across all your agents. Its 11 features, the full list: Context Saving, Recall, Memory, Skills, Search, Session resume, Active Context, Instructions, Protect, Prompt caching, Live and Analytics. Add the Gateway when you want savings on every request, memory across sessions and agents, or cost reports for a team. For one project on one machine, the plugin covers the job. The two work together: Gateway guide. Gateway Recall, Search and Session resume run on the Gateway server, across sessions and agents. The plugin's ctx_search and ctx_resume read the local context.db of one project. With the Gateway on, your requests pass through its server; the plugin keeps its own data on your machine.

Product Runs Scope Billing
Context Mode plugin On your machine One project, local context.db Free
Context Mode Gateway Hosted service All sessions and agents Subscription, separate from the plugin

Set up the Gateway with one command:

npx @context-mode/cli

npx @context-mode/cli signs you in to your Gateway account, which has its own subscription, and writes one config change per agent. Apps: Claude Code, Claude Desktop, Codex, Codex Desktop, T3 Code, OpenCode and Pi. The Gateway CLI needs Node 20.12 or later, from its npm engines field.

Gateway Live screen during a session: money saved, bytes kept out per request, history kept and sent, and a feed of each request with its cost and saving

Live. One session as it runs: money saved this session, bytes kept out per request, history kept and sent, and a feed of each request with its cost and saving. Click the image for the full video.

Docs: How saving works

Gateway Overview: money saved, AI spend, prompt-cache discount and cost per request over 30 days
Overview. Your spend and what the Gateway saved, per day, in one view.
Docs: How saving works
Gateway Analytics: saved money over time, split by source
Analytics. Where each saving comes from: hidden tools, archived old results, large outputs kept in the archive and trimmed context.
Docs: How saving works
Gateway Spend: spend per day by model, cost per request and cache hit rate
Spend. Spend per day and per model, cost per request and the cache hit rate, to help you plan a budget.
Docs: Prompt caching
Gateway Memory: money saved by Recall and searches per day
Memory. Facts and decisions carry across sessions and agents. The screen shows what Recall saved and how many searches found an answer.
Docs: Memory
Gateway Skills: import from GitHub and the list of installed skills
Skills. Add a skill once and all your clients use it when it helps. Import skills from GitHub and see the installed ones.
Docs: Skills
Gateway Protect: a new command rule that blocks terraform destroy
Protect. Rules that check each shell command before it runs. Here, a rule that stops terraform destroy.
Docs: Protect

Numbers in these screens come from the author's own account over 30 days (Oct 3 - Nov 1, 2026), so read them as one account's usage. Click an image for the full size.

Three prompts to try with the Gateway on. The line under each one names the feature it shows.

Move this project from Jest to Vitest. Convert every test file, fix the config, run the suite after each batch, and tell me what is left.

Memory keeps the plan and the file list across a long job.

Pick up where we stopped yesterday on the Jest to Vitest move. What is done, what is left, and which test was failing?

Recall brings back yesterday's work in a fresh session.

Which date library did we choose on Tuesday, and why did we reject the other two?

Search finds the answer in past sessions.

Gateway features, from contextmode.ai/docs

Source: contextmode.ai/docs:

Feature What it does What you get Details
Context Saving Folds old tool output, runs data work as code (Code Mode), trims tool schemas, places cache marks A tool output over 2,048 B becomes a short pointer, with the full copy archived Saves the most on sessions with many tool calls
Recall The model sees recent work and an index of older work; the agent searches the archive for the rest Gateway, Claude Code, Opus 5.5, 200K window, 2026-10-04: mean cost per session $4.8627 to $3.0353 (-37.6% in dollars, ab.json below) Cost measured in Claude Code on Claude Opus 5.5
Memory Each fact keeps two times: when it was true and when the Gateway learned it Claude Code and Codex on one account share one store, tested end to end The memory block goes into the first request of a new session
Skills A skill catalog on the Gateway for your account; it loads the skill that matches your message The matching skill loads on the message that needs it Import skills from GitHub; a loaded skill joins the prompt in full
Search Searches the prompts, commands and tool output that passed through, in the console and as an agent tool Find any past prompt, command or tool output, from the console or your agent The console searches the first 4,000 characters of each tool result
Session resume One command rebuilds a conversation as a native Claude Code or Codex session Continue a conversation in Claude Code or Codex Restores the text, tool names and a summary; the command is valid for 15 minutes
Active Context Sets how much a thread carries before its oldest parts move to the archive: 200K, 500K or 1M tokens Pick the window size per thread An image older than the kept part becomes a short text note
Instructions One text of at most 4,096 characters that tells every agent how to answer you Read from the provider cache after the first request Sets how the agent writes to you
Protect A tool-call firewall: checks shell commands, file reads and writes, web fetches and tool-server calls by what they do Each call checked before it runs Reads the call itself, so keep your agent's sandbox on for script files and paths built at run time; opt-in
Prompt caching Keeps requests cache-friendly: cache marks on the fixed part of the prompt and a cache for fetched pages Inside the measured costs above Uses up to 4 cache marks, the provider's maximum
Live and Analytics Shows each request and what the Gateway saved, as it happens and over time See each request and its saving, live and over time Covers every request that passes through the Gateway

Gateway only: its cost against Claude Code alone, Claude Opus 5.5, mean dollars per session at list price. The plugin numbers are in Benchmarks.

  • Six short tasks (2026-09-29): 24.5% fewer dollars pooled over 176 sessions (21% to 29% per task). v3-opus55-short.json
  • Long Claude Code session, 200K window (2026-10-03/04): mean cost per session $4.8627 to $3.0353 (-37.6% in dollars, mean of 3 pairs). ab.json
  • We fixed the rules before each run: contextmode.ai/docs/benchmarks.

The Gateway routes to Anthropic and OpenAI. The Gateway sends your requests to its server on the way to the model. It keeps a searchable record of your sessions for Recall and Search, and masks secrets and e-mail addresses when it reads archived output back. Its privacy page is at contextmode.ai/privacy. Keep your agent's own sandbox on next to Protect.

License

Elastic License 2.0 (ELv2, the LICENSE file), a source-available license. You may use, copy, change and share the code, and use it at work, free of charge. The license keeps three uses for the licensor:

  1. Offering the software to others as a hosted or managed service that gives them a large part of its features.
  2. Moving, changing, turning off or getting around the license key functions, or removing or hiding what the license key protects.
  3. Changing, removing or hiding the licensor's license, copyright or other notices.

We chose ELv2 so the source stays open to all and the hosted service stays with the project.

Community

Report a defect on Discord with the full /ctx-doctor report, and send ideas there too. The maintainer writes every change; CONTRIBUTING.md shows how an agent files an issue.

Videos. Better Stack on Context Mode. Make your own video and share it on Discord; we add videos over 10K views here.

View on GitHub

Recent activity

commits and pull requests

Recent open issues

view all

Releases and announcements

242 total
  1. v2.2.0v2.2.0Nov 14, 202623 downloads

    ### Features - feat: OMP (oh-my-pi) is the 11th supported agent (ADR-0026, #1332) - feat: ADR-0023 omp row, PRD and TECH-SPEC 11 agents, 01-contracts and 12-plugins name OMP, intake reads OMP (OMP M8) - feat: docs/install/omp.md with OMP's own verbs, omp in NATIVE_HOSTS, 11 agents in install docs and README (OMP M8) - feat: ci.yml OMP 18.20.0 from its own install script on 3 OS, omp --version gate, OMP e2e cases step (OMP M7c) - feat: omp row decodes the Pi payload with agent omp, rows say omp (OMP M7a) - feat: ctx_upgrade on OMP prints omp plugin upgrade, writes no host config, one plugin root per package (OMP M6b) - feat: doctor names OMP, reads the OMP plugin store, prints OMP verbs and host-limit info (OMP M6a) - feat: setup merges and uninstall drops context-mode in OMP disabledServers when OMP imports it (OMP M5) - feat: issue forms, intake, CI step name and windows-hosts list omp as the 11th agent (OMP M4b) - feat: package.json omp key and omp/index.js wrapper (OMP M4b) - feat: omp is the 11th AgentId with a Pi-shaped table row (OMP M4a) - feat: all 9 ctx_* tools register with loadMode essential (OMP M3) - feat: OMP reads contextMode.excludeTools from api.pi.settings per cal

  2. v2.1.10v2.1.10Nov 12, 202653 downloads

    ### Fixes - fix(doctor): env line names the PATH node for ctx_execute, PATH node version read beside the checks (#1350) - fix(doctor): D5 bound scales with the node start, in-process hosts check shape only, env line names the host Bun (#1350) ### Who gets this One version on both channels: the release commit on main (GitHub) and npm. | Agent | Channel | Update with | |---|---|---| | Claude Code | GitHub | `claude plugin update context-mode@context-mode` | | Codex | GitHub, npm for the one-time hook trust step | `codex plugin marketplace upgrade context-mode` | | Gemini CLI | GitHub | `gemini extensions update context-mode` | | Qwen Code | GitHub | `qwen extensions update context-mode` | | Copilot CLI | npm | `context-mode upgrade` | | VS Code (Copilot) | npm | `context-mode upgrade` | | Kiro | npm | `context-mode upgrade` | | ZCode | GitHub | `zcode plugins update context-mode@context-mode` | | Pi | npm | `pi update --extensions` | | OpenCode | npm | `opencode plugin update` |

  3. v2.1.9v2.1.9Nov 12, 20269 downloads

    ### Fixes - fix: read the PATH and PATHEXT keys without case on Windows, one envValue reader for findRuntime, D11, the doctor report and setup (#1371) - fix: hook allows native tools on Node below 24.15 for the 8 server hosts (#1370) - fix: hostBin runs the PATH file that passed the check, not its realpath (#1335) - fix: opencode 2 generate request gets the same system payload as context (#1369) - fix: twin tests expect the native project dir; Windows-safe temp cleanup (#1342, #1358) ### Who gets this One version on both channels: the release commit on main (GitHub) and npm. | Agent | Channel | Update with | |---|---|---| | Claude Code | GitHub | `claude plugin update context-mode@context-mode` | | Codex | GitHub, npm for the one-time hook trust step | `codex plugin marketplace upgrade context-mode` | | Gemini CLI | GitHub | `gemini extensions update context-mode` | | Qwen Code | GitHub | `qwen extensions update context-mode` | | Copilot CLI | npm | `context-mode upgrade` | | VS Code (Copilot) | npm | `context-mode upgrade` | | Kiro | npm | `context-mode upgrade` | | ZCode | GitHub | `zcode plugins update context-mode@context-mode` | | Pi | npm | `pi update --extensions` | | Ope

  4. v2.1.8v2.1.8Nov 11, 202617 downloads

    ### Fixes - fix: quote the search.mjs line as POSIX single-quoted words (#1358, #1342) - fix: OpenCode 2 subagent tool set and in-process replace (#1348, #1347) - fix: Claude Code replace pointer names only tools the caller can call (#1342, #1358) - fix: setup keeps the MCP and global OpenCode entry when only a project .opencode/plugins file loads twice, and its Fix: line names that file (#1349) - fix: the CLI Fix: line names the OpenCode project plugins file to remove; doctor does not offer setup for it (#1349) - fix: only the OpenCode config plugins dir decides the global entry; a project plugins file next to it names the file to remove (#1349) - fix: OpenCode project .opencode/plugins file counts for setup, and a dir file with no package is no entry (#1349) - fix: an OpenCode plugins dir file of ours counts as the hooks entry (#1349) - fix: OpenCode 2 bare native entry plugins:["context-mode"] counts as the hooks entry (#1344) - fix: OpenCode 1.x list check reads debug config --pure, not the slow mcp list (#1362) - fix: isOwnFile checks for .. on the raw tool path, before resolve (#1345) - fix: a skill file under a symlinked skill dir reaches the model whole (#1345) - fix: main'

  5. v2.1.7v2.1.7Nov 8, 202690 downloads

    ### Fixes - fix: #1338 source test follows the D1 helper (d1UpdateCommand) - fix: doctor D1 in an unsupported host shows the host line, not the Gemini update command (#1340) - fix: the #1338 ctx_upgrade test follows the platform: no CLAUDE_CONFIG_DIR words on Windows by design - fix: CLI doctor names an unsupported host only when no supported agent is found; the background-hold note says the process was stopped (review of 2.1.6..c8180a97) - fix: doctor D1 names the CLAUDE_CONFIG_DIR profile like ctx_upgrade; Pi and OpenCode are never marked unsupported by a terminal env var (review of 2.1.6..7bb515e8) - fix: doctor D1 update is WARN with the agent's own command, D3 reads every OpenCode config and tuple entries, D6 PASS for in-process plugins (#1339) - fix: setup renews a stale Claude Code plugin copy with the host's own update and ends in a WARN instead of a rollback; custom CLAUDE_CONFIG_DIR profiles are named in doctor and ctx_upgrade (#1338) - fix: unsupported-host lines live in one module; Pi and Pi-Bolt never unsupported (test) - fix: doctor and setup say clearly when a host is not supported - fix: ctx_execute settles on exit plus a bounded pipe drain; killTree never blocks th

Code frequency

additions and deletions
+336K-336KWeek of 2026-02-22: +24,012 linesWeek of 2026-02-22: -3,870 linesWeek of 2026-03-01: +53,421 linesWeek of 2026-03-01: -27,023 linesWeek of 2026-03-08: +9,088 linesWeek of 2026-03-08: -2,159 linesWeek of 2026-03-15: +18,927 linesWeek of 2026-03-15: -16,169 linesWeek of 2026-03-22: +2,442 linesWeek of 2026-03-22: -1,506 linesWeek of 2026-03-29: +16,778 linesWeek of 2026-03-29: -9,281 linesWeek of 2026-04-05: +890 linesWeek of 2026-04-05: -145 linesWeek of 2026-04-12: +10,984 linesWeek of 2026-04-12: -5,026 linesWeek of 2026-04-19: +9,908 linesWeek of 2026-04-19: -4,077 linesWeek of 2026-04-26: +21,349 linesWeek of 2026-04-26: -7,422 linesWeek of 2026-05-03: +38,895 linesWeek of 2026-05-03: -15,610 linesWeek of 2026-05-10: +40,124 linesWeek of 2026-05-10: -14,337 linesWeek of 2026-05-17: +12,097 linesWeek of 2026-05-17: -6,914 linesWeek of 2026-05-24: +8,062 linesWeek of 2026-05-24: -2,328 linesWeek of 2026-05-31: +26,685 linesWeek of 2026-05-31: -6,944 linesWeek of 2026-06-07: +8,545 linesWeek of 2026-06-07: -6,492 linesWeek of 2026-06-14: +1,044 linesWeek of 2026-06-14: -499 linesWeek of 2026-06-21: +18,082 linesWeek of 2026-06-21: -11,906 linesWeek of 2026-06-28: +324 linesWeek of 2026-06-28: -322 linesWeek of 2026-07-05: +24 linesWeek of 2026-07-05: -24 linesWeek of 2026-07-12: +25 linesWeek of 2026-07-12: -25 linesWeek of 2026-07-19: +25 linesWeek of 2026-07-19: -25 linesWeek of 2026-07-26: +25 linesWeek of 2026-07-26: -25 linesWeek of 2026-08-02: +20 linesWeek of 2026-08-02: -20 linesWeek of 2026-08-09: +26 linesWeek of 2026-08-09: -26 linesWeek of 2026-08-16: +24 linesWeek of 2026-08-16: -24 linesWeek of 2026-08-23: +23 linesWeek of 2026-08-23: -23 linesWeek of 2026-08-30: +22 linesWeek of 2026-08-30: -22 linesWeek of 2026-09-06: +22 linesWeek of 2026-09-06: -22 linesWeek of 2026-09-13: +23 linesWeek of 2026-09-13: -23 linesWeek of 2026-09-20: +20 linesWeek of 2026-09-20: -20 linesWeek of 2026-09-27: +25 linesWeek of 2026-09-27: -25 linesWeek of 2026-10-04: +26 linesWeek of 2026-10-04: -26 linesWeek of 2026-10-11: +70,986 linesWeek of 2026-10-11: -4,676 linesWeek of 2026-10-18: +106,245 linesWeek of 2026-10-18: -174,998 linesWeek of 2026-10-25: +109,072 linesWeek of 2026-10-25: -43,685 linesWeek of 2026-11-01: +335,987 linesWeek of 2026-11-01: -161,674 linesWeek of 2026-11-08: +19,798 linesWeek of 2026-11-08: -7,560 linesWeek of 2026-11-15: +475 linesWeek of 2026-11-15: -157 linesFeb 22, 2026Nov 15, 2026
+964.6K lines added, -535.1K removed over the last year.

Commits per week

last 52 weeks
8720Week of 2025-11-23: 0 commitsWeek of 2025-11-30: 0 commitsWeek of 2025-12-07: 0 commitsWeek of 2025-12-14: 0 commitsWeek of 2025-12-21: 0 commitsWeek of 2025-12-28: 0 commitsWeek of 2026-01-04: 0 commitsWeek of 2026-01-11: 0 commitsWeek of 2026-01-18: 0 commitsWeek of 2026-01-25: 0 commitsWeek of 2026-02-01: 0 commitsWeek of 2026-02-08: 0 commitsWeek of 2026-02-15: 0 commitsWeek of 2026-02-22: 97 commitsWeek of 2026-03-01: 212 commitsWeek of 2026-03-08: 80 commitsWeek of 2026-03-15: 145 commitsWeek of 2026-03-22: 51 commitsWeek of 2026-03-29: 122 commitsWeek of 2026-04-05: 30 commitsWeek of 2026-04-12: 104 commitsWeek of 2026-04-19: 77 commitsWeek of 2026-04-26: 113 commitsWeek of 2026-05-03: 114 commitsWeek of 2026-05-10: 324 commitsWeek of 2026-05-17: 84 commitsWeek of 2026-05-24: 45 commitsWeek of 2026-05-31: 145 commitsWeek of 2026-06-07: 43 commitsWeek of 2026-06-14: 15 commitsWeek of 2026-06-21: 84 commitsWeek of 2026-06-28: 13 commitsWeek of 2026-07-05: 11 commitsWeek of 2026-07-12: 12 commitsWeek of 2026-07-19: 12 commitsWeek of 2026-07-26: 12 commitsWeek of 2026-08-02: 10 commitsWeek of 2026-08-09: 13 commitsWeek of 2026-08-16: 11 commitsWeek of 2026-08-23: 11 commitsWeek of 2026-08-30: 10 commitsWeek of 2026-09-06: 10 commitsWeek of 2026-09-13: 10 commitsWeek of 2026-09-20: 9 commitsWeek of 2026-09-27: 12 commitsWeek of 2026-10-04: 13 commitsWeek of 2026-10-11: 409 commitsWeek of 2026-10-18: 872 commitsWeek of 2026-10-25: 574 commitsWeek of 2026-11-01: 178 commitsWeek of 2026-11-08: 208 commitsWeek of 2026-11-15: 13 commitsNov 23, 2025Nov 15, 2026
4.3K commits in the last 52 weeks.

When work happens

weekday and hour
SunMonTueWedThuFriSat036912151821Sun 0:00 — 57 commitsSun 1:00 — 6 commitsSun 2:00 — 4 commitsSun 3:00 — 7 commitsSun 4:00 — 6 commitsSun 5:00 — 8 commitsSun 6:00 — 26 commitsSun 7:00 — 14 commitsSun 8:00 — 6 commitsSun 9:00 — 8 commitsSun 10:00 — 18 commitsSun 11:00 — 47 commitsSun 12:00 — 74 commitsSun 13:00 — 46 commitsSun 14:00 — 36 commitsSun 15:00 — 51 commitsSun 16:00 — 38 commitsSun 17:00 — 29 commitsSun 18:00 — 39 commitsSun 19:00 — 42 commitsSun 20:00 — 45 commitsSun 21:00 — 18 commitsSun 22:00 — 19 commitsSun 23:00 — 21 commitsMon 0:00 — 14 commitsMon 1:00 — 17 commitsMon 2:00 — 8 commitsMon 3:00 — 2 commitsMon 4:00 — 35 commitsMon 5:00 — 12 commitsMon 6:00 — 21 commitsMon 7:00 — 53 commitsMon 8:00 — 6 commitsMon 9:00 — 68 commitsMon 10:00 — 27 commitsMon 11:00 — 23 commitsMon 12:00 — 39 commitsMon 13:00 — 15 commitsMon 14:00 — 10 commitsMon 15:00 — 19 commitsMon 16:00 — 28 commitsMon 17:00 — 34 commitsMon 18:00 — 57 commitsMon 19:00 — 41 commitsMon 20:00 — 24 commitsMon 21:00 — 15 commitsMon 22:00 — 25 commitsMon 23:00 — 34 commitsTue 0:00 — 15 commitsTue 1:00 — 48 commitsTue 2:00 — 15 commitsTue 3:00 — 9 commitsTue 4:00 — 10 commitsTue 5:00 — 8 commitsTue 6:00 — 15 commitsTue 7:00 — 8 commitsTue 8:00 — 2 commitsTue 9:00 — 7 commitsTue 10:00 — 4 commitsTue 11:00 — 7 commitsTue 12:00 — 72 commitsTue 13:00 — 49 commitsTue 14:00 — 25 commitsTue 15:00 — 32 commitsTue 16:00 — 45 commitsTue 17:00 — 49 commitsTue 18:00 — 42 commitsTue 19:00 — 36 commitsTue 20:00 — 31 commitsTue 21:00 — 27 commitsTue 22:00 — 36 commitsTue 23:00 — 48 commitsWed 0:00 — 50 commitsWed 1:00 — 23 commitsWed 2:00 — 12 commitsWed 3:00 — 14 commitsWed 4:00 — 8 commitsWed 5:00 — 0 commitsWed 6:00 — 16 commitsWed 7:00 — 8 commitsWed 8:00 — 2 commitsWed 9:00 — 10 commitsWed 10:00 — 14 commitsWed 11:00 — 9 commitsWed 12:00 — 38 commitsWed 13:00 — 37 commitsWed 14:00 — 17 commitsWed 15:00 — 56 commitsWed 16:00 — 79 commitsWed 17:00 — 58 commitsWed 18:00 — 34 commitsWed 19:00 — 17 commitsWed 20:00 — 15 commitsWed 21:00 — 11 commitsWed 22:00 — 12 commitsWed 23:00 — 119 commitsThu 0:00 — 115 commitsThu 1:00 — 53 commitsThu 2:00 — 14 commitsThu 3:00 — 12 commitsThu 4:00 — 8 commitsThu 5:00 — 0 commitsThu 6:00 — 13 commitsThu 7:00 — 5 commitsThu 8:00 — 3 commitsThu 9:00 — 10 commitsThu 10:00 — 6 commitsThu 11:00 — 28 commitsThu 12:00 — 33 commitsThu 13:00 — 15 commitsThu 14:00 — 31 commitsThu 15:00 — 34 commitsThu 16:00 — 15 commitsThu 17:00 — 71 commitsThu 18:00 — 35 commitsThu 19:00 — 21 commitsThu 20:00 — 38 commitsThu 21:00 — 23 commitsThu 22:00 — 17 commitsThu 23:00 — 24 commitsFri 0:00 — 30 commitsFri 1:00 — 22 commitsFri 2:00 — 18 commitsFri 3:00 — 18 commitsFri 4:00 — 7 commitsFri 5:00 — 3 commitsFri 6:00 — 12 commitsFri 7:00 — 34 commitsFri 8:00 — 2 commitsFri 9:00 — 7 commitsFri 10:00 — 8 commitsFri 11:00 — 3 commitsFri 12:00 — 49 commitsFri 13:00 — 34 commitsFri 14:00 — 10 commitsFri 15:00 — 17 commitsFri 16:00 — 24 commitsFri 17:00 — 16 commitsFri 18:00 — 23 commitsFri 19:00 — 18 commitsFri 20:00 — 9 commitsFri 21:00 — 13 commitsFri 22:00 — 38 commitsFri 23:00 — 27 commitsSat 0:00 — 40 commitsSat 1:00 — 29 commitsSat 2:00 — 19 commitsSat 3:00 — 18 commitsSat 4:00 — 11 commitsSat 5:00 — 9 commitsSat 6:00 — 24 commitsSat 7:00 — 6 commitsSat 8:00 — 10 commitsSat 9:00 — 11 commitsSat 10:00 — 18 commitsSat 11:00 — 22 commitsSat 12:00 — 71 commitsSat 13:00 — 12 commitsSat 14:00 — 21 commitsSat 15:00 — 23 commitsSat 16:00 — 43 commitsSat 17:00 — 36 commitsSat 18:00 — 44 commitsSat 19:00 — 44 commitsSat 20:00 — 26 commitsSat 21:00 — 43 commitsSat 22:00 — 36 commitsSat 23:00 — 44 commits
Commit volume by weekday and hour (UTC). Larger dots mean more commits.

Who is committing

last 52 weeks
Maintainer commits1,715 (37%)
Community commits2,953 (63%)

4,668 commits in total over the last year.

DateListRankStars gained
Mar 1, 2026daily#14+276
  • morluto/rea

    Reverse engineer anything with agents, from app behavior down to native binaries.

    471.6K stars · TypeScript

  • openclaw/openclaw

    The AI that really does things. Any OS. Any Platform. The lobster way. 🦞

    394.9K stars · TypeScript

  • obra/superpowers

    An agentic skills framework & software development methodology that works.

    322.9K stars · Shell

  • affaan-m/ECC

    The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

    307.9K stars · JavaScript

  • NousResearch/hermes-agent

    The agent that grows with you

    265K stars · Python

  • react/react

    The library for web and native user interfaces.

    252.8K stars · JavaScript