context-mode 2.0.0-next.22 → 2.0.0-next.24

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.
@@ -9,7 +9,7 @@
9
9
  "name": "context-mode",
10
10
  "skills": "./claude-code/skills",
11
11
  "source": "./",
12
- "version": "2.0.0-next.22"
12
+ "version": "2.0.0-next.24"
13
13
  }
14
14
  ]
15
15
  }
@@ -13,5 +13,5 @@
13
13
  },
14
14
  "name": "context-mode",
15
15
  "skills": "./claude-code/skills",
16
- "version": "2.0.0-next.22"
16
+ "version": "2.0.0-next.24"
17
17
  }
@@ -8,5 +8,5 @@
8
8
  "mcpServers": "./.codex-plugin/mcp.json",
9
9
  "name": "context-mode",
10
10
  "skills": "./codex/skills/",
11
- "version": "2.0.0-next.22"
11
+ "version": "2.0.0-next.24"
12
12
  }
package/LICENSE ADDED
@@ -0,0 +1,94 @@
1
+ Elastic License 2.0 (ELv2)
2
+
3
+ Copyright 2026 Mert Koseoglu
4
+
5
+ ## Acceptance
6
+
7
+ By using the software, you agree to all of the terms and conditions below.
8
+
9
+ ## Copyright License
10
+
11
+ The licensor grants you a non-exclusive, royalty-free, worldwide,
12
+ non-sublicensable, non-transferable license to use, copy, distribute, make
13
+ available, and prepare derivative works of the software, in each case subject
14
+ to the limitations and conditions below.
15
+
16
+ ## Limitations
17
+
18
+ You may not provide the software to third parties as a hosted or managed
19
+ service, where the service provides users with access to any substantial set
20
+ of the features or functionality of the software.
21
+
22
+ You may not move, change, disable, or circumvent the license key
23
+ functionality in the software, and you may not remove or obscure any
24
+ functionality in the software that is protected by the license key.
25
+
26
+ You may not alter, remove, or obscure any licensing, copyright, or other
27
+ notices of the licensor in the software. Any use of the licensor's trademarks
28
+ is subject to applicable law.
29
+
30
+ ## Patents
31
+
32
+ The licensor grants you a license, under any patent claims the licensor can
33
+ license, or becomes able to license, to make, have made, use, sell, offer for
34
+ sale, import and have imported the software, in each case subject to the
35
+ limitations and conditions in this license. This license does not cover any
36
+ patent claims that you cause to be infringed by modifications or additions to
37
+ the software. If you or your company make any written claim that the software
38
+ infringes or contributes to infringement of any patent, your patent license
39
+ for the software granted under these terms ends immediately. If your company
40
+ makes such a claim, your patent license ends immediately for work on behalf
41
+ of your company.
42
+
43
+ ## Notices
44
+
45
+ You must ensure that anyone who gets a copy of any part of the software from
46
+ you also gets a copy of these terms.
47
+
48
+ If you modify the software, you must include in any modified copies of the
49
+ software prominent notices stating that you have modified the software.
50
+
51
+ ## No Other Rights
52
+
53
+ These terms do not imply any licenses other than those expressly granted in
54
+ these terms.
55
+
56
+ ## Termination
57
+
58
+ If you use the software in violation of these terms, such use is not
59
+ licensed, and your licenses will automatically terminate. If the licensor
60
+ provides you with a notice of your violation, and you cease all violation of
61
+ this license no later than 30 days after you receive that notice, your
62
+ licenses will be reinstated retroactively. However, if you violate these
63
+ terms after such reinstatement, any additional violation of these terms will
64
+ cause your licenses to terminate automatically and permanently.
65
+
66
+ ## No Liability
67
+
68
+ *As far as the law allows, the software comes as is, without any warranty or
69
+ condition, and the licensor will not be liable to you for any damages arising
70
+ out of these terms or the use or nature of the software, under any kind of
71
+ legal claim.*
72
+
73
+ ## Definitions
74
+
75
+ The **licensor** is the entity offering these terms, and the **software** is
76
+ the software the licensor makes available under these terms, including any
77
+ portion of it.
78
+
79
+ **you** refers to the individual or entity agreeing to these terms.
80
+
81
+ **your company** is any legal entity, sole proprietorship, or other kind of
82
+ organization that you work for, plus all organizations that have control over,
83
+ are under the control of, or are under common control with that organization.
84
+ **control** means ownership of substantially all the assets of an entity, or
85
+ the power to direct its management and policies by vote, contract, or
86
+ otherwise. Control can be direct or indirect.
87
+
88
+ **your licenses** are all the licenses granted to you for the software under
89
+ these terms.
90
+
91
+ **use** means anything you do with the software requiring one of your
92
+ licenses.
93
+
94
+ **trademark** means trademarks, service marks, and similar rights.
package/README.md ADDED
@@ -0,0 +1,370 @@
1
+ # Context Mode
2
+
3
+ **Keeping tool output out of a coding agent's context window: a local plugin for 10 agents, and the Gateway that works on the whole request.**
4
+
5
+ [![npm downloads](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.npmjs.org%2Fdownloads%2Fpoint%2Flast-year%2Fcontext-mode&query=%24.downloads&label=npm%20downloads%2C%20last%20365%20days&color=blue)](https://www.npmjs.com/package/context-mode) [![GitHub stars](https://img.shields.io/github/stars/mksglu/context-mode?style=flat&color=yellow)](https://github.com/mksglu/context-mode) [![Hacker News 570+ points](https://img.shields.io/badge/Hacker%20News-570%2B%20points-ff6600?logo=ycombinator&logoColor=white)](https://news.ycombinator.com/item?id=47193064) [![GitHub Trending](https://img.shields.io/badge/GitHub-Trending-black?logo=github)](https://github.com/uibm/trending-watcher/issues?q=%22mksglu%2Fcontext-mode%22) [![Discord](https://img.shields.io/discord/1478479412700909750?label=Discord&logo=discord&color=5865f2)](https://discord.gg/DCN9jUgN5v) [![License: ELv2](https://img.shields.io/badge/License-ELv2-blue.svg)](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/LICENSE)
6
+
7
+ > **Context Mode Gateway** takes the same idea from tool output to the whole conversation. It is an optional hosted service that works next to this plugin: Recall keeps long sessions searchable, and Memory shares what your agents learn across sessions and tools. The plugin stays free, local and open source. [See how the Gateway works](https://contextmode.ai/docs/how-saving-works)
8
+
9
+ <picture>
10
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.24/docs/assets/readme/hero-dark.png">
11
+ <img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.24/docs/assets/readme/hero-light.png" alt="Context Mode: tool output stays out of context. 10 coding agents, 9 MCP tools, 98.8% of output bytes saved (median of 25 rows with 10 KB or more of raw output).">
12
+ </picture>
13
+
14
+ **Figure 1.** Context Mode at a glance. The 98.8% is the median over the 25 bench rows with 10 KB or more of raw output, 5 runs each.
15
+
16
+ <p align="center">
17
+ <sub>Starred by engineers at</sub>
18
+ <br><br>
19
+ <a href="#"><img src="https://img.shields.io/badge/Microsoft-141414?style=flat" alt="Microsoft" /></a>
20
+ <a href="#"><img src="https://img.shields.io/badge/Google-141414?style=flat&logo=google&logoColor=white" alt="Google" /></a>
21
+ <a href="#"><img src="https://img.shields.io/badge/Meta-141414?style=flat&logo=meta&logoColor=white" alt="Meta" /></a>
22
+ <a href="#"><img src="https://img.shields.io/badge/Amazon-141414?style=flat" alt="Amazon" /></a>
23
+ <a href="#"><img src="https://img.shields.io/badge/IBM-141414?style=flat" alt="IBM" /></a>
24
+ <a href="#"><img src="https://img.shields.io/badge/NVIDIA-141414?style=flat&logo=nvidia&logoColor=white" alt="NVIDIA" /></a>
25
+ <a href="#"><img src="https://img.shields.io/badge/ByteDance-141414?style=flat&logo=bytedance&logoColor=white" alt="ByteDance" /></a>
26
+ <a href="#"><img src="https://img.shields.io/badge/Stripe-141414?style=flat&logo=stripe&logoColor=white" alt="Stripe" /></a>
27
+ <a href="#"><img src="https://img.shields.io/badge/Datadog-141414?style=flat&logo=datadog&logoColor=white" alt="Datadog" /></a>
28
+ <a href="#"><img src="https://img.shields.io/badge/Salesforce-141414?style=flat" alt="Salesforce" /></a>
29
+ <a href="#"><img src="https://img.shields.io/badge/GitHub-141414?style=flat&logo=github&logoColor=white" alt="GitHub" /></a>
30
+ <a href="#"><img src="https://img.shields.io/badge/Red%20Hat-141414?style=flat&logo=redhat&logoColor=white" alt="Red Hat" /></a>
31
+ <a href="#"><img src="https://img.shields.io/badge/Supabase-141414?style=flat&logo=supabase&logoColor=white" alt="Supabase" /></a>
32
+ <a href="#"><img src="https://img.shields.io/badge/Canva-141414?style=flat" alt="Canva" /></a>
33
+ <a href="#"><img src="https://img.shields.io/badge/Notion-141414?style=flat&logo=notion&logoColor=white" alt="Notion" /></a>
34
+ <a href="#"><img src="https://img.shields.io/badge/Hasura-141414?style=flat&logo=hasura&logoColor=white" alt="Hasura" /></a>
35
+ <a href="#"><img src="https://img.shields.io/badge/Framer-141414?style=flat&logo=framer&logoColor=white" alt="Framer" /></a>
36
+ <a href="#"><img src="https://img.shields.io/badge/Cursor-141414?style=flat&logo=cursor&logoColor=white" alt="Cursor" /></a>
37
+ </p>
38
+
39
+ ## Abstract
40
+
41
+ A coding agent reads files, runs commands and fetches pages, and every result goes into its context window.
42
+ One Playwright snapshot is 57.5 KB; one access log is 46.2 KB. The window fills, the agent compacts, and it forgets what it was doing.
43
+ Context Mode runs the tool work in a local sandbox, keeps the full output in a per-project SQLite index, and returns what the agent asks for.
44
+ On the 25 bench rows with 10 KB or more of raw output, it cut the bytes that reach the context by a median of 98.8%, measured with `ctx_bytes` against `raw_bytes`, 5 runs each.
45
+ Context Mode Gateway, an optional hosted service, takes the same idea to the whole conversation and all your agents. On a pre-registered long session with a 200K window it cut cost from $4.86 to $3.04 (2026-10-04) (-37.6%).
46
+ You can use both layers together. This paper gives the method, the numbers with their raw files, and the test setup behind each one.
47
+
48
+ ## 1. The problem
49
+
50
+ Each tool result goes into the context window whole. Table 1 lists real outputs from the bench, and what Context Mode returns for each.
51
+
52
+ **Table 1.** Raw output against the reply the agent sees (median of 5 runs, bench of 2026-10-31).
53
+
54
+ | Tool output | Raw | Reply | Cut |
55
+ |---|---:|---:|---:|
56
+ | Playwright page snapshot | 57,521 B | 315 B | 99.5% |
57
+ | 20 GitHub issues | 60,310 B | 1,156 B | 98.1% |
58
+ | Access log, 500 requests | 46,216 B | 171 B | 99.6% |
59
+ | `npm install` log | 37,761 B | 451 B | 98.8% |
60
+ | Big source file | 61,576 B | 489 B | 99.2% |
61
+ | Large git log | 191,120 B | 153 B | 99.9% |
62
+ | Docs page through WebFetch | 215,354 B | 435 B | 99.8% |
63
+
64
+ Rule for every headline number in this paper: rows with 10 KB or more of raw output, median per category.
65
+ The full results file has [every row, including small outputs, where the cut is smaller](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/bench/results/2026-10-31-darwin-arm64.md).
66
+
67
+ ## 2. Results
68
+
69
+ <picture>
70
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.24/docs/assets/readme/fig-saving-dark.png">
71
+ <img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.24/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.3%, Batch 93.1%, Externalize 92.3%, Hook redirect 99.8%, Session total 98.8%.">
72
+ </picture>
73
+
74
+ **Figure 2.** Median bytes saved per category, rows of 10 KB or more.
75
+
76
+ **Table 2.** Bytes kept out of context, by category (rule: raw output of 10 KB or more, median per category).
77
+
78
+ | Category | What runs | Rows | Median cut |
79
+ |---|---|---:|---:|
80
+ | a. Sandbox | `ctx_execute` on a file or command | 10 | 99.3% |
81
+ | c. Batch | `ctx_batch`: many commands, then search | 2 | 93.1% |
82
+ | d. Externalize | Host tool output over the cap, indexed whole | 4 | 92.3% |
83
+ | f. Hook redirect | A big Read, curl or WebFetch sent to the sandbox | 5 | 99.8% |
84
+ | g. Session total | One full scripted session | 1 | 98.8% |
85
+
86
+ Search replies (category b) return text on purpose; they are in the full file. Bench on 2.0.0-next.8, macOS arm64, 2026-10-31.
87
+ Reproduce: `cd bench && node run.mjs`. Method and every data file: [bench/README.md](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/bench/README.md), [bench/evidence/](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/bench/evidence/README.md).
88
+ The plugin numbers are bytes; the dollar numbers come from the Gateway runs in section 8.
89
+
90
+ ### 2.1 Case studies
91
+
92
+ **Case 1. A browser snapshot.** Problem: one Playwright snapshot is 57,521 B, and an agent takes many per task.
93
+ Action: the agent runs the snapshot through `ctx_execute` and prints the fields it needs.
94
+ Result: 315 B reach the context, a 99.5% cut, measured over 5 runs.
95
+
96
+ **Case 2. A docs page.** Problem: a WebFetch of the SQLite FTS5 page returns 215,354 B.
97
+ Action: the `PreToolUse` hook denies the fetch and routes it to `ctx_index`, which keeps the page, and `ctx_search`, which returns the part asked for.
98
+ Result: a 435 B reply instead of 215,354 B, a 99.8% cut. The hook took 54 ms.
99
+
100
+ **Case 3. A long session (Gateway).** Task: a long Claude Code session on a 200K window.
101
+ Action: the same task through Context Mode Gateway with Recall, 3 pairs, with a rule fixed before the run.
102
+ Result: cost fell from $4.86 to $3.04 (2026-10-04) (-37.6%). 3 of 3 pairs passed.
103
+
104
+ ### 2.2 Longer sessions
105
+
106
+ <picture>
107
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.24/docs/assets/readme/fig-oss-dark.png">
108
+ <img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.24/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.">
109
+ </picture>
110
+
111
+ **Figure 3.** Each tool call: the hook sends large output to the sandbox or the index, the full copy goes into `context.db`, and the agent gets a small reply. At compaction: a snapshot of at most 2,048 B keeps the state, and `ctx_resume` and `ctx_search` read it back.
112
+
113
+ The context grows with each reply, and the replies stay small. Bench of 2026-10-31, median of 5 runs, [bench/results/2026-10-31-darwin-arm64.json](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/bench/results/2026-10-31-darwin-arm64.json):
114
+
115
+ - Debugging session, 8 real outputs and 3 searches: 274.7 KB raw, 3.4 KB entered the context. Row [g-session-total](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/bench/g-overhead/README.md#g-session-total).
116
+ - Long session, 40 outputs, then compaction: a 432.5 KB transcript, a 2.0 KB `ctx_resume` block. Row [e-long-session](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/bench/e-continuity/README.md#e-long-session).
117
+ - One large log: 651.2 KB of output, a 15.3 KB reply; `ctx_search` finds its first, middle and last line (3 of 3). Row [d-synth-1m](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/bench/d-externalize/README.md#d-synth-1m).
118
+
119
+ ## Install
120
+
121
+ Use your agent's own install command. You need Node 24.15.0 or later (v2 uses the built-in `node:sqlite`). On Windows you also need Git for Windows: the shell tools run in Git Bash, and `context-mode doctor` check D11 (shell) checks for it.
122
+
123
+ | Agent | Install | Update |
124
+ |---|---|---|
125
+ | Claude Code | `claude plugin marketplace add mksglu/context-mode#release`, then `claude plugin install context-mode@context-mode` | `claude plugin update context-mode@context-mode` |
126
+ | Codex | `codex plugin marketplace add mksglu/context-mode@release`, then `codex plugin add context-mode@context-mode` | `codex plugin marketplace upgrade context-mode` |
127
+ | Gemini CLI | `gemini extensions install https://github.com/mksglu/context-mode --ref release` | `gemini extensions update context-mode` |
128
+ | Qwen Code | `qwen extensions install https://github.com/mksglu/context-mode:context-mode --ref release` | `qwen extensions update context-mode` |
129
+ | Pi | `pi install npm:context-mode@next` | `pi update --extensions` |
130
+ | OpenCode | `opencode plugin add context-mode@next` (1.19: `opencode plugin context-mode@next --global`) | `opencode plugin update` (1.19: `opencode plugin context-mode@next --global --force`) |
131
+
132
+ Until v2 is on `main`, `main` holds the old build (1.0.169), so the four GitHub-source rows name the `release` branch with each agent's own syntax.
133
+
134
+ After v2 is on main: `claude plugin marketplace add mksglu/context-mode`, `codex plugin marketplace add mksglu/context-mode`, `gemini extensions install https://github.com/mksglu/context-mode`, `qwen extensions install https://github.com/mksglu/context-mode:context-mode`
135
+
136
+ Already installed from GitHub on `main`? Each agent page has the steps to switch to the `release` ref: see "Already installed from GitHub?" in [Claude Code](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/install/claude-code.md#already-installed-from-github), [Codex](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/install/codex.md#already-installed-from-github), [Gemini CLI](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/install/gemini.md#already-installed-from-github) and [Qwen Code](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/install/qwen.md#already-installed-from-github).
137
+
138
+ Copilot CLI, Kiro, VS Code and ZCode install through npm, which works for every agent:
139
+
140
+ ```sh
141
+ npm i -g context-mode@next
142
+ context-mode setup
143
+ ```
144
+
145
+ `next` is the v2 prerelease tag on npm. `latest` points to the old release, so add `@next` to get v2.
146
+ Restart the agent, then check: `context-mode doctor` (or `/ctx-doctor` in the agent). Each check prints PASS, or FAIL with the command that fixes it.
147
+ `context-mode setup` is the fallback and the repair. It shows a plan, applies it, and rolls back an agent that fails.
148
+ Uninstall: `context-mode setup --remove && npm rm -g context-mode`. Details: [docs/install/README.md](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/install/README.md).
149
+
150
+ Every agent gets hooks, the MCP server and the skills. The Install column is the agent's own install command, or the npm route for the other four agents.
151
+
152
+ <!-- agents:install:start (node build/readme-agents.mjs --write) -->
153
+ | Agent | Hooks | MCP | Skills | Install | Guide |
154
+ |---|---|---|---|---|---|
155
+ | Claude Code | yes, package | yes | yes | `claude plugin install context-mode@context-mode` | [docs/install/claude-code.md](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/install/claude-code.md#install) |
156
+ | Codex | yes, hook file | yes | yes | `codex plugin add context-mode@context-mode` | [docs/install/codex.md](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/install/codex.md#install) |
157
+ | Copilot CLI | yes, hook file | yes | yes | npm + `context-mode setup` | [docs/install/copilot-cli.md](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/install/copilot-cli.md#install) |
158
+ | Gemini CLI | yes, package | yes | yes | `gemini extensions install https://github.com/mksglu/context-mode --ref release` | [docs/install/gemini.md](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/install/gemini.md#install) |
159
+ | Kiro | yes, hook file | yes | yes | npm + `context-mode setup` | [docs/install/kiro.md](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/install/kiro.md#install) |
160
+ | OpenCode | yes, in-process | yes | yes | `opencode plugin add context-mode@next` | [docs/install/opencode.md](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/install/opencode.md#install) |
161
+ | Pi | yes, in-process | in-process | yes | `pi install npm:context-mode@next` | [docs/install/pi.md](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/install/pi.md#install) |
162
+ | Qwen Code | yes, package | yes | yes | `qwen extensions install https://github.com/mksglu/context-mode:context-mode --ref release` | [docs/install/qwen.md](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/install/qwen.md#install) |
163
+ | VS Code (Copilot) | yes, hook file | yes | yes | npm + `context-mode setup` | [docs/install/vscode.md](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/install/vscode.md#install) |
164
+ | ZCode | yes, hook file | yes | yes | npm + `context-mode setup` | [docs/install/zcode.md](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/install/zcode.md#install) |
165
+ <!-- agents:install:end -->
166
+
167
+ ## 3. How it works
168
+
169
+ <picture>
170
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.24/docs/assets/readme/fig-flow-dark.png">
171
+ <img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.24/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.">
172
+ </picture>
173
+
174
+ **Figure 4.** One tool call, step by step. Output stays in the sandbox and the index; the agent gets the answer.
175
+
176
+ Context Mode has three parts: hooks, an MCP server with nine tools, and one SQLite database per project.
177
+
178
+ ### 3.1 Hooks
179
+
180
+ The hooks listen to four events: `SessionStart`, `UserPromptSubmit`, `PreToolUse`, `PostToolUse`. Gemini CLI, VS Code and OpenCode also send a compaction event; each host keeps its own event names.
181
+ `PreToolUse` checks rules in a fixed order: the user's deny list, WebFetch, curl and HTTP or build commands, then Read and shell dumps.
182
+ Context Mode denies a full-file `Read` of a file over 16,384 B, and the deny message names the exact `ctx_execute` call to use. A `Read` with a range still runs.
183
+ A hook always exits 0: on any error it gives the host's "allow" reply and writes one log line, so your agent keeps working. Spawned hooks time out after 5,000 ms.
184
+
185
+ ### 3.2 Sandbox execution
186
+
187
+ `ctx_execute` writes the script to a temp folder and runs it as a subprocess: shell, PowerShell, JavaScript, TypeScript, Python, or any runtime found on `PATH`.
188
+ It spawns the runtime directly from an argument list, in the project folder. The default and maximum timeout is 600,000 ms; on timeout it kills the whole process group (`taskkill /F /T` on Windows).
189
+ The child gets the parent environment minus the preload variables (`NODE_OPTIONS`, `BUN_OPTIONS`, `DENO_OPTIONS` and similar). The agent gets what the script prints, cut on a whole character.
190
+
191
+ ### 3.3 Index and search
192
+
193
+ Each output goes into SQLite FTS5 twice: a Porter-stemmed table for words, and a trigram table for paths, names and parts of words.
194
+ `ctx_search` ranks each table with BM25 and joins the two lists with Reciprocal Rank Fusion: a hit scores 1/(60 + rank) in each list.
195
+ On zero matches, it tries a spelling fix from the indexed words. Search covers one of three scopes: this session, this worktree (the default) or the whole project.
196
+ Chunks are at most 4,096 B. A Markdown chunk stays inside one heading section and carries its heading path as its title. A code block that fits in a chunk stays whole; a bigger one splits on blank lines, and each piece repeats the fence.
197
+ A reply snippet is at most 800 B, or a whole code block up to 2,048 B.
198
+
199
+ ### 3.4 Large output, run and replace
200
+
201
+ When a host tool returns more than the cap, `PostToolUse` indexes the whole output and replaces it.
202
+ The agent gets the best-matching whole chunks and one `ctx_search` line for the rest. Context Mode keeps the full text in the index.
203
+
204
+ ### 3.5 Session continuity
205
+
206
+ The hooks log each prompt, edit, command, tool error, index, cost and decision.
207
+ After a compaction the agent gets a state block of at most 2,048 B built from that log. Every line stays whole: a long line becomes a `ctx_resume(seq)` pointer that reads the full row.
208
+ On the next prompt, a recall block of at most 2,048 B brings back the log rows that match it by BM25, always as whole rows. The same rows always give the same bytes.
209
+
210
+ ### 3.6 Storage
211
+
212
+ Context Mode uses Node's built-in `node:sqlite`, so the install compiles zero native modules. Each project gets one `context.db` under `~/.context-mode`.
213
+ The database runs in WAL mode. On close it always runs a PASSIVE checkpoint. Context Mode builds a new database under a temp name, then moves it into place in one step, so the file on disk is always complete, even after a crash. Busy timeout: 5,000 ms.
214
+
215
+ ## 4. Tools
216
+
217
+ | Tool | What it does |
218
+ |---|---|
219
+ | `ctx_execute` | Runs code or a shell command in a sandbox; returns what it prints |
220
+ | `ctx_batch` | Runs many commands, indexes the output, and searches it in one call |
221
+ | `ctx_index` | Indexes a file, a text or a URL into the project database |
222
+ | `ctx_search` | Searches the index; returns the matching parts |
223
+ | `ctx_resume` | Returns the state block, or one full row by `seq` |
224
+ | `ctx_stats` | Shows how much output stayed out of context |
225
+ | `ctx_doctor` | Checks the install; each FAIL line names its fix |
226
+ | `ctx_upgrade` | Installs, upgrades or uninstalls; replaces old context-mode entries |
227
+ | `ctx_purge` | Deletes indexed data by session, source or project |
228
+
229
+ Full reference: [docs/tools.md](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/tools.md).
230
+
231
+ ## Commands
232
+
233
+ | Command | What it does |
234
+ |---|---|
235
+ | `/ctx-stats` | Calls `ctx_stats` and shows the result |
236
+ | `/ctx-doctor` | Calls `ctx_doctor`; use its report when you report a defect |
237
+ | `/ctx-upgrade` | Calls `ctx_upgrade`, then `ctx_doctor` |
238
+
239
+ ## 5. Harness: ten agents
240
+
241
+ Every agent in the Install table gets hooks, the MCP server and the skills, through that agent's own install command.
242
+ 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-process (OpenCode, Pi).
243
+
244
+ Live proof, written for 2.0.0-next.15: we watched the real agent binary run our hook in a clean temp home, logged out and with zero API keys, for 8 of 10 agents.
245
+ VS Code and Kiro are at an earlier step: the VS Code hook command works with the documented payload (VS Code 1.144.0 sent 0 requests in the live run), and kiro-cli 2.35.2 loads all 6 hook entries (the live run recorded 0 hook fires).
246
+ 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](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/architecture/release/HOOKS-FIRE.md).
247
+
248
+ ## 6. Performance
249
+
250
+ **Table 3.** Time cost, median of 5 runs, bench of 2026-10-31.
251
+
252
+ | Measure | Result |
253
+ |---|---|
254
+ | Hook time over a bare `node` start, per agent | 7.3 ms to 14.6 ms |
255
+ | `ctx_search`, 20 queries over 8 indexed files | 1.73 ms median, 6.54 ms max |
256
+ | `ctx_index`, 3 real files, 0.6 MB | 155 ms per MB |
257
+
258
+ Rows per agent and per query: [docs/performance.md](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/performance.md).
259
+
260
+ ## 7. Security model
261
+
262
+ - All data stays on your machine, in `~/.context-mode`: one `context.db` per project.
263
+ - Runs fully local: SQLite FTS5 and your own runtimes.
264
+ - Network use: npm or git (to the release repository) when you install or upgrade, `git ls-remote` in doctor (to check for a new version), and your agent's own install steps.
265
+ - `ctx_index` fetches a URL when the agent asks for it. It blocks private and link-local addresses. It checks each address the host name points to, connects to the address it checked, and checks again at each redirect.
266
+ - Doctor and the debug report remove secrets by their structure before they print.
267
+
268
+ Here "sandbox" means the output stays in the sandbox, out of the context.
269
+ Code from `ctx_execute` runs on your host as your user, with your environment (minus the preload variables), your files and your network; keep your agent's own permission prompts on.
270
+
271
+ ## 8. Context Mode Gateway
272
+
273
+ The plugin works on tool output, on your machine. Context Mode Gateway is a hosted service that works on every request, across all your agents: Recall, Memory, Skills, Search and Protect.
274
+ Teams add it for long sessions, shared memory and cost reports. The two work together.
275
+
276
+ <a href="https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/assets/readme/gateway/overview.webp"><img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.24/docs/assets/readme/gateway/overview-1200.webp" alt="Gateway Overview: money saved, AI spend, prompt-cache discount and cost per request over 30 days" width="100%"></a>
277
+
278
+ **Overview.** What you paid and what the Gateway saved, per day, in one view.
279
+
280
+ <table>
281
+ <tr>
282
+ <td width="50%" valign="top">
283
+ <a href="https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/assets/readme/gateway/analytics.webp"><img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.24/docs/assets/readme/gateway/analytics-1200.webp" alt="Gateway Analytics: saved money over time, split by source" width="100%"></a><br>
284
+ <b>Analytics.</b> Where each saving comes from: hidden tools, archived old results, large outputs kept in the archive and trimmed context.
285
+ </td>
286
+ <td width="50%" valign="top">
287
+ <a href="https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/assets/readme/gateway/spend.webp"><img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.24/docs/assets/readme/gateway/spend-1200.webp" alt="Gateway Spend: spend per day by model, cost per request and cache hit rate" width="100%"></a><br>
288
+ <b>Spend.</b> Spend per day and per model, cost per request and the cache hit rate, to help you plan a budget.
289
+ </td>
290
+ </tr>
291
+ <tr>
292
+ <td width="50%" valign="top">
293
+ <a href="https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/assets/readme/gateway/memory.webp"><img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.24/docs/assets/readme/gateway/memory-top-1200.webp" alt="Gateway Memory: money saved by Recall and searches per day" width="100%"></a><br>
294
+ <b>Memory.</b> Facts and decisions carry across sessions and agents. The screen shows what Recall saved and how many searches found an answer.
295
+ </td>
296
+ <td width="50%" valign="top">
297
+ <a href="https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/assets/readme/gateway/skills.webp"><img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.24/docs/assets/readme/gateway/skills-1200.webp" alt="Gateway Skills: import from GitHub and the list of installed skills" width="100%"></a><br>
298
+ <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.
299
+ </td>
300
+ </tr>
301
+ <tr>
302
+ <td colspan="2" align="center">
303
+ <a href="https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/assets/readme/gateway/protect.webp"><img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.24/docs/assets/readme/gateway/protect-1200.webp" alt="Gateway Protect: a new command rule that blocks terraform destroy" width="50%"></a><br>
304
+ <b>Protect.</b> Rules that check each shell command before it runs. Here, a rule that stops <code>terraform destroy</code>.
305
+ </td>
306
+ </tr>
307
+ </table>
308
+
309
+ Numbers in these screenshots 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.
310
+
311
+ **Table 4.** Context Mode Gateway features, from [contextmode.ai/docs](https://contextmode.ai/docs/how-saving-works).
312
+
313
+ | Feature | What it does | What you get | Details |
314
+ |---|---|---|---|
315
+ | Context Saving | Folds old tool output, runs data work as code (Thinking in Code), trims tool schemas, places cache marks | Tool schemas 102,784 B to 33,611 B per request (-67.3%); a tool output over 2,048 B becomes a pointer of about 285 B, with the full copy archived | Saves the most on sessions with many tool calls; A/B measured in Claude Code |
316
+ | Recall | The model sees recent work and an index of older work; the agent searches the archive for the rest | 200K window, 2026-10-04: mean cost per session $4.86 to $3.04 (-37.6%) | Cost measured in Claude Code on Claude Opus 5.5 |
317
+ | 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 |
318
+ | 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 |
319
+ | 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 |
320
+ | 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 |
321
+ | 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 |
322
+ | 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 |
323
+ | 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 |
324
+ | 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 |
325
+ | 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 |
326
+
327
+ Gateway cost against Claude Code alone, Claude Opus 5.5, mean dollars per session at list price:
328
+
329
+ - Six short tasks (2026-09-29): 24.5% cheaper pooled over 176 sessions (21% to 29% per task). [v3-opus55-short.json](https://contextmode.ai/benchmarks/data/v3-opus55-short.json)
330
+ - Long Claude Code session, 200K window (2026-10-03/04): mean cost per session $4.86 to $3.04 (-37.6%). [ab.json](https://contextmode.ai/benchmarks/recall/200k-r2/ab.json)
331
+ - We fixed the rules before each run: [contextmode.ai/docs/benchmarks](https://contextmode.ai/docs/benchmarks).
332
+
333
+ Apps: Claude Code, Claude Desktop, Codex, Codex Desktop, T3 Code, OpenCode and Pi.
334
+ Setup is one command, `npx @context-mode/cli`. It signs you in and writes one config change per agent (it needs Node 20.12 or later).
335
+ Your own Claude or OpenAI account pays the model directly, at the provider's price.
336
+
337
+ The Gateway routes to Anthropic and OpenAI. Requests pass through the Gateway server on their way to the model.
338
+ Keep your agent's own sandbox on next to Protect.
339
+ More at [contextmode.ai](https://contextmode.ai).
340
+
341
+ ## 9. Adoption
342
+
343
+ <picture>
344
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.24/docs/assets/readme/star-history-dark.png">
345
+ <img src="https://raw.githubusercontent.com/mksglu/context-mode/v2.0.0-next.24/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.">
346
+ </picture>
347
+
348
+ **Figure 5.** GitHub stars over time, from the stargazers API (GraphQL, `starredAt`). A daily job redraws the chart; the date it was read is in the chart caption.
349
+
350
+ - **npm downloads.** The badge at the top shows all-time downloads of the npm package, read daily from the npm API ([stats.json](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/stats.json)). We have no count for plugin marketplace installs.
351
+ - **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)).
352
+ - **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)).
353
+ - **Companies.** Engineers at the companies under Figure 1 starred the repo.
354
+
355
+ ## License
356
+
357
+ [Elastic License 2.0](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/LICENSE) (ELv2), source-available. You may use, copy, change and share the code, and use it at work.
358
+ The license keeps two uses for the licensor:
359
+
360
+ 1. Offering it to others as a hosted or managed service.
361
+ 2. Removing, hiding or getting around its license notices or license key functions.
362
+
363
+ We chose ELv2 so the source stays open to all and the hosted service stays with the project.
364
+
365
+ ## Support
366
+
367
+ Report a defect on [Discord](https://discord.gg/DCN9jUgN5v) with the full `/ctx-doctor` report.
368
+ Fixes go into v2. The maintainer writes every change; send ideas and defect reports on Discord.
369
+
370
+ Docs: [docs/install/README.md](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/install/README.md) (install, options, uninstall), [docs/how-it-works.md](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/how-it-works.md), [docs/algorithms.md](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/algorithms.md) (search, ranking, size limits, deny rules), [docs/tools.md](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/docs/tools.md), [bench/evidence/](https://github.com/mksglu/context-mode/blob/v2.0.0-next.24/bench/evidence/README.md).
package/SHA256SUMS CHANGED
@@ -1,19 +1,21 @@
1
- 165869a62deee3b5b6cb012173c4a14dd1c52d3e0681f6a91d6c8caa5ebbdbe8 .claude-plugin/marketplace.json
2
- 044bb3c5a05673a5240641467aac7448ddd4f5f025dc329aa2cdf8e5cbdff94a .claude-plugin/plugin.json
1
+ a2a63ee58a2ed92717a1e47ae390df2aca8a64df740e7f038eb28953d0d9ccbf .claude-plugin/marketplace.json
2
+ 4a3f3c9a9fd0fad85ce90ff0755344070219a5959dcadcc69e77469caf4e9632 .claude-plugin/plugin.json
3
3
  187503e1455560d4ab5a72e3b8cd2f274abd4ccc5faa60dd66c37e44bb5f10c2 .codex-plugin/hooks.json
4
4
  4edea851775bc3f0418f8d9cf6ead74f2767c3a9e3b8c05749eacb78ebb3b896 .codex-plugin/mcp.json
5
- bc9bbf3cd51e3b435c5abfed675b2e64875e6d816e7f7e21d53f6c7add8d596a .codex-plugin/plugin.json
5
+ db62d2deddaa207d25755d0bf80a7d6de99bcf354dfa64877cca0a6a01371cf1 .codex-plugin/plugin.json
6
+ 92f11a867c41c9e575ccb978ff205ae2011c244a14aa3c576e914e537105caa0 LICENSE
7
+ dd911c817fceb24b25a09751bf3e46be576220c248109425190c0bc7cc2ebdfd README.md
6
8
  1773e40a89384dd1af9023ba533da1908f3e2435dbaaa7cc941edf0514148313 claude-code/skills/ctx-doctor/SKILL.md
7
9
  34fffb9c76d69c551f07036230bec0fbaca7a69177a5a47f89ddb9a9990a1fa2 claude-code/skills/ctx-stats/SKILL.md
8
10
  d8f835d2f2b3eb70c5902f8707e7c5857977cec9e20ace76c499378a04e178e0 claude-code/skills/ctx-upgrade/SKILL.md
9
- a69c0fac9c978267f9e8676a6fe9c754a72a3e898975be5e78d90698c7142961 cli.mjs
11
+ c0968a76caa87064a8a1660551e4a29d92dcfd8ef98f2efca40f1f15da3843ad cli.mjs
10
12
  83c297020ed0c592fc68c9c482546a6999d41df5d06d8a329498f10edb1bd38e codex/skills/ctx-doctor/SKILL.md
11
13
  adc2c374f699d3698110920bb48411965de09fc6e7232ce59c913f6d58c0d738 codex/skills/ctx-stats/SKILL.md
12
14
  5c12cdd19a5e3ed7d9ba3a47b24d03864a28d36cf7006876284ee07cd4221ec4 codex/skills/ctx-upgrade/SKILL.md
13
- e372775315fe13ff8cd764ae99194d8632394df2afe450c4ab3bf860768580e1 copilot/plugin.json
15
+ b7c1307599b8cd49eba152f55f220181bcb61d86bfafc386d5fd8b4af6a3bd13 copilot/plugin.json
14
16
  e3bc6cae0bd51b806d81631879711bbc48c679fc929b2642ed4634438364167d fixtures/hook-roundtrip.json
15
- bffb8b6749c095cd9e04f7d1425d43c2e0901ad3be461c3e4d9134998caa5692 gemini-extension.json
16
- b58303ab9c463e36c85ad20ecf375080c049d82f7dd1e2dd5fbcff4b8830a72c hook.mjs
17
+ 16a2bc1aed85e34b142bdac12121ce158ea54a3bca2a4f0b7ebf0d4e0ed22fee gemini-extension.json
18
+ 267bf4439ff4aaedc6e4a0c00853a8ddaf812698bd039848871de0468c5e3438 hook.mjs
17
19
  1f8d8650d2b38737522cab6b875878e8baf84a74acf98cd924c7af22852d873f hooks/claude-code.json
18
20
  2524a0eb52683b65c65943c5097db513e9845ba14e84324b39e9a8ea2bb43193 hooks/codex.json
19
21
  b656fed2b754ebcfd4c156bee81d5879c21a8083fc0d6b8e3241462b63a214b6 hooks/copilot-cli.json
@@ -22,16 +24,16 @@ f336d1db67de49e641687bbd41ba1a9424e31dfe2377b2284bf44358288ebd8b hooks/kiro.jso
22
24
  017c9cc3997dd53231b8548b1a1609fddc51177af53501565a4f334602039860 hooks/qwen.json
23
25
  33f69267645338d0dc392ce551dcd7c69a0b508113469d6ea637d3f34239ef1d hooks/vscode.json
24
26
  085630bccf2073ac9a62be24ef91dfc47d106092dc82c822db70890b7d3ae1c0 hooks/zcode.json
25
- d51db0a046e4486d6377736ba32327ce6c9566f2535931443d9b0a5abfed1576 opencode/plugin.js
26
- e88f76b852557c6c7fa1e649ac08b08f40cf7aa2c67b59bf2a25637d7c742dd9 package.json
27
- 71ab89de628b406b73abbdb7fa7d00e73476f9b8e950abc18e9541e812971db5 pi/index.js
27
+ a8d0b494f7a40848ea2d195ab6e69049ae8eeacd7689f73af2e8ce203721c27b opencode/plugin.js
28
+ 26422a0b65aa444df50a55f3f6eec38ab07cd9efdcb3dedbeda2537c88e326ce package.json
29
+ c14199ebbcb4be47687356899e020658e3d8e6d83dfa38ef9303566e922820f7 pi/index.js
28
30
  8712881622c9905aa4836af50d903042d34a91506264e459bc7839331f6f0192 pi/skills/ctx-doctor/SKILL.md
29
31
  8d6e8e2a82eb079bddc60727f52d9f9a6e0bf9e15391357fed82ee76ab5fe76c pi/skills/ctx-stats/SKILL.md
30
32
  db6f9c006bc864a7271f1eeffb1e316ebb537a3414f1c22f8b9de0a896e8e3c5 pi/skills/ctx-upgrade/SKILL.md
31
- d427874ecb88898b3baf0c03595efc065c91a99b4b195aa62dfa5b99ee921ec2 qwen-extension.json
32
- 28a957921c1dd24aef587fc0f8c6835de1cbbe49eff18104c5d1dd70c0297aad run.mjs
33
- 28a957921c1dd24aef587fc0f8c6835de1cbbe49eff18104c5d1dd70c0297aad search.mjs
34
- 0f0dd8289d6396222e64957332991b8654d18c1fac63b692db2a1f26117fbd17 server.mjs
33
+ b7d65d5a3ebe1dee5483858f3ffbe387a5611ece1515cb255d21f42dcdfb7380 qwen-extension.json
34
+ b74f2327edb59f5dd2c832c43e7f6be7dd01dc0c48c0fa93c13f5a453767a513 run.mjs
35
+ b74f2327edb59f5dd2c832c43e7f6be7dd01dc0c48c0fa93c13f5a453767a513 search.mjs
36
+ 69d9371ccc157616fdfc1e91c61ae702e03a89a5648a32ed6480e0c203eb24ab server.mjs
35
37
  e5503a22a6238901484d123efc11d2d933aa9a54c6ac2018812cfa65ec4e53e3 skills/ctx-doctor/SKILL.md
36
38
  1044587a1906c69f2467c089a25e19819a290ea5728389bd1f086c6dfc0d0c51 skills/ctx-stats/SKILL.md
37
39
  c1cac75b7506ee0d06089ce611ac6dc9314cf12435da318ce88ad50e2c5debbf skills/ctx-upgrade/SKILL.md