context-mode 2.0.0-next.28 → 2.0.0-next.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/README.md +86 -83
- package/SHA256SUMS +19 -19
- package/claude-code/skills/ctx-stats/SKILL.md +2 -2
- package/cli.mjs +20 -0
- package/codex/skills/ctx-stats/SKILL.md +2 -2
- package/copilot/plugin.json +1 -1
- package/gemini-extension.json +1 -1
- package/hook.mjs +71 -71
- package/opencode/plugin.js +501 -234
- package/package.json +1 -1
- package/pi/index.js +580 -314
- package/pi/skills/ctx-stats/SKILL.md +2 -2
- package/qwen-extension.json +1 -1
- package/run.mjs +21 -1
- package/search.mjs +21 -1
- package/server.mjs +529 -263
- package/skills/ctx-stats/SKILL.md +2 -2
package/README.md
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
**A free, local plugin for 10 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.**
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/context-mode) [](https://github.com/mksglu/context-mode) [](https://discord.gg/DCN9jUgN5v) [](https://github.com/mksglu/context-mode/blob/v2.0.0-next.
|
|
5
|
+
[](https://www.npmjs.com/package/context-mode) [](https://github.com/mksglu/context-mode) [](https://discord.gg/DCN9jUgN5v) [](https://github.com/mksglu/context-mode/blob/v2.0.0-next.30/LICENSE)
|
|
6
6
|
|
|
7
|
-
**33K GitHub stars · 683K npm downloads** (read 2026-11-01, [stats.json](https://github.com/mksglu/context-mode/blob/v2.0.0-next.
|
|
7
|
+
**33K GitHub stars · 683K npm downloads** (read 2026-11-01, [stats.json](https://github.com/mksglu/context-mode/blob/v2.0.0-next.30/stats.json)) · on the Hacker News front page and GitHub Trending: [charts and sources](#adoption-stars-and-npm-downloads)
|
|
8
8
|
|
|
9
9
|
> 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](https://contextmode.ai/docs/how-saving-works?utm_source=github&utm_medium=readme&utm_content=quote)
|
|
10
10
|
|
|
11
11
|
<picture>
|
|
12
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.
|
|
13
|
-
<img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.
|
|
12
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/hero-dark.png">
|
|
13
|
+
<img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/hero-light.png" alt="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.">
|
|
14
14
|
</picture>
|
|
15
15
|
|
|
16
16
|
**Contents:** [Why](#why) · [Adoption](#adoption-stars-and-npm-downloads) · [Install](#install) · [Try it](#try-it) · [Use cases](#use-cases) · [Benchmarks](#benchmarks) · [How it works](#how-it-works) · [Tools](#tools) · [Security and privacy](#security-and-privacy) · [Context Mode Gateway](#context-mode-gateway) · [License](#license) · [Community](#community)
|
|
@@ -30,27 +30,27 @@ The Context Mode plugin runs that work in a local sandbox, keeps the full output
|
|
|
30
30
|
## Adoption: stars and npm downloads
|
|
31
31
|
|
|
32
32
|
<table><tr>
|
|
33
|
-
<td width="50%"><a href="https://contextmode.ai/open-source/stats?utm_source=github&utm_medium=readme&utm_content=adoption#stars"><picture><source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.
|
|
34
|
-
<td width="50%"><a href="https://contextmode.ai/open-source/stats?utm_source=github&utm_medium=readme&utm_content=adoption#daily"><picture><source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.
|
|
33
|
+
<td width="50%"><a href="https://contextmode.ai/open-source/stats?utm_source=github&utm_medium=readme&utm_content=adoption#stars"><picture><source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/star-history-dark.png"><img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/star-history-light.png" alt="Line chart of cumulative GitHub stars for mksglu/context-mode since 2026-02-23. A daily job redraws it."></picture></a></td>
|
|
34
|
+
<td width="50%"><a href="https://contextmode.ai/open-source/stats?utm_source=github&utm_medium=readme&utm_content=adoption#daily"><picture><source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/npm-downloads-dark.png"><img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/npm-downloads-light.png" alt="Area chart of npm downloads per day for context-mode, the last 90 days. A daily job redraws it."></picture></a></td>
|
|
35
35
|
</tr></table>
|
|
36
36
|
|
|
37
|
-
Open the [interactive chart](https://contextmode.ai/open-source/stats?utm_source=github&utm_medium=readme&utm_content=adoption#daily) 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 (
|
|
37
|
+
Open the [interactive chart](https://contextmode.ai/open-source/stats?utm_source=github&utm_medium=readme&utm_content=adoption#daily) 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.
|
|
38
38
|
|
|
39
39
|
- **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](https://news.ycombinator.com/item?id=47193064)).
|
|
40
40
|
- **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](https://github.com/uibm/trending-watcher/issues?q=%22mksglu%2Fcontext-mode%22)).
|
|
41
41
|
|
|
42
42
|
<picture>
|
|
43
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.
|
|
44
|
-
<img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.
|
|
43
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/stargazers-dark.png">
|
|
44
|
+
<img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/stargazers-light.png" alt="Companies that stargazers of mksglu/context-mode name in their GitHub profile, Microsoft, Tencent, Alibaba, ByteDance, Google and more.">
|
|
45
45
|
</picture>
|
|
46
46
|
|
|
47
|
-
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](https://github.com/mksglu/context-mode/blob/v2.0.0-next.
|
|
47
|
+
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](https://github.com/mksglu/context-mode/blob/v2.0.0-next.30/docs/assets/readme/data/stargazer-companies.json)).
|
|
48
48
|
|
|
49
49
|
## Install
|
|
50
50
|
|
|
51
|
-
The plugin needs Node 24.15.0 or later (the `engines` field in [package.json](https://github.com/mksglu/context-mode/blob/v2.0.0-next.
|
|
51
|
+
The plugin needs Node 24.15.0 or later (the `engines` field in [package.json](https://github.com/mksglu/context-mode/blob/v2.0.0-next.30/package.json)). On Windows you also need Git for Windows: the shell tools run in Git Bash, and `context-mode doctor` checks that Git Bash is there.
|
|
52
52
|
|
|
53
|
-
Open your agent and copy its own install command. Each block also has the update, check and remove steps.
|
|
53
|
+
Open your agent and copy its own install command. Each block also has the update, check and remove steps. Step-by-step guide: [Install](https://contextmode.ai/docs/engine/install?utm_source=github&utm_medium=readme&utm_content=install).
|
|
54
54
|
The npm commands use `@next`, the current 2.0 release tag; a plain `npm i -g context-mode` installs 1.x. Claude Code, Codex, Gemini CLI and Qwen Code install from GitHub, and each of their commands names the `release` branch.
|
|
55
55
|
The `context-mode` command (doctor, setup, remove) comes with the npm package: run `npm i -g context-mode@next` once, or use `/ctx-doctor` in the agent for the check.
|
|
56
56
|
|
|
@@ -61,7 +61,7 @@ claude plugin marketplace add mksglu/context-mode#release
|
|
|
61
61
|
claude plugin install context-mode@context-mode
|
|
62
62
|
```
|
|
63
63
|
Update: `claude plugin update context-mode@context-mode`. Check: `context-mode doctor --agents claude-code`. Remove: `context-mode setup --remove --agents claude-code`.
|
|
64
|
-
Hooks: yes (package) · MCP: yes · Skills: yes
|
|
64
|
+
Hooks: yes (package) · MCP: yes · Skills: yes
|
|
65
65
|
</details>
|
|
66
66
|
<details open id="install-codex"><summary><b>Codex</b></summary>
|
|
67
67
|
|
|
@@ -71,7 +71,7 @@ codex plugin add context-mode@context-mode
|
|
|
71
71
|
```
|
|
72
72
|
Then run `context-mode setup --agents codex` once: it marks the plugin hooks as trusted in the Codex `config.toml`, so Codex runs them.
|
|
73
73
|
Update: `codex plugin marketplace upgrade context-mode`. Check: `context-mode doctor --agents codex`. Remove: `context-mode setup --remove --agents codex`.
|
|
74
|
-
Hooks: yes (hook file) · MCP: yes · Skills: yes
|
|
74
|
+
Hooks: yes (hook file) · MCP: yes · Skills: yes
|
|
75
75
|
</details>
|
|
76
76
|
<details open id="install-gemini"><summary><b>Gemini CLI</b></summary>
|
|
77
77
|
|
|
@@ -79,7 +79,7 @@ Hooks: yes (hook file) · MCP: yes · Skills: yes · Guide: [docs/install/codex.
|
|
|
79
79
|
gemini extensions install https://github.com/mksglu/context-mode --ref release
|
|
80
80
|
```
|
|
81
81
|
Update: `gemini extensions update context-mode`. Check: `context-mode doctor --agents gemini`. Remove: `context-mode setup --remove --agents gemini`, then `gemini extensions uninstall context-mode`.
|
|
82
|
-
Hooks: yes (package) · MCP: yes · Skills: yes
|
|
82
|
+
Hooks: yes (package) · MCP: yes · Skills: yes
|
|
83
83
|
</details>
|
|
84
84
|
<details open id="install-qwen"><summary><b>Qwen Code</b></summary>
|
|
85
85
|
|
|
@@ -87,7 +87,7 @@ Hooks: yes (package) · MCP: yes · Skills: yes · Guide: [docs/install/gemini.m
|
|
|
87
87
|
qwen extensions install https://github.com/mksglu/context-mode:context-mode --ref release
|
|
88
88
|
```
|
|
89
89
|
Update: `qwen extensions update context-mode`. Check: `context-mode doctor --agents qwen`. Remove: `context-mode setup --remove --agents qwen`, then `qwen extensions uninstall context-mode`.
|
|
90
|
-
Hooks: yes (package) · MCP: yes · Skills: yes
|
|
90
|
+
Hooks: yes (package) · MCP: yes · Skills: yes
|
|
91
91
|
</details>
|
|
92
92
|
<details open id="install-pi"><summary><b>Pi</b></summary>
|
|
93
93
|
|
|
@@ -95,7 +95,7 @@ Hooks: yes (package) · MCP: yes · Skills: yes · Guide: [docs/install/qwen.md]
|
|
|
95
95
|
pi install npm:context-mode@next
|
|
96
96
|
```
|
|
97
97
|
Update: `pi update --extensions`. Check: `context-mode doctor --agents pi`. Remove: `context-mode setup --remove --agents pi`.
|
|
98
|
-
Hooks: yes (the plugin's own event handlers) · MCP: ctx tools built into the plugin · Skills: yes
|
|
98
|
+
Hooks: yes (the plugin's own event handlers) · MCP: ctx tools built into the plugin · Skills: yes
|
|
99
99
|
</details>
|
|
100
100
|
<details open id="install-opencode"><summary><b>OpenCode</b></summary>
|
|
101
101
|
|
|
@@ -103,7 +103,7 @@ Hooks: yes (the plugin's own event handlers) · MCP: ctx tools built into the pl
|
|
|
103
103
|
opencode plugin add context-mode@next
|
|
104
104
|
```
|
|
105
105
|
Update: `opencode plugin update`. Check: `context-mode doctor --agents opencode`. Remove: `opencode plugin remove context-mode@next`, then `context-mode setup --remove --agents opencode`.
|
|
106
|
-
Hooks: yes (the plugin's own event handlers) · MCP: yes · Skills: yes
|
|
106
|
+
Hooks: yes (the plugin's own event handlers) · MCP: yes · Skills: yes
|
|
107
107
|
</details>
|
|
108
108
|
<details open id="install-copilot-cli"><summary><b>Copilot CLI</b></summary>
|
|
109
109
|
|
|
@@ -112,7 +112,7 @@ npm i -g context-mode@next
|
|
|
112
112
|
context-mode setup --agents copilot-cli
|
|
113
113
|
```
|
|
114
114
|
Update: `context-mode upgrade`. Check: `context-mode doctor --agents copilot-cli`. Remove: `context-mode setup --remove --agents copilot-cli`.
|
|
115
|
-
Hooks: yes (hook file) · MCP: yes · Skills: yes
|
|
115
|
+
Hooks: yes (hook file) · MCP: yes · Skills: yes
|
|
116
116
|
</details>
|
|
117
117
|
<details open id="install-kiro"><summary><b>Kiro</b></summary>
|
|
118
118
|
|
|
@@ -121,7 +121,7 @@ npm i -g context-mode@next
|
|
|
121
121
|
context-mode setup --agents kiro
|
|
122
122
|
```
|
|
123
123
|
Update: `context-mode upgrade`. Check: `context-mode doctor --agents kiro`. Remove: `context-mode setup --remove --agents kiro`.
|
|
124
|
-
Hooks: yes (hook file) · MCP: yes · Skills: yes
|
|
124
|
+
Hooks: yes (hook file) · MCP: yes · Skills: yes
|
|
125
125
|
</details>
|
|
126
126
|
<details open id="install-vscode"><summary><b>VS Code (Copilot)</b></summary>
|
|
127
127
|
|
|
@@ -130,7 +130,7 @@ npm i -g context-mode@next
|
|
|
130
130
|
context-mode setup --agents vscode
|
|
131
131
|
```
|
|
132
132
|
Update: `context-mode upgrade`. Check: `context-mode doctor --agents vscode`. Remove: `context-mode setup --remove --agents vscode`.
|
|
133
|
-
Hooks: yes (hook file) · MCP: yes · Skills: yes
|
|
133
|
+
Hooks: yes (hook file) · MCP: yes · Skills: yes
|
|
134
134
|
</details>
|
|
135
135
|
<details open id="install-zcode"><summary><b>ZCode</b></summary>
|
|
136
136
|
|
|
@@ -139,10 +139,10 @@ npm i -g context-mode@next
|
|
|
139
139
|
context-mode setup --agents zcode
|
|
140
140
|
```
|
|
141
141
|
Update: `context-mode upgrade`. Check: `context-mode doctor --agents zcode`. Remove: `context-mode setup --remove --agents zcode`.
|
|
142
|
-
Hooks: yes (hook file) · MCP: yes · Skills: yes
|
|
142
|
+
Hooks: yes (hook file) · MCP: yes · Skills: yes
|
|
143
143
|
</details>
|
|
144
144
|
|
|
145
|
-
Already installed from GitHub on `main`?
|
|
145
|
+
Already installed from GitHub on `main`? Switch Claude Code, Codex, Gemini CLI or Qwen Code to the `release` ref with the steps in [Already installed from GitHub?](https://contextmode.ai/docs/engine/install?utm_source=github&utm_medium=readme&utm_content=install-switch#already-installed-from-github).
|
|
146
146
|
|
|
147
147
|
The npm route works for every agent:
|
|
148
148
|
|
|
@@ -152,7 +152,7 @@ context-mode setup
|
|
|
152
152
|
```
|
|
153
153
|
|
|
154
154
|
`context-mode 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.
|
|
155
|
-
Uninstall: `context-mode setup --remove && npm rm -g context-mode`.
|
|
155
|
+
Uninstall: `context-mode setup --remove && npm rm -g context-mode`.
|
|
156
156
|
|
|
157
157
|
Restart the agent, then run `context-mode doctor` (or `/ctx-doctor` in the agent). Each check prints PASS or a fix command.
|
|
158
158
|
|
|
@@ -160,12 +160,12 @@ Every agent gets hooks, the MCP server and the plugin skills (files in `skills/`
|
|
|
160
160
|
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).
|
|
161
161
|
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.
|
|
162
162
|
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.
|
|
163
|
-
CI runs setup, doctor, a hook and an MCP handshake for all 10 agents from the packed package on Linux, macOS and Windows. Record:
|
|
163
|
+
CI runs setup, doctor, a hook and an MCP handshake for all 10 agents from the packed package on Linux, macOS and Windows. Record: `docs/architecture/release/HOOKS-FIRE.md`.
|
|
164
164
|
|
|
165
165
|
## Try it
|
|
166
166
|
|
|
167
|
-
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](https://github.com/mksglu/context-mode/blob/v2.0.0-next.
|
|
168
|
-
Then run `/ctx-stats` in your agent to see how much output stayed out of the context. Every agent gets this command with the plugin skills (
|
|
167
|
+
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](https://github.com/mksglu/context-mode/blob/v2.0.0-next.30/bench/evidence/try-it-2026-11-02/README.md)). The headline numbers in [Benchmarks](#benchmarks) use the median of 5 runs. Other agents do the same job with the same tools: `ctx_execute`, `ctx_index` and `ctx_search`.
|
|
168
|
+
Then run `/ctx-stats` in your agent to see how much output stayed out of the context. Every agent gets this command with the plugin skills (`skills/ctx-stats`).
|
|
169
169
|
```text
|
|
170
170
|
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.
|
|
171
171
|
```
|
|
@@ -185,30 +185,32 @@ The hook sends WebFetch to the sandbox, and the agent reads ten stories from the
|
|
|
185
185
|
|
|
186
186
|
## Use cases
|
|
187
187
|
|
|
188
|
-
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
|
|
188
|
+
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.
|
|
189
189
|
|
|
190
190
|
| What you do | Tool | Raw | Reaches the context | Saved |
|
|
191
191
|
|---|---|---:|---:|---:|
|
|
192
|
-
|
|
|
193
|
-
|
|
|
194
|
-
|
|
|
195
|
-
|
|
|
196
|
-
|
|
|
197
|
-
|
|
|
198
|
-
|
|
|
199
|
-
|
|
|
200
|
-
|
|
|
201
|
-
|
|
|
202
|
-
|
|
|
203
|
-
|
|
|
204
|
-
|
|
|
205
|
-
|
|
|
206
|
-
|
|
|
207
|
-
|
|
|
208
|
-
|
|
|
209
|
-
|
|
|
210
|
-
|
|
|
211
|
-
|
|
|
192
|
+
| Read a browser page | Chrome DevTools MCP `take_snapshot` | 136,514 B | 463 B | 99.7% |
|
|
193
|
+
| List 40 issues | GitHub CLI `gh issue list --json` | 182,943 B | 850 B | 99.5% |
|
|
194
|
+
| List 25 pull requests with checks | GitHub CLI `gh pr list --json` | 195,471 B | 776 B | 99.6% |
|
|
195
|
+
| Look up library docs | Context7 `query-docs` | 6,917 B | 473 B | 93.2% |
|
|
196
|
+
| Run 1,106 tests | Vitest `vitest run --reporter=verbose` | 62,909 B | 429 B | 99.3% |
|
|
197
|
+
| Lint a source folder | Biome `biome lint --reporter=json` | 288,523 B | 577 B | 99.8% |
|
|
198
|
+
| Install a workspace | pnpm `pnpm install --frozen-lockfile` | 14,988 B | 199 B | 98.7% |
|
|
199
|
+
| Install packages | npm `npm install --loglevel http` | 37,761 B | 435 B | 98.8% |
|
|
200
|
+
| Read container logs | Docker `docker logs` | 60,374 B | 587 B | 99.0% |
|
|
201
|
+
| Plan 72 resources | Terraform `terraform plan` | 34,081 B | 166 B | 99.5% |
|
|
202
|
+
| Read 300 commits with file stats | git `git log --stat` | 164,385 B | 268 B | 99.8% |
|
|
203
|
+
| Read an 89 KB source file | Read, sent to `ctx_execute` by the hook | 91,362 B | 375 B | 99.6% |
|
|
204
|
+
| Fetch a 265 KB docs page | WebFetch, sent to `ctx_index` and `ctx_search` | 271,731 B | 439 B | 99.8% |
|
|
205
|
+
| Fetch a 214 KB API reply | curl in Bash, replaced after it runs | 219,175 B | 291 B | 99.9% |
|
|
206
|
+
| Print a 187 KB git log in Bash | Bash, output replaced after it runs | 191,120 B | 204 B | 99.9% |
|
|
207
|
+
| 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% |
|
|
208
|
+
| 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% |
|
|
209
|
+
| Read a 45 KB log file | Read, sent to `ctx_execute` by the hook | 46,216 B | 371 B | 99.2% |
|
|
210
|
+
| Read a 60 KB source file | Read, sent to `ctx_execute` by the hook | 61,576 B | 374 B | 99.4% |
|
|
211
|
+
| Debug for a full session: 8 outputs, 3 searches | All hooks and tools | 281,261 B | 3,266 B | 98.8% |
|
|
212
|
+
|
|
213
|
+
Source: [bench/results/2026-11-01-darwin-arm64.json](https://github.com/mksglu/context-mode/blob/v2.0.0-next.30/bench/results/2026-11-01-darwin-arm64.json), one row per line; each input is named in `bench/fixtures/data/SOURCE.md`.
|
|
212
214
|
|
|
213
215
|
The agent gets the part it asks for. The full output stays in the local index, and `ctx_search` reads it back.
|
|
214
216
|
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.
|
|
@@ -216,8 +218,8 @@ The Context7 row has 6,917 B of raw output, under the 10 KB line of the headline
|
|
|
216
218
|
## Benchmarks
|
|
217
219
|
|
|
218
220
|
<picture>
|
|
219
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.
|
|
220
|
-
<img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.
|
|
221
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/fig-saving-dark.png">
|
|
222
|
+
<img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/fig-saving-light.png" alt="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%.">
|
|
221
223
|
</picture>
|
|
222
224
|
|
|
223
225
|
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.
|
|
@@ -232,38 +234,40 @@ All 36 such rows, the six categories below: the plugin keeps a median of 99.4% o
|
|
|
232
234
|
| f. Hook redirect | A big Read, curl or WebFetch sent to the sandbox | 7 | 99.8% |
|
|
233
235
|
| g. Session total | One full scripted session | 1 | 98.8% |
|
|
234
236
|
|
|
235
|
-
Search replies (category b) carry the matching text, so they save 77.2%. Category e (long sessions) is in [Longer sessions](#longer-sessions). The full file lists every row, small ones too:
|
|
236
|
-
Reproduce: `cd bench && node run.mjs`. Method and
|
|
237
|
+
Search replies (category b) carry the matching text, so they save 77.2%. Category e (long sessions) is in [Longer sessions](#longer-sessions). The full file lists every row, small ones too: `bench/results/2026-11-01-darwin-arm64.md`.
|
|
238
|
+
Reproduce: `cd bench && node run.mjs`. Method, data files and rerun steps: [Benchmarks](https://contextmode.ai/docs/engine/benchmarks?utm_source=github&utm_medium=readme&utm_content=benchmarks).
|
|
237
239
|
|
|
238
240
|
### Longer sessions
|
|
239
241
|
|
|
240
242
|
<picture>
|
|
241
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.
|
|
242
|
-
<img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.
|
|
243
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/fig-oss-dark.png">
|
|
244
|
+
<img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/fig-oss-light.png" alt="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.">
|
|
243
245
|
</picture>
|
|
244
246
|
|
|
245
247
|
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.
|
|
246
248
|
|
|
247
249
|
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.
|
|
248
250
|
|
|
249
|
-
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
|
|
250
|
-
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
|
|
251
|
+
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).
|
|
252
|
+
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`).
|
|
251
253
|
|
|
252
254
|
### Speed
|
|
253
255
|
|
|
254
|
-
Median of 5 runs, bench of 2026-11-01.
|
|
256
|
+
Median of 5 runs, bench of 2026-11-01.
|
|
255
257
|
|
|
256
258
|
| Measure | Result |
|
|
257
259
|
|---|---|
|
|
258
|
-
| Hook time over a bare `node` start, per agent | 7.5 ms to 12.3 ms
|
|
259
|
-
| `ctx_search`, 20 queries over 8 indexed files | 1.62 ms median, 6.70 ms max
|
|
260
|
-
| `ctx_index`, 3 real files, 625,649 B | 150 ms per MB
|
|
260
|
+
| Hook time over a bare `node` start, per agent | 7.5 ms to 12.3 ms |
|
|
261
|
+
| `ctx_search`, 20 queries over 8 indexed files | 1.62 ms median, 6.70 ms max |
|
|
262
|
+
| `ctx_index`, 3 real files, 625,649 B | 150 ms per MB |
|
|
263
|
+
|
|
264
|
+
Source: rows `g-hook-kiro` to `g-hook-claude-code`, `g-search-latency` and `g-index-per-mb` of `bench/results/2026-11-01-darwin-arm64.md`, with every agent and query.
|
|
261
265
|
|
|
262
266
|
## How it works
|
|
263
267
|
|
|
264
268
|
<picture>
|
|
265
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.
|
|
266
|
-
<img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.
|
|
269
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/fig-flow-dark.png">
|
|
270
|
+
<img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/fig-flow-light.png" alt="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.">
|
|
267
271
|
</picture>
|
|
268
272
|
|
|
269
273
|
1. Your agent calls a tool: it reads a file, runs a command or fetches a page.
|
|
@@ -272,7 +276,7 @@ Median of 5 runs, bench of 2026-11-01. Rows per agent and per query: [bench/resu
|
|
|
272
276
|
4. The agent gets the part it asked for, and calls `ctx_search` when it wants more.
|
|
273
277
|
5. After a compaction, the agent gets a short state block; each line points to the full record.
|
|
274
278
|
|
|
275
|
-
Timeouts, chunk sizes, ranking and storage: [
|
|
279
|
+
Timeouts, chunk sizes, ranking and storage: [How it works](https://contextmode.ai/docs/engine/how-it-works?utm_source=github&utm_medium=readme&utm_content=how).
|
|
276
280
|
|
|
277
281
|
## Tools
|
|
278
282
|
|
|
@@ -288,13 +292,13 @@ Timeouts, chunk sizes, ranking and storage: [Engineering details](https://github
|
|
|
288
292
|
| `ctx_upgrade` | Installs, upgrades or uninstalls; replaces old context-mode entries |
|
|
289
293
|
| `ctx_purge` | Deletes indexed data by session, source or project |
|
|
290
294
|
|
|
291
|
-
Full reference: [
|
|
295
|
+
Full reference: [Tools](https://contextmode.ai/docs/engine/tools?utm_source=github&utm_medium=readme&utm_content=tools).
|
|
292
296
|
|
|
293
297
|
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`.
|
|
294
298
|
|
|
295
299
|
## Security and privacy
|
|
296
300
|
|
|
297
|
-
- The plugin keeps all its data on your machine, in `~/.context-mode`: one `context.db` per project. `ctx_purge` deletes it by session, source or project.
|
|
301
|
+
- The plugin keeps all its data on your machine, in `~/.context-mode`: one `context.db` per project. `ctx_purge` deletes it by session, source or project. Read the [Security guide](https://contextmode.ai/docs/engine/security?utm_source=github&utm_medium=readme&utm_content=security).
|
|
298
302
|
- The plugin has zero telemetry: usage data, events and crash reports stay on your machine. It uses the network at these call sites, each one started by you or your agent:
|
|
299
303
|
- `ctx_index` of a URL the agent asks for: `src/core/sandbox/fetch.ts`. It 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.
|
|
300
304
|
- `context-mode doctor`: `git ls-remote` to the release repository, to check for a new version (`src/core/ops/doctor-env.ts`).
|
|
@@ -318,16 +322,16 @@ With the Gateway on, your requests pass through its server; the plugin keeps its
|
|
|
318
322
|
| Context Mode plugin | On your machine | One project, local `context.db` | Free |
|
|
319
323
|
| Context Mode Gateway | Hosted service | All sessions and agents | Subscription, separate from the plugin |
|
|
320
324
|
|
|
321
|
-
<a href="https://github.com/mksglu/context-mode/blob/v2.0.0-next.
|
|
325
|
+
<a href="https://github.com/mksglu/context-mode/blob/v2.0.0-next.30/docs/assets/readme/gateway/live.mp4"><img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/gateway/live.webp" width="100%" alt="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"></a>
|
|
322
326
|
|
|
323
|
-
**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.
|
|
327
|
+
**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.
|
|
324
328
|
|
|
325
|
-
Docs: [How saving works](https://contextmode.ai/docs/how-saving-works?utm_source=github&utm_medium=readme&utm_content=live)
|
|
329
|
+
Docs: [How saving works](https://contextmode.ai/docs/how-saving-works?utm_source=github&utm_medium=readme&utm_content=live)
|
|
326
330
|
|
|
327
331
|
<table>
|
|
328
|
-
<tr><td width="50%"><a href="https://github.com/mksglu/context-mode/blob/v2.0.0-next.
|
|
329
|
-
<tr><td width="50%"><a href="https://github.com/mksglu/context-mode/blob/v2.0.0-next.
|
|
330
|
-
<tr><td width="50%"><a href="https://github.com/mksglu/context-mode/blob/v2.0.0-next.
|
|
332
|
+
<tr><td width="50%"><a href="https://github.com/mksglu/context-mode/blob/v2.0.0-next.30/docs/assets/readme/gateway/overview.webp"><img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/gateway/overview-1200.webp" alt="Gateway Overview: money saved, AI spend, prompt-cache discount and cost per request over 30 days"></a><br><b>Overview.</b> Your spend and what the Gateway saved, per day, in one view.<br>Docs: <a href="https://contextmode.ai/docs/how-saving-works?utm_source=github&utm_medium=readme&utm_content=overview">How saving works</a></td><td width="50%"><a href="https://github.com/mksglu/context-mode/blob/v2.0.0-next.30/docs/assets/readme/gateway/analytics.webp"><img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/gateway/analytics-1200.webp" alt="Gateway Analytics: saved money over time, split by source"></a><br><b>Analytics.</b> Where each saving comes from: hidden tools, archived old results, large outputs kept in the archive and trimmed context.<br>Docs: <a href="https://contextmode.ai/docs/how-saving-works?utm_source=github&utm_medium=readme&utm_content=analytics">How saving works</a></td></tr>
|
|
333
|
+
<tr><td width="50%"><a href="https://github.com/mksglu/context-mode/blob/v2.0.0-next.30/docs/assets/readme/gateway/spend.webp"><img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/gateway/spend-1200.webp" alt="Gateway Spend: spend per day by model, cost per request and cache hit rate"></a><br><b>Spend.</b> Spend per day and per model, cost per request and the cache hit rate, to help you plan a budget.<br>Docs: <a href="https://contextmode.ai/docs/prompt-caching?utm_source=github&utm_medium=readme&utm_content=spend">Prompt caching</a></td><td width="50%"><a href="https://github.com/mksglu/context-mode/blob/v2.0.0-next.30/docs/assets/readme/gateway/memory.webp"><img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/gateway/memory-top-1200.webp" alt="Gateway Memory: money saved by Recall and searches per day"></a><br><b>Memory.</b> Facts and decisions carry across sessions and agents. The screen shows what Recall saved and how many searches found an answer.<br>Docs: <a href="https://contextmode.ai/docs/memory?utm_source=github&utm_medium=readme&utm_content=memory">Memory</a></td></tr>
|
|
334
|
+
<tr><td width="50%"><a href="https://github.com/mksglu/context-mode/blob/v2.0.0-next.30/docs/assets/readme/gateway/skills.webp"><img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/gateway/skills-1200.webp" alt="Gateway Skills: import from GitHub and the list of installed skills"></a><br><b>Skills.</b> Add a skill once and all your clients use it when it helps. Import skills from GitHub and see the installed ones.<br>Docs: <a href="https://contextmode.ai/docs/skills?utm_source=github&utm_medium=readme&utm_content=skills">Skills</a></td><td width="50%"><a href="https://github.com/mksglu/context-mode/blob/v2.0.0-next.30/docs/assets/readme/gateway/protect.webp"><img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.30/docs/assets/readme/gateway/protect-1200.webp" alt="Gateway Protect: a new command rule that blocks terraform destroy"></a><br><b>Protect.</b> Rules that check each shell command before it runs. Here, a rule that stops <code>terraform destroy</code>.<br>Docs: <a href="https://contextmode.ai/docs/protect?utm_source=github&utm_medium=readme&utm_content=protect">Protect</a></td></tr>
|
|
331
335
|
</table>
|
|
332
336
|
|
|
333
337
|
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.
|
|
@@ -353,16 +357,16 @@ Source: [contextmode.ai/docs](https://contextmode.ai/docs/how-saving-works?utm_s
|
|
|
353
357
|
|
|
354
358
|
| Feature | What it does | What you get | Details |
|
|
355
359
|
|---|---|---|---|
|
|
356
|
-
| Context Saving | Folds old tool output, runs data work as code (Thinking in Code), 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
|
|
357
|
-
| 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,
|
|
360
|
+
| Context Saving | Folds old tool output, runs data work as code (Thinking in Code), 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 |
|
|
361
|
+
| 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 |
|
|
358
362
|
| 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 |
|
|
359
363
|
| 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 |
|
|
360
|
-
| 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
|
|
361
|
-
| 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
|
|
362
|
-
| 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
|
|
363
|
-
| 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
|
|
364
|
+
| 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 |
|
|
365
|
+
| 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 |
|
|
366
|
+
| 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 |
|
|
367
|
+
| 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 |
|
|
364
368
|
| 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 |
|
|
365
|
-
| 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
|
|
369
|
+
| 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 |
|
|
366
370
|
| 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 |
|
|
367
371
|
|
|
368
372
|
</details>
|
|
@@ -376,11 +380,11 @@ Gateway cost against Claude Code alone, Claude Opus 5.5, mean dollars per sessio
|
|
|
376
380
|
Apps: Claude Code, Claude Desktop, Codex, Codex Desktop, T3 Code, OpenCode and Pi.
|
|
377
381
|
Setup is one command, `npx @context-mode/cli`. It signs you in to your Gateway account, which has its own subscription, and writes one config change per agent (the Gateway CLI needs Node 20.12 or later, from its npm `engines` field; the plugin needs Node 24.15.0).
|
|
378
382
|
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](https://contextmode.ai/privacy?utm_source=github&utm_medium=readme&utm_content=privacy).
|
|
379
|
-
Keep your agent's own sandbox on next to Protect.
|
|
383
|
+
Keep your agent's own sandbox on next to Protect.
|
|
380
384
|
|
|
381
385
|
## License
|
|
382
386
|
|
|
383
|
-
|
|
387
|
+
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.
|
|
384
388
|
The license keeps three uses for the licensor:
|
|
385
389
|
|
|
386
390
|
1. Offering the software to others as a hosted or managed service that gives them a large part of its features.
|
|
@@ -391,7 +395,6 @@ We chose ELv2 so the source stays open to all and the hosted service stays with
|
|
|
391
395
|
|
|
392
396
|
## Community
|
|
393
397
|
|
|
394
|
-
Report a defect on [Discord](https://discord.gg/DCN9jUgN5v) with the full `/ctx-doctor` report.
|
|
395
|
-
The maintainer writes every change; send ideas and defect reports on Discord.
|
|
398
|
+
Report a defect on [Discord](https://discord.gg/DCN9jUgN5v) with the full `/ctx-doctor` report, and send ideas there too. The maintainer writes every change.
|
|
396
399
|
|
|
397
|
-
|
|
400
|
+
**Videos.** [Better Stack on Context Mode](https://www.youtube.com/watch?v=QUHrntlfPo4). Make your own video and share it on [Discord](https://discord.gg/DCN9jUgN5v); we add videos over 10K views here.
|
package/SHA256SUMS
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
4b26d7bc69d6fcaf59581692c2566d53963a13f95c2343dd648d6468a831ea41 .claude-plugin/marketplace.json
|
|
2
|
+
f1f62a7a8810c1cc943cc149ecacd890639efce36305b330bb0fa6a2700ec312 .claude-plugin/plugin.json
|
|
3
3
|
187503e1455560d4ab5a72e3b8cd2f274abd4ccc5faa60dd66c37e44bb5f10c2 .codex-plugin/hooks.json
|
|
4
4
|
4edea851775bc3f0418f8d9cf6ead74f2767c3a9e3b8c05749eacb78ebb3b896 .codex-plugin/mcp.json
|
|
5
|
-
|
|
5
|
+
90bb055fd11fba0941345afa306837183274c03c8732e1fcb1e6157df796a073 .codex-plugin/plugin.json
|
|
6
6
|
92f11a867c41c9e575ccb978ff205ae2011c244a14aa3c576e914e537105caa0 LICENSE
|
|
7
|
-
|
|
7
|
+
f9e5cc2b590566ead9cc943bc9ce2e7564c1a1cb75f2c3e84fce29581ab5abb5 README.md
|
|
8
8
|
1773e40a89384dd1af9023ba533da1908f3e2435dbaaa7cc941edf0514148313 claude-code/skills/ctx-doctor/SKILL.md
|
|
9
|
-
|
|
9
|
+
d12b50ba56fa8632a778948b72137c32e043b0c11b0402f07ddef1578406d495 claude-code/skills/ctx-stats/SKILL.md
|
|
10
10
|
d8f835d2f2b3eb70c5902f8707e7c5857977cec9e20ace76c499378a04e178e0 claude-code/skills/ctx-upgrade/SKILL.md
|
|
11
|
-
|
|
11
|
+
5c27950f082cdde50d549bf063b5cd61b3e7bb2114a04db1ea39e8e36d8a275c cli.mjs
|
|
12
12
|
83c297020ed0c592fc68c9c482546a6999d41df5d06d8a329498f10edb1bd38e codex/skills/ctx-doctor/SKILL.md
|
|
13
|
-
|
|
13
|
+
5652e791d5fa00033aebb0f6f85b6a3c9db8ab45cfc402e74ffc5f87bdc08922 codex/skills/ctx-stats/SKILL.md
|
|
14
14
|
5c12cdd19a5e3ed7d9ba3a47b24d03864a28d36cf7006876284ee07cd4221ec4 codex/skills/ctx-upgrade/SKILL.md
|
|
15
|
-
|
|
15
|
+
669e169b2c0bfd08844e927f0a80e96d06114a8f5fe7114d558ebfb40e3a0df4 copilot/plugin.json
|
|
16
16
|
e3bc6cae0bd51b806d81631879711bbc48c679fc929b2642ed4634438364167d fixtures/hook-roundtrip.json
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
07b0d70b116d74f8210cc309d4f5f90109d79c26ac2a9a5454ef1cf2626102f6 gemini-extension.json
|
|
18
|
+
2ef9d9b63543fe7f8aab2272875558a12bcc6bcde94d9ff821f3e253325565be hook.mjs
|
|
19
19
|
1f8d8650d2b38737522cab6b875878e8baf84a74acf98cd924c7af22852d873f hooks/claude-code.json
|
|
20
20
|
2524a0eb52683b65c65943c5097db513e9845ba14e84324b39e9a8ea2bb43193 hooks/codex.json
|
|
21
21
|
b656fed2b754ebcfd4c156bee81d5879c21a8083fc0d6b8e3241462b63a214b6 hooks/copilot-cli.json
|
|
@@ -24,16 +24,16 @@ f336d1db67de49e641687bbd41ba1a9424e31dfe2377b2284bf44358288ebd8b hooks/kiro.jso
|
|
|
24
24
|
017c9cc3997dd53231b8548b1a1609fddc51177af53501565a4f334602039860 hooks/qwen.json
|
|
25
25
|
33f69267645338d0dc392ce551dcd7c69a0b508113469d6ea637d3f34239ef1d hooks/vscode.json
|
|
26
26
|
085630bccf2073ac9a62be24ef91dfc47d106092dc82c822db70890b7d3ae1c0 hooks/zcode.json
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
877c903df1fe1374c99b204f6eb14319154bb0e48f39ac2d035ccd1388a2e585 opencode/plugin.js
|
|
28
|
+
8c1a48b9cbfd3b9e2396b401c27377a08e35e11ebbf6e73c60f7319a1f8d4c08 package.json
|
|
29
|
+
57e3adcfd7599ef3213fb71b0f3951abef21cc38417ca90b71f8f72af74e954e pi/index.js
|
|
30
30
|
8712881622c9905aa4836af50d903042d34a91506264e459bc7839331f6f0192 pi/skills/ctx-doctor/SKILL.md
|
|
31
|
-
|
|
31
|
+
4ff03de9581acbb827266eb9461aa34c8da5c3d01d51a3738064e582bf466a79 pi/skills/ctx-stats/SKILL.md
|
|
32
32
|
db6f9c006bc864a7271f1eeffb1e316ebb537a3414f1c22f8b9de0a896e8e3c5 pi/skills/ctx-upgrade/SKILL.md
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
0af96a5fdffd2afc8c83ae47cb5228d721fa941191667dbf6f9203359561d194 qwen-extension.json
|
|
34
|
+
2726c2edc6ad035bec484c2101635290415c49f745df274461862d350ec0f99a run.mjs
|
|
35
|
+
2726c2edc6ad035bec484c2101635290415c49f745df274461862d350ec0f99a search.mjs
|
|
36
|
+
57762a33cbf7b2449fc8f056edf346154b7d39138792bd927f7f8afe5a4009fb server.mjs
|
|
37
37
|
e5503a22a6238901484d123efc11d2d933aa9a54c6ac2018812cfa65ec4e53e3 skills/ctx-doctor/SKILL.md
|
|
38
|
-
|
|
38
|
+
ad3b9875600f3d7a4970ed91ad9331903c2aa5e77d9f742c6a212015a021ad18 skills/ctx-stats/SKILL.md
|
|
39
39
|
c1cac75b7506ee0d06089ce611ac6dc9314cf12435da318ce88ad50e2c5debbf skills/ctx-upgrade/SKILL.md
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ctx-stats
|
|
3
|
-
description: Show how much context context-mode saved, as a
|
|
3
|
+
description: Show how much context context-mode saved, as a detailed report.
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
---
|
|
6
|
-
Call the mcp__plugin_context-mode_context-mode__ctx_stats tool and show its
|
|
6
|
+
Call the mcp__plugin_context-mode_context-mode__ctx_stats tool and show the text block of its reply to the user unchanged, inside a code block so the columns stay aligned. Add one sentence under it that names the largest saving.
|
package/cli.mjs
CHANGED
|
@@ -298,7 +298,26 @@ var EDIT_TOOLS = Object.freeze(["Write", "Edit"]);
|
|
|
298
298
|
var EDIT_PATH_KEYS = Object.freeze(["file_path", "path"]);
|
|
299
299
|
var AGENT_ARG = "--agent";
|
|
300
300
|
var STATS_COLUMNS = Object.freeze(["Scope", "Produced", "Returned", "Saved", "Reduction %"]);
|
|
301
|
+
var STATS_EMPTY_LINES = Object.freeze([
|
|
302
|
+
"Ready. Your savings show up here after the first tool call.",
|
|
303
|
+
"Large outputs from ctx_execute, ctx_batch and ctx_index stay in the",
|
|
304
|
+
"sandbox, and only the short answer goes to the chat."
|
|
305
|
+
]);
|
|
306
|
+
var STATS_KIND_LABELS = Object.freeze([
|
|
307
|
+
["cmd", "Tool runs"],
|
|
308
|
+
["index", "Content indexed"],
|
|
309
|
+
["edit", "File edits"],
|
|
310
|
+
["toolerr", "Errors kept"],
|
|
311
|
+
["decision", "Your decisions"],
|
|
312
|
+
["prompt", "Your prompts"]
|
|
313
|
+
]);
|
|
314
|
+
var STATS_JOURNAL_HINTS = Object.freeze([
|
|
315
|
+
"ctx_resume brings back your last task, files changed and open errors",
|
|
316
|
+
"after a compact or a restart; ctx_search finds indexed content by words."
|
|
317
|
+
]);
|
|
301
318
|
var PURGE_SCOPES = Object.freeze(["session", "source", "project"]);
|
|
319
|
+
var RELEASE_REPO_URL = "https://github.com/mksglu/context-mode.git";
|
|
320
|
+
var RELEASE_BRANCH = "release";
|
|
302
321
|
var DOCTOR_CHECK_ORDER = Object.freeze(["D1", "D2", "D3", "D4", "D5", "D5b", "D6", "D7", "D8", "D9", "D10", "D11"]);
|
|
303
322
|
var DOCTOR_LABEL = Object.freeze({
|
|
304
323
|
D1: "version",
|
|
@@ -316,6 +335,7 @@ var DOCTOR_LABEL = Object.freeze({
|
|
|
316
335
|
});
|
|
317
336
|
var REPORT_SOURCE_LABEL = "ctx_doctor:report";
|
|
318
337
|
var REPORT_POINTER = `ctx_search({queries:["FAIL","PASS","UNKNOWN"], source:${JSON.stringify(REPORT_SOURCE_LABEL)}})`;
|
|
338
|
+
var D1_GIT_CHECK_FIX = `git ls-remote ${RELEASE_REPO_URL} ${RELEASE_BRANCH}`;
|
|
319
339
|
var D2_NODE_FIX = `install Node ${NODE_MIN} or later`;
|
|
320
340
|
var D3_PARTS = Object.freeze(["MCP entry", "hook entries", "hook timeout"]);
|
|
321
341
|
var AGENT_HOME_DIR = Object.freeze({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ctx-stats
|
|
3
|
-
description: Show how much context context-mode saved, as a
|
|
3
|
+
description: Show how much context context-mode saved, as a detailed report.
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
---
|
|
6
|
-
Call the mcp__context_mode__ctx_stats tool and show its
|
|
6
|
+
Call the mcp__context_mode__ctx_stats tool and show the text block of its reply to the user unchanged, inside a code block so the columns stay aligned. Add one sentence under it that names the largest saving.
|