context-mode 1.0.161 → 1.0.163
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 +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.openclaw-plugin/openclaw.plugin.json +1 -1
- package/.openclaw-plugin/package.json +1 -1
- package/README.md +142 -28
- package/bin/statusline.mjs +24 -4
- package/build/adapters/antigravity/index.d.ts +1 -1
- package/build/adapters/antigravity-cli/index.d.ts +51 -0
- package/build/adapters/antigravity-cli/index.js +341 -0
- package/build/adapters/claude-code/hooks.d.ts +1 -0
- package/build/adapters/claude-code/hooks.js +3 -0
- package/build/adapters/claude-code/index.js +24 -5
- package/build/adapters/client-map.js +5 -0
- package/build/adapters/codex/hooks.d.ts +5 -1
- package/build/adapters/codex/hooks.js +5 -1
- package/build/adapters/codex/index.d.ts +9 -1
- package/build/adapters/codex/index.js +87 -5
- package/build/adapters/copilot-cli/hooks.d.ts +33 -0
- package/build/adapters/copilot-cli/hooks.js +64 -0
- package/build/adapters/copilot-cli/index.d.ts +48 -0
- package/build/adapters/copilot-cli/index.js +341 -0
- package/build/adapters/detect.d.ts +1 -1
- package/build/adapters/detect.js +71 -3
- package/build/adapters/openclaw/mcp-tools.js +1 -1
- package/build/adapters/opencode/index.js +31 -17
- package/build/adapters/opencode/zod3tov4.js +27 -6
- package/build/adapters/pi/extension.d.ts +2 -12
- package/build/adapters/pi/extension.js +114 -96
- package/build/adapters/types.d.ts +5 -4
- package/build/adapters/types.js +4 -3
- package/build/cache-heal.d.ts +48 -0
- package/build/cache-heal.js +150 -0
- package/build/cli.js +37 -97
- package/build/executor.d.ts +25 -0
- package/build/executor.js +143 -22
- package/build/opencode-plugin.js +5 -2
- package/build/routing-block.d.ts +8 -0
- package/build/routing-block.js +86 -0
- package/build/runtime.d.ts +0 -36
- package/build/runtime.js +107 -27
- package/build/search/flood-guard.d.ts +57 -0
- package/build/search/flood-guard.js +80 -0
- package/build/security.d.ts +8 -3
- package/build/security.js +155 -29
- package/build/server.d.ts +14 -0
- package/build/server.js +368 -350
- package/build/session/analytics.d.ts +8 -8
- package/build/session/analytics.js +18 -13
- package/build/session/db.d.ts +1 -0
- package/build/session/db.js +37 -4
- package/build/session/extract.d.ts +46 -0
- package/build/session/extract.js +764 -13
- package/build/session/project-attribution.js +14 -0
- package/build/store.d.ts +1 -1
- package/build/store.js +139 -25
- package/build/tool-naming.d.ts +4 -0
- package/build/tool-naming.js +24 -0
- package/build/util/jsonc.d.ts +14 -0
- package/build/util/jsonc.js +104 -0
- package/cli.bundle.mjs +260 -254
- package/configs/antigravity/GEMINI.md +2 -2
- package/configs/antigravity-cli/hooks/hooks.json +37 -0
- package/configs/antigravity-cli/hooks.json +37 -0
- package/configs/antigravity-cli/mcp_config.json +10 -0
- package/configs/antigravity-cli/plugin.json +14 -0
- package/configs/antigravity-cli/rules/context-mode.md +77 -0
- package/configs/antigravity-cli/skills/context-mode/SKILL.md +77 -0
- package/configs/claude-code/CLAUDE.md +2 -2
- package/configs/codex/AGENTS.md +2 -2
- package/configs/copilot-cli/.github/plugin/plugin.json +23 -0
- package/configs/copilot-cli/.mcp.json +12 -0
- package/configs/copilot-cli/README.md +47 -0
- package/configs/copilot-cli/hooks.json +41 -0
- package/configs/copilot-cli/skills/context-mode/SKILL.md +38 -0
- package/configs/gemini-cli/GEMINI.md +2 -2
- package/configs/jetbrains-copilot/copilot-instructions.md +2 -2
- package/configs/kilo/AGENTS.md +2 -2
- package/configs/kiro/KIRO.md +2 -2
- package/configs/omp/SYSTEM.md +2 -2
- package/configs/openclaw/AGENTS.md +2 -2
- package/configs/opencode/AGENTS.md +2 -2
- package/configs/qwen-code/QWEN.md +2 -2
- package/configs/vscode-copilot/copilot-instructions.md +2 -2
- package/configs/zed/AGENTS.md +2 -2
- package/hooks/antigravity-cli/payload.mjs +98 -0
- package/hooks/antigravity-cli/posttooluse.mjs +138 -0
- package/hooks/antigravity-cli/pretooluse.mjs +78 -0
- package/hooks/antigravity-cli/stop.mjs +58 -0
- package/hooks/codex/pretooluse.mjs +14 -4
- package/hooks/codex/stop.mjs +12 -4
- package/hooks/copilot-cli/posttooluse.mjs +79 -0
- package/hooks/copilot-cli/precompact.mjs +66 -0
- package/hooks/copilot-cli/pretooluse.mjs +41 -0
- package/hooks/copilot-cli/sessionstart.mjs +121 -0
- package/hooks/copilot-cli/stop.mjs +59 -0
- package/hooks/copilot-cli/userpromptsubmit.mjs +77 -0
- package/hooks/core/codex-caps.mjs +112 -0
- package/hooks/core/formatters.mjs +158 -7
- package/hooks/core/mcp-ready.mjs +37 -8
- package/hooks/core/routing.mjs +94 -8
- package/hooks/core/tool-naming.mjs +3 -0
- package/hooks/hooks.json +12 -1
- package/hooks/pretooluse.mjs +6 -2
- package/hooks/routing-block.mjs +2 -2
- package/hooks/security.bundle.mjs +2 -1
- package/hooks/session-db.bundle.mjs +11 -7
- package/hooks/session-directive.mjs +88 -20
- package/hooks/session-extract.bundle.mjs +2 -2
- package/hooks/session-helpers.mjs +21 -0
- package/hooks/session-loaders.mjs +8 -5
- package/hooks/sessionstart.mjs +53 -7
- package/hooks/stop.mjs +49 -0
- package/hooks/userpromptsubmit.mjs +9 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +4 -10
- package/scripts/install-antigravity-cli-plugin.mjs +141 -0
- package/server.bundle.mjs +214 -205
- package/skills/ctx-insight/SKILL.md +12 -17
- package/build/util/db-lock.d.ts +0 -65
- package/build/util/db-lock.js +0 -166
- package/insight/index.html +0 -13
- package/insight/package.json +0 -55
- package/insight/server.mjs +0 -1265
- package/insight/src/components/analytics.tsx +0 -112
- package/insight/src/components/ui/badge.tsx +0 -52
- package/insight/src/components/ui/button.tsx +0 -58
- package/insight/src/components/ui/card.tsx +0 -103
- package/insight/src/components/ui/chart.tsx +0 -371
- package/insight/src/components/ui/collapsible.tsx +0 -19
- package/insight/src/components/ui/input.tsx +0 -20
- package/insight/src/components/ui/progress.tsx +0 -83
- package/insight/src/components/ui/scroll-area.tsx +0 -55
- package/insight/src/components/ui/separator.tsx +0 -23
- package/insight/src/components/ui/table.tsx +0 -114
- package/insight/src/components/ui/tabs.tsx +0 -82
- package/insight/src/components/ui/tooltip.tsx +0 -64
- package/insight/src/lib/api.ts +0 -144
- package/insight/src/lib/utils.ts +0 -6
- package/insight/src/main.tsx +0 -22
- package/insight/src/routeTree.gen.ts +0 -189
- package/insight/src/router.tsx +0 -19
- package/insight/src/routes/__root.tsx +0 -55
- package/insight/src/routes/enterprise.tsx +0 -316
- package/insight/src/routes/index.tsx +0 -1482
- package/insight/src/routes/knowledge.tsx +0 -221
- package/insight/src/routes/knowledge_.$dbHash.$sourceId.tsx +0 -137
- package/insight/src/routes/search.tsx +0 -97
- package/insight/src/routes/sessions.tsx +0 -179
- package/insight/src/routes/sessions_.$dbHash.$sessionId.tsx +0 -181
- package/insight/src/styles.css +0 -104
- package/insight/tsconfig.json +0 -29
- package/insight/vite.config.ts +0 -19
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Claude Code plugins by Mert Koseoğlu",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.163"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "context-mode",
|
|
14
14
|
"source": "./",
|
|
15
15
|
"description": "Claude Code MCP plugin that saves 98% of your context window. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.",
|
|
16
|
-
"version": "1.0.
|
|
16
|
+
"version": "1.0.163",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "Mert Koseoğlu"
|
|
19
19
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.163",
|
|
4
4
|
"description": "MCP server that saves 98% of your context window with session continuity. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and automatic state restore across compactions.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mert Koseoğlu",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.163",
|
|
4
4
|
"description": "MCP server that saves 98% of your context window with session continuity. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and automatic state restore across compactions.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mert Koseoğlu",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "Context Mode",
|
|
4
4
|
"kind": "tool",
|
|
5
5
|
"description": "OpenClaw plugin that saves 98% of your context window. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.163",
|
|
7
7
|
"sandbox": {
|
|
8
8
|
"mode": "permissive",
|
|
9
9
|
"filesystem_access": "full",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.163",
|
|
4
4
|
"description": "OpenClaw plugin that saves 98% of your context window. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mert Koseoğlu",
|
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ Context Mode is an MCP server that solves all four sides of this problem:
|
|
|
39
39
|
|
|
40
40
|
1. **Context Saving** — Sandbox tools keep raw data out of the context window. 315 KB becomes 5.4 KB. 98% reduction.
|
|
41
41
|
2. **Session Continuity** — Every file edit, git operation, task, error, and user decision is tracked in SQLite. When the conversation compacts, context-mode doesn't dump this data back into context — it indexes events into FTS5 and retrieves only what's relevant via BM25 search. The model picks up exactly where you left off. If you don't `--continue`, previous session data is deleted immediately — a fresh session means a clean slate.
|
|
42
|
-
3. **Think in Code** — The LLM should program the analysis, not compute it. Instead of reading 50 files into context to count functions, the agent writes a script that does the counting and `console.log()`s only the result. One script replaces ten tool calls and saves 100x context. This is a mandatory paradigm across all
|
|
42
|
+
3. **Think in Code** — The LLM should program the analysis, not compute it. Instead of reading 50 files into context to count functions, the agent writes a script that does the counting and `console.log()`s only the result. One script replaces ten tool calls and saves 100x context. This is a mandatory paradigm across all 17 supported clients, plus the OpenClaw gateway integration: stop treating the LLM as a data processor, treat it as a code generator.
|
|
43
43
|
|
|
44
44
|
```js
|
|
45
45
|
// Before: 47 × Read() = 700 KB. After: 1 × ctx_execute() = 3.6 KB.
|
|
@@ -83,7 +83,7 @@ Restart Claude Code (or run `/reload-plugins`).
|
|
|
83
83
|
|
|
84
84
|
All checks should show `[x]`. The doctor validates runtimes, hooks, FTS5, and plugin registration.
|
|
85
85
|
|
|
86
|
-
**Routing:** Automatic. The SessionStart hook injects routing instructions at runtime — no file is written to your project. The plugin registers all hooks (PreToolUse, PostToolUse, PreCompact, SessionStart) and 11 MCP tools — six sandbox tools (`ctx_batch_execute`, `ctx_execute`, `ctx_execute_file`, `ctx_index`, `ctx_search`, `ctx_fetch_and_index`) plus five meta-tools (`ctx_stats`, `ctx_doctor`, `ctx_upgrade`, `ctx_purge`, `ctx_insight`).
|
|
86
|
+
**Routing:** Automatic. The SessionStart hook injects routing instructions at runtime — no file is written to your project. The plugin registers all hooks (PreToolUse, PostToolUse, UserPromptSubmit, PreCompact, SessionStart, Stop) and 11 MCP tools — six sandbox tools (`ctx_batch_execute`, `ctx_execute`, `ctx_execute_file`, `ctx_index`, `ctx_search`, `ctx_fetch_and_index`) plus five meta-tools (`ctx_stats`, `ctx_doctor`, `ctx_upgrade`, `ctx_purge`, `ctx_insight`).
|
|
87
87
|
|
|
88
88
|
| Slash Command | What it does |
|
|
89
89
|
|---|---|
|
|
@@ -93,7 +93,7 @@ All checks should show `[x]`. The doctor validates runtimes, hooks, FTS5, and pl
|
|
|
93
93
|
| `/context-mode:ctx-search` | Search previously indexed content. |
|
|
94
94
|
| `/context-mode:ctx-upgrade` | Pull latest, rebuild, migrate cache, fix hooks. |
|
|
95
95
|
| `/context-mode:ctx-purge` | Permanently delete all indexed content from the knowledge base. |
|
|
96
|
-
| `/context-mode:ctx-insight` |
|
|
96
|
+
| `/context-mode:ctx-insight` | Opens the hosted Insight dashboard ([context-mode.com/insight](https://context-mode.com/insight)) in your browser — org analytics for AI-assisted engineering teams. |
|
|
97
97
|
|
|
98
98
|
> **Note:** Slash commands are a Claude Code plugin feature. On other platforms, type `ctx stats`, `ctx doctor`, `ctx index`, `ctx search`, `ctx upgrade`, or `ctx insight` in the chat — the model calls the MCP tool automatically. See [Utility Commands](#utility-commands).
|
|
99
99
|
|
|
@@ -304,6 +304,66 @@ Full setup guide: [`docs/jetbrains-copilot.md`](docs/jetbrains-copilot.md)
|
|
|
304
304
|
|
|
305
305
|
</details>
|
|
306
306
|
|
|
307
|
+
<details>
|
|
308
|
+
<summary><strong>GitHub Copilot CLI</strong> — MCP + hooks</summary>
|
|
309
|
+
|
|
310
|
+
**Prerequisites:** Node.js >= 22.5 (or Bun), GitHub Copilot CLI (`copilot`) installed. Set `COPILOT_HOME` first if you use an isolated Copilot home.
|
|
311
|
+
|
|
312
|
+
**Install — Option A (plugin, one command — recommended):**
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
npm install -g context-mode # the plugin's MCP server runs the global binary
|
|
316
|
+
copilot plugin install mksglu/context-mode:configs/copilot-cli # registers MCP + hooks + routing skill
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
The bundle's `.mcp.json` pins `CONTEXT_MODE_PLATFORM=copilot-cli`, so context-mode self-identifies as Copilot — `ctx_upgrade` and platform detection resolve `copilot-cli` even when Claude Code is co-installed (whose `~/.claude/` would otherwise win). No `context-mode upgrade` / agent call needed. To try it from a local clone before it lands on the default branch, point Copilot at the bundle directory: `copilot --plugin-dir /path/to/context-mode/configs/copilot-cli`.
|
|
320
|
+
|
|
321
|
+
**Install — Option B (manual, no plugin):**
|
|
322
|
+
|
|
323
|
+
1. Install context-mode globally:
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
npm install -g context-mode
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
2. Register the MCP server with Copilot CLI's built-in command (writes `~/.copilot/mcp-config.json` for you):
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
copilot mcp add context-mode -- context-mode
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
3. Configure hooks in `~/.copilot/hooks/context-mode.json` (or `$COPILOT_HOME/hooks/context-mode.json`). The config uses flat `{ "type": "command", "command": "..." }` entries; context-mode also writes a top-level `"version": 1`, but that field is **optional** — the Copilot CLI accepts hook configs that omit it (it is pinned only for self-documentation). Copilot CLI fires six events context-mode uses:
|
|
336
|
+
|
|
337
|
+
```json
|
|
338
|
+
{
|
|
339
|
+
"version": 1,
|
|
340
|
+
"hooks": {
|
|
341
|
+
"preToolUse": [{ "type": "command", "command": "context-mode hook copilot-cli pretooluse" }],
|
|
342
|
+
"postToolUse": [{ "type": "command", "command": "context-mode hook copilot-cli posttooluse" }],
|
|
343
|
+
"preCompact": [{ "type": "command", "command": "context-mode hook copilot-cli precompact" }],
|
|
344
|
+
"sessionStart": [{ "type": "command", "command": "context-mode hook copilot-cli sessionstart" }],
|
|
345
|
+
"userPromptSubmitted": [{ "type": "command", "command": "context-mode hook copilot-cli userpromptsubmit" }],
|
|
346
|
+
"agentStop": [{ "type": "command", "command": "context-mode hook copilot-cli stop" }]
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
Or let context-mode write **this hooks file** for you: `context-mode upgrade` (run from a Copilot CLI context, or with `CONTEXT_MODE_PLATFORM=copilot-cli`). `upgrade` writes the **hooks file only** — register the MCP server with `copilot mcp add` in step 2.
|
|
352
|
+
|
|
353
|
+
4. Restart Copilot CLI.
|
|
354
|
+
|
|
355
|
+
> **Plugins:** Option A above uses Copilot CLI's plugin system, which registers MCP servers (`.mcp.json`), hooks (`hooks.json`), and skills (`skills/`) together — not just skills/agents. The shipped bundle is `configs/copilot-cli/`; `copilot plugin install owner/repo:path` installs it in one command (no clone). Option B is the equivalent without a plugin.
|
|
356
|
+
|
|
357
|
+
> **Version note:** the hook commands run the **global** `context-mode` (`context-mode hook copilot-cli …`), so they need a context-mode version with Copilot CLI support. On an older global the hooks are inert (no routing/capture) until you upgrade — but they do **not** block your tools (context-mode fails open). Upgrade with `npm install -g context-mode@latest`.
|
|
358
|
+
|
|
359
|
+
**Verify:** In a Copilot CLI session, type `ctx stats`. Context-mode tools should appear and respond. Run `context-mode doctor` to confirm hook + MCP registration.
|
|
360
|
+
|
|
361
|
+
**Routing:** Automatic via hooks (PreToolUse interception + SessionStart routing block). Auto-detected via MCP `clientInfo.name` (`GitHub Copilot CLI`) or, in a bare shell, a context-mode-written marker (`~/.copilot/mcp-config.json` or `~/.copilot/hooks/context-mode.json`) — not a bare `~/.copilot/` dir, so a co-installed-but-unconfigured Copilot CLI is not mis-detected as context-mode-on-copilot.
|
|
362
|
+
|
|
363
|
+
See [`docs/platform-support.md`](docs/platform-support.md#github-copilot-cli) for the full reference. Tracking: [#775](https://github.com/mksglu/context-mode/issues/775).
|
|
364
|
+
|
|
365
|
+
</details>
|
|
366
|
+
|
|
307
367
|
<details>
|
|
308
368
|
<summary><strong>Cursor</strong> — hooks with stop support</summary>
|
|
309
369
|
|
|
@@ -323,7 +383,7 @@ After Cursor lists context-mode in the [Marketplace](https://cursor.com/marketpl
|
|
|
323
383
|
git clone https://github.com/mksglu/context-mode.git
|
|
324
384
|
cd context-mode
|
|
325
385
|
robocopy . "$env:USERPROFILE\.cursor\plugins\local\context-mode" /MIR `
|
|
326
|
-
/XD node_modules .git build
|
|
386
|
+
/XD node_modules .git build web tests scripts .vscode `
|
|
327
387
|
/XF *.log .gitignore *.bundle.mjs.map
|
|
328
388
|
```
|
|
329
389
|
|
|
@@ -706,6 +766,8 @@ The Codex plugin manifest provides MCP via `.codex-plugin/mcp.json`, skills via
|
|
|
706
766
|
CM_ROOT="$(npm root -g)/context-mode"; cp "$CM_ROOT/configs/codex/AGENTS.md" ~/.kimi-code/AGENTS.md
|
|
707
767
|
```
|
|
708
768
|
|
|
769
|
+
Full documentation: [`docs/adapters/kimi-code.md`](docs/adapters/kimi-code.md)
|
|
770
|
+
|
|
709
771
|
</details>
|
|
710
772
|
|
|
711
773
|
<details>
|
|
@@ -803,6 +865,49 @@ Full configs: [`configs/antigravity/mcp_config.json`](configs/antigravity/mcp_co
|
|
|
803
865
|
|
|
804
866
|
</details>
|
|
805
867
|
|
|
868
|
+
<details>
|
|
869
|
+
<summary><strong>Antigravity CLI (<code>agy</code>)</strong> — plugin (MCP + skill + hooks)</summary>
|
|
870
|
+
|
|
871
|
+
**Prerequisites:** Node.js >= 22.5 (or Bun), Antigravity CLI (`agy`) installed.
|
|
872
|
+
|
|
873
|
+
`agy` has a native **plugin** system, so context-mode installs as a first-class agy plugin that bundles the MCP server, a routing rule, a routing skill, and bounded hooks in one step.
|
|
874
|
+
|
|
875
|
+
**Install** (same one-command pattern as OpenClaw — the script resolves the bundle path for you):
|
|
876
|
+
|
|
877
|
+
1. Make the MCP server available globally (the plugin runs the `context-mode` binary):
|
|
878
|
+
|
|
879
|
+
```bash
|
|
880
|
+
npm install -g context-mode
|
|
881
|
+
```
|
|
882
|
+
|
|
883
|
+
2. Clone and install the plugin:
|
|
884
|
+
|
|
885
|
+
```bash
|
|
886
|
+
git clone https://github.com/mksglu/context-mode.git
|
|
887
|
+
cd context-mode
|
|
888
|
+
npm run install:agy
|
|
889
|
+
```
|
|
890
|
+
|
|
891
|
+
`npm run install:agy` runs `agy plugin install` on the bundle at `configs/antigravity-cli/` — registering the MCP server from the bundle's native `mcp_config.json`, the routing rule, routing skill, bounded `PreToolUse`, `PostToolUse` capture, and best-effort `Stop` capture hooks — then clears agy's stale tool-schema cache so the `ctx_*` tools appear in the model's tool list (agy caches MCP schemas and doesn't refresh them; an old cache hides the tools). The installer is cross-platform Node (runs natively on Windows, macOS, and Linux — no bash required). Restart `agy`.
|
|
892
|
+
|
|
893
|
+
agy's native validation path expects root `plugin.json` + `mcp_config.json`; the bundle intentionally uses that single manifest shape.
|
|
894
|
+
|
|
895
|
+
> **Hook version note:** the agy hooks run the **global** `context-mode` binary (`context-mode hook antigravity-cli <event>`), so they need a context-mode version with Antigravity CLI hook support. On an older global the **MCP server + routing rule + routing skill still work**, but hook enforcement/capture may be inert — the installer probes for this and prints a warning if your global is too old (upgrade with `npm install -g context-mode@latest`). To remove the plugin later: `agy plugin uninstall context-mode`.
|
|
896
|
+
|
|
897
|
+
> **Already using context-mode in Claude Code?** `agy plugin import claude` can import that existing Claude setup, but the native context-mode agy bundle above is the supported path for agy hooks.
|
|
898
|
+
|
|
899
|
+
**Verify:** `agy -p "Use the context-mode ctx_execute MCP tool to compute 7 + 5. Answer only the number." --dangerously-skip-permissions` should print `12`.
|
|
900
|
+
|
|
901
|
+
**Install (alternative — MCP only):** add context-mode to `~/.gemini/config/mcp_config.json` (agy's **global** MCP profile — `config/`, distinct from the Antigravity IDE's `antigravity/` path):
|
|
902
|
+
|
|
903
|
+
```json
|
|
904
|
+
{ "mcpServers": { "context-mode": { "command": "context-mode" } } }
|
|
905
|
+
```
|
|
906
|
+
|
|
907
|
+
**Routing & capture:** The routing rule plus routing skill provide the durable instruction layer, and bounded `PreToolUse` enforcement blocks mapped high-flood tools before execution (`run_command`, `view_file`, `grep_search`, `web_fetch`, `read_url_content`). `PostToolUse` records executed tool calls into `~/.gemini/context-mode/sessions/` and normalizes agy basics (`run_command`, `view_file`, `grep_search`, `list_dir`, `read_url_content`, `search_web`) onto context-mode's canonical tool names; `list_dir` and `search_web` are capture-only because context-mode has no LS/WebSearch PreToolUse routing branch. `Stop` is registered as best-effort session-end capture, but agy `-p` probes have not emitted it. `PreInvocation` and `PostInvocation` are intentionally not registered until agy's payload/response contract is verified for context-mode's pipeline. Auto-detected via MCP `clientInfo.name` (`agy`) or, in a bare shell, the `~/.local/bin/agy` / `~/.gemini/config/mcp_config.json` markers — probed before the generic `~/.claude` fallback so a gemini-cli→agy migrant is not mis-detected as Claude Code ([#774](https://github.com/mksglu/context-mode/issues/774)).
|
|
908
|
+
|
|
909
|
+
</details>
|
|
910
|
+
|
|
806
911
|
<details>
|
|
807
912
|
<summary><strong>Kiro</strong> — hooks with steering file</summary>
|
|
808
913
|
|
|
@@ -1146,16 +1251,17 @@ Context Mode captures every meaningful event during your session and persists th
|
|
|
1146
1251
|
|
|
1147
1252
|
Session continuity requires 5 hooks working together:
|
|
1148
1253
|
|
|
1149
|
-
| Hook | Role | Claude Code | Gemini CLI | VS Code Copilot | JetBrains Copilot | Cursor | OpenCode | KiloCode | OpenClaw | Codex CLI | Antigravity | Kiro | Zed | Pi | OMP |
|
|
1150
|
-
|
|
1151
|
-
| **PreToolUse** | Enforces sandbox routing before tool execution | Yes | -- | -- | -- | Yes | -- | -- | -- | Yes | -- | Yes | -- | ✓ (via tool_call event) | ✓ (via tool_call event) |
|
|
1152
|
-
| **PostToolUse** | Captures events after each tool call | Yes | Yes | Yes | Yes | Yes | Plugin | Plugin | Plugin | Yes | -- | Yes | -- | ✓ (via tool_result event) | ✓ (via tool_result event) |
|
|
1153
|
-
| **UserPromptSubmit** | Captures user decisions and corrections | Yes | -- | -- | -- | -- | Plugin (via chat.message) | Plugin (via chat.message) | -- | Yes | -- | -- | -- | -- | -- |
|
|
1154
|
-
| **
|
|
1155
|
-
| **
|
|
1156
|
-
| |
|
|
1254
|
+
| Hook | Role | Claude Code | Gemini CLI | VS Code Copilot | JetBrains Copilot | GitHub Copilot CLI | Cursor | OpenCode | KiloCode | OpenClaw | Codex CLI | Antigravity | Antigravity CLI (`agy`) | Kiro | Zed | Pi | OMP |
|
|
1255
|
+
|---|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
|
|
1256
|
+
| **PreToolUse** | Enforces sandbox routing before tool execution | Yes | -- | -- | -- | Yes | Yes | -- | -- | -- | Yes | -- | Bounded | Yes | -- | ✓ (via tool_call event) | ✓ (via tool_call event) |
|
|
1257
|
+
| **PostToolUse** | Captures events after each tool call | Yes | Yes | Yes | Yes | Yes | Yes | Plugin | Plugin | Plugin | Yes | -- | Yes (capture-only) | Yes | -- | ✓ (via tool_result event) | ✓ (via tool_result event) |
|
|
1258
|
+
| **UserPromptSubmit** | Captures user decisions and corrections | Yes | -- | -- | -- | Yes | -- | Plugin (via chat.message) | Plugin (via chat.message) | -- | Yes | -- | -- | -- | -- | -- | -- |
|
|
1259
|
+
| **Stop** | Captures assistant turn-end state | Yes | -- | -- | -- | Yes | Yes | -- | -- | -- | Yes | -- | Best-effort | -- | -- | -- | -- |
|
|
1260
|
+
| **PreCompact** | Builds snapshot before compaction | Yes | Yes | Yes | Yes | Yes | -- | Plugin | Plugin | Plugin | Yes | -- | -- | -- | -- | ✓ (via session_before_compact) | ✓ (via session_before_compact) |
|
|
1261
|
+
| **SessionStart** | Restores state after compaction or resume | Yes | Yes | Yes | Yes | Yes | -- | ✓ (via experimental.chat.system.transform) | ✓ (via experimental.chat.system.transform) | Plugin | Yes | -- | -- | -- | -- | ✓ (via session_start event) | ✓ (via session_start event) |
|
|
1262
|
+
| | **Session completeness** | **Full** | **High** | **High** | **High** | **High** | **Partial** | **Full** | **Full** | **High** | **Partial** | **--** | **Partial** | **Partial** | **--** | **High** | **High** |
|
|
1157
1263
|
|
|
1158
|
-
> **Note:** Full session continuity (capture + snapshot + restore) works on **Claude Code**, **Gemini CLI**, **VS Code Copilot**, **JetBrains Copilot**, **OpenCode**, and **KiloCode**. **OpenCode** and **KiloCode** use `experimental.chat.system.transform` as a SessionStart surrogate to inject the routing block and restore prior sessions, plus `chat.message` for user-prompt capture; full SessionStart hook support is not yet available ([#14808](https://github.com/sst/opencode/issues/14808), [#5409](https://github.com/sst/opencode/issues/5409)), but prior-session continuity and user-decision capture work fully. **Cursor** captures tool events via `preToolUse`/`postToolUse`, but `sessionStart` is currently rejected by Cursor's validator ([forum report](https://forum.cursor.com/t/unknown-hook-type-sessionstart/149566)), so session restore after compaction is not available yet. **OpenClaw** uses native gateway plugin hooks (`api.on()`) for full session continuity. **Pi Coding Agent** provides high session continuity via extension hooks (`tool_call`, `tool_result`, `session_start`, `session_before_compact`). **Codex CLI** provides partial hook-based session tracking through PreToolUse, PostToolUse, PreCompact, SessionStart, UserPromptSubmit, and Stop; MCP tools work. **Antigravity
|
|
1264
|
+
> **Note:** Full session continuity (capture + snapshot + restore) works on **Claude Code**, **Gemini CLI**, **VS Code Copilot**, **JetBrains Copilot**, **OpenCode**, and **KiloCode**. **GitHub Copilot CLI** uses its own camelCase hook config keys (`preToolUse`, `postToolUse`, `preCompact`, `sessionStart`, `userPromptSubmitted`, `agentStop`) and top-level hook responses; it captures prompt, tool, compaction, session-start, and stop events when the plugin hooks are installed. **OpenCode** and **KiloCode** use `experimental.chat.system.transform` as a SessionStart surrogate to inject the routing block and restore prior sessions, plus `chat.message` for user-prompt capture; full SessionStart hook support is not yet available ([#14808](https://github.com/sst/opencode/issues/14808), [#5409](https://github.com/sst/opencode/issues/5409)), but prior-session continuity and user-decision capture work fully. **Cursor** captures tool events via `preToolUse`/`postToolUse`, but `sessionStart` is currently rejected by Cursor's validator ([forum report](https://forum.cursor.com/t/unknown-hook-type-sessionstart/149566)), so session restore after compaction is not available yet. **OpenClaw** uses native gateway plugin hooks (`api.on()`) for full session continuity. **Pi Coding Agent** provides high session continuity via extension hooks (`tool_call`, `tool_result`, `session_start`, `session_before_compact`). **Codex CLI** provides partial hook-based session tracking through PreToolUse, PostToolUse, PreCompact, SessionStart, UserPromptSubmit, and Stop; MCP tools work. **Antigravity IDE** and **Zed** have no hook support in the current release, so session tracking is not available there. **Antigravity CLI (`agy`)** is separate from the IDE and supports bounded `PreToolUse`, capture-only `PostToolUse`, and best-effort `Stop` through its plugin hooks. **Kiro** captures tool events via native `preToolUse`/`postToolUse` hooks, but its SessionStart equivalent (`agentSpawn`) is not yet wired, so session restore after compaction is unavailable. **OMP** (Oh My Pi) ships full plugin-based hook support — `omp plugin install context-mode` registers `tool_call`, `tool_result`, `session_start`, and `session_before_compact` handlers and storage roots cleanly under `~/.omp/context-mode/` so OMP and Pi installs never share state.
|
|
1159
1265
|
|
|
1160
1266
|
<details>
|
|
1161
1267
|
<summary><strong>What gets captured</strong></summary>
|
|
@@ -1246,6 +1352,8 @@ Detailed event data is also indexed into FTS5 for on-demand retrieval via `ctx_s
|
|
|
1246
1352
|
|
|
1247
1353
|
**JetBrains Copilot** — High coverage. Same capabilities as VS Code Copilot — PostToolUse, PreCompact, and SessionStart all fire. Uses the same hook wire protocol and response format. User decisions aren't captured but all tool-level events are.
|
|
1248
1354
|
|
|
1355
|
+
**GitHub Copilot CLI** — High coverage. Native plugin hooks use camelCase config keys (`preToolUse`, `postToolUse`, `preCompact`, `sessionStart`, `userPromptSubmitted`, `agentStop`) and top-level hook response fields. The plugin captures user prompts, tool events, compaction snapshots, session start restore, and stop events.
|
|
1356
|
+
|
|
1249
1357
|
**Cursor** — Partial coverage. Native `preToolUse` and `postToolUse` hooks capture tool events. `sessionStart` is documented by Cursor but currently rejected by their validator, so session restore is not available. Routing instructions are delivered via MCP server startup instead.
|
|
1250
1358
|
|
|
1251
1359
|
**OpenCode** — Full session support. The TypeScript plugin captures PostToolUse events via `tool.execute.after`, user prompts and decisions via `chat.message`, builds compaction snapshots via `experimental.session.compacting`, and restores prior sessions via `experimental.chat.system.transform` (SessionStart surrogate). Routing block is injected on first `chat.system.transform` per session. AGENTS.md/CLAUDE.md/CONTEXT.md rules are captured automatically on first hook fire.
|
|
@@ -1258,6 +1366,8 @@ Detailed event data is also indexed into FTS5 for on-demand retrieval via `ctx_s
|
|
|
1258
1366
|
|
|
1259
1367
|
**Antigravity** — No session support. No hooks, no event capture. Requires manually copying `GEMINI.md` to your project root. Auto-detected via MCP protocol handshake (`clientInfo.name`).
|
|
1260
1368
|
|
|
1369
|
+
**Antigravity CLI (`agy`)** — Partial coverage. The standalone CLI is separate from the IDE and supports bounded native `PreToolUse` enforcement for mapped high-flood tools, capture-only `PostToolUse`, and best-effort `Stop` through the shipped plugin hooks. It does not currently provide PreCompact/SessionStart/UserPromptSubmit coverage.
|
|
1370
|
+
|
|
1261
1371
|
**Zed** — No session support. No hooks, no event capture. Requires manually copying `AGENTS.md` to your project root. Auto-detected via MCP protocol handshake (`clientInfo.name`).
|
|
1262
1372
|
|
|
1263
1373
|
**Kiro** — Partial coverage. Native `preToolUse` and `postToolUse` hooks capture tool events and enforce sandbox routing. `agentSpawn` (the Kiro equivalent of SessionStart) is not yet implemented, so session restore after compaction is not available. Requires manually copying `KIRO.md` to your project root. Auto-detected via MCP protocol handshake (`clientInfo.name`).
|
|
@@ -1271,18 +1381,18 @@ Tool call output can be collapsed/expanded with the default Pi's default keybind
|
|
|
1271
1381
|
|
|
1272
1382
|
## Platform Compatibility
|
|
1273
1383
|
|
|
1274
|
-
| Feature | Claude Code | Qwen Code | Gemini CLI | VS Code Copilot | JetBrains Copilot | Cursor | OpenCode | KiloCode | OpenClaw | Codex CLI | Antigravity | Kiro | Zed | Pi | OMP |
|
|
1275
|
-
|
|
1276
|
-
| MCP Server / Native Tools | Yes | Yes | Yes | Yes | Yes | Yes | Native plugin | Native plugin | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
1277
|
-
| PreToolUse Hook | Yes | Yes | Yes | Yes | Yes | Yes | Plugin | Plugin | Plugin | Yes | -- | Yes | -- | Yes (extension) | Plugin |
|
|
1278
|
-
| PostToolUse Hook | Yes | Yes | Yes | Yes | Yes | Yes | Plugin | Plugin | Plugin | Yes | -- | Yes | -- | Yes (extension) | Plugin |
|
|
1279
|
-
| SessionStart Hook | Yes | Yes | Yes | Yes | Yes | -- | ✓ (via experimental.chat.system.transform) | ✓ (via experimental.chat.system.transform) | Plugin | Yes | -- | -- | -- | Yes (extension) | Plugin |
|
|
1280
|
-
| PreCompact Hook | Yes | Yes | Yes | Yes | Yes | -- | Plugin | Plugin | Plugin | Yes | -- | -- | -- | Yes (extension) | Plugin |
|
|
1281
|
-
| Can Modify Args | Yes | Yes | Yes | Yes | Yes | Yes | Plugin | Plugin | Plugin | -- | -- | -- | -- | Yes (extension) | -- |
|
|
1282
|
-
| Can Block Tools | Yes | Yes | Yes | Yes | Yes | Yes | Plugin | Plugin | Plugin | Yes | -- | Yes | -- | Yes (extension) | Plugin |
|
|
1283
|
-
| Utility Commands (ctx) | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes (/ctx-stats, /ctx-doctor) | Yes |
|
|
1284
|
-
| Slash Commands | Yes | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- |
|
|
1285
|
-
| Plugin Marketplace | Yes | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- |
|
|
1384
|
+
| Feature | Claude Code | Qwen Code | Gemini CLI | VS Code Copilot | JetBrains Copilot | GitHub Copilot CLI | Cursor | OpenCode | KiloCode | OpenClaw | Codex CLI | Kimi Code | Antigravity | Antigravity CLI (`agy`) | Kiro | Zed | Pi | OMP |
|
|
1385
|
+
|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
|
|
1386
|
+
| MCP Server / Native Tools | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Native plugin | Native plugin | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
|
|
1387
|
+
| PreToolUse Hook | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Plugin | Plugin | Plugin | Yes | Yes | -- | Bounded | Yes | -- | Yes (extension) | Plugin |
|
|
1388
|
+
| PostToolUse Hook | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Plugin | Plugin | Plugin | Yes | Yes | -- | Yes (capture-only) | Yes | -- | Yes (extension) | Plugin |
|
|
1389
|
+
| SessionStart Hook | Yes | Yes | Yes | Yes | Yes | Yes | -- | ✓ (via experimental.chat.system.transform) | ✓ (via experimental.chat.system.transform) | Plugin | Yes | Yes | -- | -- | -- | -- | Yes (extension) | Plugin |
|
|
1390
|
+
| PreCompact Hook | Yes | Yes | Yes | Yes | Yes | Yes | -- | Plugin | Plugin | Plugin | Yes | Yes | -- | -- | -- | -- | Yes (extension) | Plugin |
|
|
1391
|
+
| Can Modify Args | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Plugin | Plugin | Plugin | -- | Yes | -- | -- | -- | -- | Yes (extension) | -- |
|
|
1392
|
+
| Can Block Tools | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Plugin | Plugin | Plugin | Yes | Yes | -- | Bounded | Yes | -- | Yes (extension) | Plugin |
|
|
1393
|
+
| Utility Commands (ctx) | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes (/ctx-stats, /ctx-doctor) | Yes |
|
|
1394
|
+
| Slash Commands | Yes | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- |
|
|
1395
|
+
| Plugin Marketplace | Yes | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- |
|
|
1286
1396
|
|
|
1287
1397
|
> **OpenCode** uses a TypeScript plugin paradigm — hooks run as in-process functions via `tool.execute.before`, `tool.execute.after`, `experimental.session.compacting`, `experimental.chat.system.transform`, and `chat.message`, providing full routing enforcement, session continuity, and user-prompt capture. The `experimental.chat.system.transform` hook acts as a SessionStart surrogate to inject the routing block and restore prior sessions. The `chat.message` hook captures user prompts and decisions (UserPromptSubmit equivalent).
|
|
1288
1398
|
>
|
|
@@ -1292,6 +1402,8 @@ Tool call output can be collapsed/expanded with the default Pi's default keybind
|
|
|
1292
1402
|
>
|
|
1293
1403
|
> **Codex CLI** hooks require `[features].hooks = true`. MCP tools work, and hook scripts activate through `$CODEX_HOME/hooks.json` or `~/.codex/hooks.json`. PreToolUse supports `permissionDecision: "deny"` only; input modification still needs upstream `updatedInput` support ([openai/codex#18491](https://github.com/openai/codex/issues/18491)). `additionalContext` is not supported in PreToolUse (context injection works via PostToolUse and SessionStart instead; the codex formatter handles this automatically). PreCompact stores resume snapshots before compaction on Codex builds that emit the event, SessionStart restores them, and UserPromptSubmit/Stop capture prompt and turn-end continuity events. See the Codex install section for setup. **Antigravity** and **Zed** do not support hooks. They rely solely on manually-copied routing instruction files (`AGENTS.md` / `GEMINI.md`) for enforcement (~60% compliance). See each platform's install section for copy instructions. Antigravity and Zed are auto-detected via MCP protocol handshake — no manual platform configuration needed.
|
|
1294
1404
|
>
|
|
1405
|
+
> **Antigravity CLI (`agy`)** supports bounded `PreToolUse` blocking for mapped Bash/Read/Grep/WebFetch surfaces, plus `PostToolUse` capture and best-effort `Stop` capture through its plugin `hooks.json`. The routing rule and routing skill remain the broader instruction layer; `PreInvocation`/`PostInvocation` are not wired until their payload/response semantics are verified.
|
|
1406
|
+
>
|
|
1295
1407
|
> **Kiro** supports native `preToolUse` and `postToolUse` hooks for routing enforcement and tool event capture. `agentSpawn` (SessionStart equivalent) and `stop` are not yet wired. Requires manually copying `KIRO.md` to your project root. Kiro is auto-detected via MCP protocol handshake (`clientInfo.name`).
|
|
1296
1408
|
>
|
|
1297
1409
|
> **Pi Coding Agent** runs context-mode as an extension with full hook support. The extension registers `tool_call`, `tool_result`, `session_start`, and `session_before_compact` events, providing high session continuity coverage. The MCP server provides all 11 MCP tools.
|
|
@@ -1302,7 +1414,7 @@ Tool call output can be collapsed/expanded with the default Pi's default keybind
|
|
|
1302
1414
|
|
|
1303
1415
|
Hooks intercept tool calls programmatically — they can block dangerous commands and redirect them to the sandbox before execution. Instruction files guide the model via prompt instructions but cannot block anything. **Always enable hooks where supported.**
|
|
1304
1416
|
|
|
1305
|
-
> **Note:** Routing instruction files were previously auto-written to project directories on first session start. This was disabled to prevent git tree pollution ([#158](https://github.com/mksglu/context-mode/issues/158), [#164](https://github.com/mksglu/context-mode/issues/164)). Hook-capable platforms (Claude Code, Gemini CLI, VS Code Copilot, JetBrains Copilot, Cursor, OpenCode, OpenClaw, Codex CLI, OMP via plugin) inject routing
|
|
1417
|
+
> **Note:** Routing instruction files were previously auto-written to project directories on first session start. This was disabled to prevent git tree pollution ([#158](https://github.com/mksglu/context-mode/issues/158), [#164](https://github.com/mksglu/context-mode/issues/164)). Hook-capable platforms (Claude Code, Gemini CLI, VS Code Copilot, JetBrains Copilot, GitHub Copilot CLI, Cursor, OpenCode, OpenClaw, Codex CLI, Antigravity CLI for bounded tool hooks, Kiro for tool hooks, OMP via plugin) inject or enforce routing without writing files. Platforms without hook support — Zed and Antigravity IDE — require a one-time manual copy of the routing file; see each platform's install section.
|
|
1306
1418
|
|
|
1307
1419
|
| Platform | Hooks | Instruction File | With Hooks | Without Hooks |
|
|
1308
1420
|
|---|:---:|---|:---:|:---:|
|
|
@@ -1310,11 +1422,13 @@ Hooks intercept tool calls programmatically — they can block dangerous command
|
|
|
1310
1422
|
| Gemini CLI | Yes | [`GEMINI.md`](configs/gemini-cli/GEMINI.md) | **~98% saved** | ~60% saved |
|
|
1311
1423
|
| VS Code Copilot | Yes | [`copilot-instructions.md`](configs/vscode-copilot/copilot-instructions.md) | **~98% saved** | ~60% saved |
|
|
1312
1424
|
| JetBrains Copilot | Yes | [`copilot-instructions.md`](configs/vscode-copilot/copilot-instructions.md) | **~98% saved** | ~60% saved |
|
|
1425
|
+
| GitHub Copilot CLI | Yes | [`copilot-instructions.md`](configs/vscode-copilot/copilot-instructions.md) | **~98% saved** | ~60% saved |
|
|
1313
1426
|
| Cursor | Yes | [`context-mode.mdc`](configs/cursor/context-mode.mdc) | **~98% saved** | ~60% saved |
|
|
1314
1427
|
| OpenCode | Plugin | [`AGENTS.md`](configs/opencode/AGENTS.md) | **~98% saved** | ~60% saved |
|
|
1315
1428
|
| OpenClaw | Plugin | [`AGENTS.md`](configs/openclaw/AGENTS.md) | **~98% saved** | ~60% saved |
|
|
1316
1429
|
| Codex CLI | Yes | [`AGENTS.md`](configs/codex/AGENTS.md) | **~98% saved** | ~60% saved |
|
|
1317
1430
|
| Antigravity | -- | [`GEMINI.md`](configs/antigravity/GEMINI.md) | -- | ~60% saved |
|
|
1431
|
+
| Antigravity CLI (`agy`) | Bounded | routing rule + skill ([`rules`](configs/antigravity-cli/rules/context-mode.md), [`skill`](configs/antigravity-cli/skills/context-mode/SKILL.md)) | bounded Bash/Read/Grep/WebFetch enforcement | ~60% saved |
|
|
1318
1432
|
| Kiro | Yes | [`KIRO.md`](configs/kiro/KIRO.md) | **~98% saved** | ~60% saved |
|
|
1319
1433
|
| Zed | -- | [`AGENTS.md`](configs/zed/AGENTS.md) | -- | ~60% saved |
|
|
1320
1434
|
| Pi | ✓ | [`AGENTS.md`](configs/pi/AGENTS.md) | **~98% saved** | ~60% saved |
|
|
@@ -1335,7 +1449,7 @@ ctx index → index a local file or directory for later search
|
|
|
1335
1449
|
ctx search → search previously indexed content
|
|
1336
1450
|
ctx upgrade → update from GitHub, rebuild, reconfigure hooks
|
|
1337
1451
|
ctx purge → permanently delete all indexed content from the knowledge base
|
|
1338
|
-
ctx insight →
|
|
1452
|
+
ctx insight → opens the hosted Insight dashboard in your browser
|
|
1339
1453
|
```
|
|
1340
1454
|
|
|
1341
1455
|
**From your terminal** — run directly without an AI session:
|
|
@@ -1345,7 +1459,7 @@ context-mode doctor
|
|
|
1345
1459
|
context-mode index . --source project:my-app
|
|
1346
1460
|
context-mode search "authentication middleware" --source project:my-app
|
|
1347
1461
|
context-mode upgrade
|
|
1348
|
-
context-mode insight # opens
|
|
1462
|
+
context-mode insight # opens the hosted Insight dashboard in browser
|
|
1349
1463
|
bash scripts/ctx-debug.sh # full diagnostic report for bug reports
|
|
1350
1464
|
```
|
|
1351
1465
|
|
package/bin/statusline.mjs
CHANGED
|
@@ -96,7 +96,12 @@ function readStdinJson() {
|
|
|
96
96
|
const raw = readFileSync(0, "utf-8");
|
|
97
97
|
if (!raw.trim()) return {};
|
|
98
98
|
return JSON.parse(raw);
|
|
99
|
-
} catch {
|
|
99
|
+
} catch (err) {
|
|
100
|
+
// The payload is load-bearing — it carries session_id, which resolves the
|
|
101
|
+
// per-session KPI. Empty stdin (normal first render) returned above and
|
|
102
|
+
// stays silent; a non-empty payload that fails to parse is a real anomaly
|
|
103
|
+
// worth one latched stderr line (never pollutes the statusline's stdout).
|
|
104
|
+
warnOnce("stdin-parse", `failed to parse statusline stdin JSON: ${err?.message ?? err}`);
|
|
100
105
|
return {};
|
|
101
106
|
}
|
|
102
107
|
}
|
|
@@ -187,8 +192,23 @@ function findClaudePidDarwin() {
|
|
|
187
192
|
return process.ppid;
|
|
188
193
|
}
|
|
189
194
|
|
|
190
|
-
function resolveSessionId() {
|
|
195
|
+
function resolveSessionId(payload) {
|
|
196
|
+
// PRIMARY: the session_id Claude Code delivers in the statusLine stdin
|
|
197
|
+
// payload. This is the SAME id the recording hooks key session_events by,
|
|
198
|
+
// so it's the only source that reliably matches stored per-session data.
|
|
199
|
+
//
|
|
200
|
+
// Claude Code does NOT export a CLAUDE_SESSION_ID env var — session_id is
|
|
201
|
+
// delivered only in the stdin JSON (statusline.md "Available data"). And the
|
|
202
|
+
// /proc PID walk yields `pid-<n>`, which never matches a UUID-keyed session.
|
|
203
|
+
// So without reading the payload, the per-session KPI is unreachable and the
|
|
204
|
+
// bar falls back to the global lifetime aggregate — identical in every
|
|
205
|
+
// session and seemingly "frozen".
|
|
206
|
+
const fromPayload = payload?.session_id;
|
|
207
|
+
if (typeof fromPayload === "string" && fromPayload) return fromPayload;
|
|
208
|
+
// Fallback when the payload carries no session_id (and how test fixtures
|
|
209
|
+
// pin a deterministic id). NOT an override — payload wins when present.
|
|
191
210
|
if (process.env.CLAUDE_SESSION_ID) return process.env.CLAUDE_SESSION_ID;
|
|
211
|
+
// Last resort: walk the process tree (only matches pid-keyed events).
|
|
192
212
|
return `pid-${findClaudePid()}`;
|
|
193
213
|
}
|
|
194
214
|
|
|
@@ -208,9 +228,9 @@ function statusDot(pct) {
|
|
|
208
228
|
|
|
209
229
|
// ── Main render ──────────────────────────────────────────────────────────
|
|
210
230
|
async function main() {
|
|
211
|
-
readStdinJson(); //
|
|
231
|
+
const payload = readStdinJson(); // canonical source of session_id
|
|
212
232
|
const sessionsDir = resolveSessionDir();
|
|
213
|
-
const sessionId = resolveSessionId();
|
|
233
|
+
const sessionId = resolveSessionId(payload);
|
|
214
234
|
|
|
215
235
|
const analytics = await loadAnalytics();
|
|
216
236
|
|
|
@@ -20,7 +20,7 @@ import { BaseAdapter } from "../base.js";
|
|
|
20
20
|
import type { HookAdapter, HookParadigm, PlatformCapabilities, DiagnosticResult, PreToolUseEvent, PostToolUseEvent, PreCompactEvent, SessionStartEvent, PreToolUseResponse, PostToolUseResponse, PreCompactResponse, SessionStartResponse, HookRegistration } from "../types.js";
|
|
21
21
|
export declare class AntigravityAdapter extends BaseAdapter implements HookAdapter {
|
|
22
22
|
constructor();
|
|
23
|
-
readonly name
|
|
23
|
+
readonly name: string;
|
|
24
24
|
readonly paradigm: HookParadigm;
|
|
25
25
|
readonly capabilities: PlatformCapabilities;
|
|
26
26
|
parsePreToolUseInput(_raw: unknown): PreToolUseEvent;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* adapters/antigravity-cli — Google Antigravity CLI (`agy`) adapter.
|
|
3
|
+
*
|
|
4
|
+
* Integration: MCP tools plus agy's Claude-compatible hook surface. `agy`
|
|
5
|
+
* reads its global MCP profile from `~/.gemini/config/mcp_config.json`
|
|
6
|
+
* (distinct from the Antigravity IDE's `~/.gemini/antigravity/mcp_config.json`)
|
|
7
|
+
* and hooks from `~/.gemini/config/hooks.json`, or from an installed agy
|
|
8
|
+
* plugin's root `hooks.json`.
|
|
9
|
+
*
|
|
10
|
+
* context-mode wires only the surfaces that have a verified mapping:
|
|
11
|
+
* - PreToolUse for bounded routing enforcement on Bash/Read/Grep/WebFetch
|
|
12
|
+
* - PostToolUse capture for executed tool calls
|
|
13
|
+
* - best-effort Stop capture for session-end continuity when agy emits it
|
|
14
|
+
*
|
|
15
|
+
* PreInvocation/PostInvocation are intentionally not registered here: there is
|
|
16
|
+
* no verified payload/response contract or shared context-mode pipeline target
|
|
17
|
+
* for those agy events yet.
|
|
18
|
+
*/
|
|
19
|
+
import { AntigravityAdapter } from "../antigravity/index.js";
|
|
20
|
+
import type { DiagnosticResult, HookParadigm, PlatformCapabilities, PostToolUseEvent, PostToolUseResponse, PreToolUseEvent, PreToolUseResponse } from "../types.js";
|
|
21
|
+
export declare function antigravityCliMcpConfigPath(): string;
|
|
22
|
+
export declare function antigravityCliConfigDir(): string;
|
|
23
|
+
/** agy reads user hooks from ~/.gemini/config/hooks.json (sibling of mcp_config.json). */
|
|
24
|
+
export declare function antigravityCliHooksPath(): string;
|
|
25
|
+
/**
|
|
26
|
+
* `agy plugin install <bundle>` registers MCP + hook + skill into agy's plugin
|
|
27
|
+
* profile under ~/.gemini/config/plugins/<name>/ (verified on agy 1.0.6) — the
|
|
28
|
+
* canonical install. The global mcp_config.json / hooks.json paths above are the
|
|
29
|
+
* manual (no-plugin) fallback. doctor must recognize BOTH.
|
|
30
|
+
*/
|
|
31
|
+
export declare function antigravityCliPluginDir(): string;
|
|
32
|
+
export declare class AntigravityCliAdapter extends AntigravityAdapter {
|
|
33
|
+
readonly name = "Antigravity CLI";
|
|
34
|
+
readonly paradigm: HookParadigm;
|
|
35
|
+
readonly capabilities: PlatformCapabilities;
|
|
36
|
+
getSettingsPath(): string;
|
|
37
|
+
getConfigDir(_projectDir?: string): string;
|
|
38
|
+
parsePreToolUseInput(raw: unknown): PreToolUseEvent;
|
|
39
|
+
parsePostToolUseInput(raw: unknown): PostToolUseEvent;
|
|
40
|
+
formatPreToolUseResponse(response: PreToolUseResponse): unknown;
|
|
41
|
+
formatPostToolUseResponse(_response: PostToolUseResponse): unknown;
|
|
42
|
+
checkPluginRegistration(): DiagnosticResult;
|
|
43
|
+
getInstalledVersion(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Write/merge the agy hooks into ~/.gemini/config/hooks.json (manual,
|
|
46
|
+
* non-plugin path). Idempotent — unrelated hook entries are preserved.
|
|
47
|
+
*/
|
|
48
|
+
configureAllHooks(_pluginRoot: string): string[];
|
|
49
|
+
/** Report agy hook status across plugin and manual profiles. */
|
|
50
|
+
validateHooks(_pluginRoot: string): DiagnosticResult[];
|
|
51
|
+
}
|