context-mode 1.0.62 → 1.0.64
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/.openclaw-plugin/openclaw.plugin.json +1 -1
- package/.openclaw-plugin/package.json +1 -1
- package/build/executor.d.ts +0 -3
- package/build/executor.js +5 -15
- package/build/server.js +7 -17
- package/cli.bundle.mjs +87 -81
- package/configs/antigravity/GEMINI.md +4 -0
- package/configs/claude-code/CLAUDE.md +4 -0
- package/configs/codex/AGENTS.md +4 -0
- package/configs/cursor/context-mode.mdc +4 -0
- package/configs/gemini-cli/GEMINI.md +4 -0
- package/configs/kilo/AGENTS.md +4 -0
- package/configs/kiro/KIRO.md +4 -0
- package/configs/openclaw/AGENTS.md +4 -0
- package/configs/opencode/AGENTS.md +4 -0
- package/configs/pi/AGENTS.md +4 -0
- package/configs/vscode-copilot/copilot-instructions.md +4 -0
- package/configs/zed/AGENTS.md +4 -0
- package/hooks/core/routing.mjs +4 -4
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/server.bundle.mjs +83 -77
- package/skills/context-mode-ops/SKILL.md +21 -0
- package/skills/context-mode-ops/triage-issue.md +55 -7
- package/skills/context-mode-ops/validation.md +69 -0
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
You have context-mode MCP tools available. These rules are NOT optional — they protect your context window from flooding. A single unrouted command can dump 56 KB into context and waste the entire session. Antigravity does NOT have hooks, so these instructions are your ONLY enforcement mechanism. Follow them strictly.
|
|
4
4
|
|
|
5
|
+
## Think in Code — MANDATORY
|
|
6
|
+
|
|
7
|
+
When you need to analyze, count, filter, compare, search, parse, transform, or process data: **write code** that does the work via `mcp__context-mode__ctx_execute(language, code)` and `console.log()` only the answer. Do NOT read raw data into context to process mentally. Your role is to PROGRAM the analysis, not to COMPUTE it. Write robust, pure JavaScript — no npm dependencies, only Node.js built-ins (`fs`, `path`, `child_process`). Always use `try/catch`, handle `null`/`undefined`, and ensure compatibility with both Node.js and Bun. One script replaces ten tool calls and saves 100x context.
|
|
8
|
+
|
|
5
9
|
## BLOCKED commands — do NOT use these
|
|
6
10
|
|
|
7
11
|
### curl / wget — FORBIDDEN
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
You have context-mode MCP tools available. These rules are NOT optional — they protect your context window from flooding. A single unrouted command can dump 56 KB into context and waste the entire session.
|
|
4
4
|
|
|
5
|
+
## Think in Code — MANDATORY
|
|
6
|
+
|
|
7
|
+
When you need to analyze, count, filter, compare, search, parse, transform, or process data: **write code** that does the work via `ctx_execute(language, code)` and `console.log()` only the answer. Do NOT read raw data into context to process mentally. Your role is to PROGRAM the analysis, not to COMPUTE it. Write robust, pure JavaScript — no npm dependencies, only Node.js built-ins (`fs`, `path`, `child_process`). Always use `try/catch`, handle `null`/`undefined`, and ensure compatibility with both Node.js and Bun. One script replaces ten tool calls and saves 100x context.
|
|
8
|
+
|
|
5
9
|
## BLOCKED commands — do NOT attempt these
|
|
6
10
|
|
|
7
11
|
### curl / wget — BLOCKED
|
package/configs/codex/AGENTS.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
You have context-mode MCP tools available. These rules are NOT optional — they protect your context window from flooding. A single unrouted command can dump 56 KB into context and waste the entire session. Codex CLI does NOT have hooks, so these instructions are your ONLY enforcement mechanism. Follow them strictly.
|
|
4
4
|
|
|
5
|
+
## Think in Code — MANDATORY
|
|
6
|
+
|
|
7
|
+
When you need to analyze, count, filter, compare, search, parse, transform, or process data: **write code** that does the work via `ctx_execute(language, code)` and `console.log()` only the answer. Do NOT read raw data into context to process mentally. Your role is to PROGRAM the analysis, not to COMPUTE it. Write robust, pure JavaScript — no npm dependencies, only Node.js built-ins (`fs`, `path`, `child_process`). Always use `try/catch`, handle `null`/`undefined`, and ensure compatibility with both Node.js and Bun. One script replaces ten tool calls and saves 100x context.
|
|
8
|
+
|
|
5
9
|
## BLOCKED commands — do NOT use these
|
|
6
10
|
|
|
7
11
|
### curl / wget — FORBIDDEN
|
|
@@ -7,6 +7,10 @@ alwaysApply: true
|
|
|
7
7
|
|
|
8
8
|
Raw tool output floods your context window. Use context-mode MCP tools to keep raw data in the sandbox.
|
|
9
9
|
|
|
10
|
+
## Think in Code — MANDATORY
|
|
11
|
+
|
|
12
|
+
When you need to analyze, count, filter, compare, search, parse, transform, or process data: **write code** that does the work via `ctx_execute(language, code)` and `console.log()` only the answer. Do NOT read raw data into context to process mentally. Your role is to PROGRAM the analysis, not to COMPUTE it. Write robust, pure JavaScript — no npm dependencies, only Node.js built-ins (`fs`, `path`, `child_process`). Always use `try/catch`, handle `null`/`undefined`, and ensure compatibility with both Node.js and Bun. One script replaces ten tool calls and saves 100x context.
|
|
13
|
+
|
|
10
14
|
## Tool Selection
|
|
11
15
|
|
|
12
16
|
1. **GATHER**: `ctx_batch_execute(commands, queries)` — Primary tool for research. Runs all commands, auto-indexes, and searches. ONE call replaces many individual steps.
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
You have context-mode MCP tools available. These rules are NOT optional — they protect your context window from flooding. A single unrouted command can dump 56 KB into context and waste the entire session.
|
|
4
4
|
|
|
5
|
+
## Think in Code — MANDATORY
|
|
6
|
+
|
|
7
|
+
When you need to analyze, count, filter, compare, search, parse, transform, or process data: **write code** that does the work via `mcp__context-mode__ctx_execute(language, code)` and `console.log()` only the answer. Do NOT read raw data into context to process mentally. Your role is to PROGRAM the analysis, not to COMPUTE it. Write robust, pure JavaScript — no npm dependencies, only Node.js built-ins (`fs`, `path`, `child_process`). Always use `try/catch`, handle `null`/`undefined`, and ensure compatibility with both Node.js and Bun. One script replaces ten tool calls and saves 100x context.
|
|
8
|
+
|
|
5
9
|
## BLOCKED commands — do NOT attempt these
|
|
6
10
|
|
|
7
11
|
### curl / wget — BLOCKED
|
package/configs/kilo/AGENTS.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
You have context-mode MCP tools available. These rules are NOT optional — they protect your context window from flooding. A single unrouted command can dump 56 KB into context and waste the entire session.
|
|
4
4
|
|
|
5
|
+
## Think in Code — MANDATORY
|
|
6
|
+
|
|
7
|
+
When you need to analyze, count, filter, compare, search, parse, transform, or process data: **write code** that does the work via `context-mode_ctx_execute(language, code)` and `console.log()` only the answer. Do NOT read raw data into context to process mentally. Your role is to PROGRAM the analysis, not to COMPUTE it. Write robust, pure JavaScript — no npm dependencies, only Node.js built-ins (`fs`, `path`, `child_process`). Always use `try/catch`, handle `null`/`undefined`, and ensure compatibility with both Node.js and Bun. One script replaces ten tool calls and saves 100x context.
|
|
8
|
+
|
|
5
9
|
## BLOCKED commands — do NOT attempt these
|
|
6
10
|
|
|
7
11
|
### curl / wget — BLOCKED
|
package/configs/kiro/KIRO.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
You have context-mode MCP tools available. These rules are NOT optional — they protect your context window from flooding. A single unrouted command can dump 56 KB into context and waste the entire session.
|
|
4
4
|
|
|
5
|
+
## Think in Code — MANDATORY
|
|
6
|
+
|
|
7
|
+
When you need to analyze, count, filter, compare, search, parse, transform, or process data: **write code** that does the work via `@context-mode/ctx_execute(language, code)` and `console.log()` only the answer. Do NOT read raw data into context to process mentally. Your role is to PROGRAM the analysis, not to COMPUTE it. Write robust, pure JavaScript — no npm dependencies, only Node.js built-ins (`fs`, `path`, `child_process`). Always use `try/catch`, handle `null`/`undefined`, and ensure compatibility with both Node.js and Bun. One script replaces ten tool calls and saves 100x context.
|
|
8
|
+
|
|
5
9
|
## BLOCKED commands — do NOT attempt these
|
|
6
10
|
|
|
7
11
|
### curl / wget — BLOCKED
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
You have context-mode MCP tools available. These rules are NOT optional — they protect your context window from flooding. A single unrouted command can dump 56 KB into context and waste the entire session.
|
|
4
4
|
|
|
5
|
+
## Think in Code — MANDATORY
|
|
6
|
+
|
|
7
|
+
When you need to analyze, count, filter, compare, search, parse, transform, or process data: **write code** that does the work via `ctx_execute(language, code)` and `console.log()` only the answer. Do NOT read raw data into context to process mentally. Your role is to PROGRAM the analysis, not to COMPUTE it. Write robust, pure JavaScript — no npm dependencies, only Node.js built-ins (`fs`, `path`, `child_process`). Always use `try/catch`, handle `null`/`undefined`, and ensure compatibility with both Node.js and Bun. One script replaces ten tool calls and saves 100x context.
|
|
8
|
+
|
|
5
9
|
## BLOCKED commands — do NOT attempt these
|
|
6
10
|
|
|
7
11
|
### curl / wget — BLOCKED
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
You have context-mode MCP tools available. These rules are NOT optional — they protect your context window from flooding. A single unrouted command can dump 56 KB into context and waste the entire session.
|
|
4
4
|
|
|
5
|
+
## Think in Code — MANDATORY
|
|
6
|
+
|
|
7
|
+
When you need to analyze, count, filter, compare, search, parse, transform, or process data: **write code** that does the work via `context-mode_ctx_execute(language, code)` and `console.log()` only the answer. Do NOT read raw data into context to process mentally. Your role is to PROGRAM the analysis, not to COMPUTE it. Write robust, pure JavaScript — no npm dependencies, only Node.js built-ins (`fs`, `path`, `child_process`). Always use `try/catch`, handle `null`/`undefined`, and ensure compatibility with both Node.js and Bun. One script replaces ten tool calls and saves 100x context.
|
|
8
|
+
|
|
5
9
|
## BLOCKED commands — do NOT attempt these
|
|
6
10
|
|
|
7
11
|
### curl / wget — BLOCKED
|
package/configs/pi/AGENTS.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
You have context-mode MCP tools available. These rules are NOT optional — they protect your context window from flooding. A single unrouted command can dump 56 KB into context and waste the entire session. Pi enforces routing via hooks (`tool_call` blocks `curl`/`wget`) AND these instructions. Hooks provide hard enforcement at the tool level; these rules provide completeness — covering redirections and patterns that hooks alone cannot catch. Follow them strictly.
|
|
4
4
|
|
|
5
|
+
## Think in Code — MANDATORY
|
|
6
|
+
|
|
7
|
+
When you need to analyze, count, filter, compare, search, parse, transform, or process data: **write code** that does the work via `ctx_execute(language, code)` and `console.log()` only the answer. Do NOT read raw data into context to process mentally. Your role is to PROGRAM the analysis, not to COMPUTE it. Write robust, pure JavaScript — no npm dependencies, only Node.js built-ins (`fs`, `path`, `child_process`). Always use `try/catch`, handle `null`/`undefined`, and ensure compatibility with both Node.js and Bun. One script replaces ten tool calls and saves 100x context.
|
|
8
|
+
|
|
5
9
|
## BLOCKED commands — do NOT use these
|
|
6
10
|
|
|
7
11
|
### curl / wget — FORBIDDEN (hook-enforced)
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
You have context-mode MCP tools available. These rules are NOT optional — they protect your context window from flooding. A single unrouted command can dump 56 KB into context and waste the entire session.
|
|
4
4
|
|
|
5
|
+
## Think in Code — MANDATORY
|
|
6
|
+
|
|
7
|
+
When you need to analyze, count, filter, compare, search, parse, transform, or process data: **write code** that does the work via `ctx_execute(language, code)` and `console.log()` only the answer. Do NOT read raw data into context to process mentally. Your role is to PROGRAM the analysis, not to COMPUTE it. Write robust, pure JavaScript — no npm dependencies, only Node.js built-ins (`fs`, `path`, `child_process`). Always use `try/catch`, handle `null`/`undefined`, and ensure compatibility with both Node.js and Bun. One script replaces ten tool calls and saves 100x context.
|
|
8
|
+
|
|
5
9
|
## BLOCKED commands — do NOT attempt these
|
|
6
10
|
|
|
7
11
|
### curl / wget — BLOCKED
|
package/configs/zed/AGENTS.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
You have context-mode MCP tools available. These rules are NOT optional — they protect your context window from flooding. A single unrouted command can dump 56 KB into context and waste the entire session. Zed does NOT have hooks, so these instructions are your ONLY enforcement mechanism. Follow them strictly.
|
|
4
4
|
|
|
5
|
+
## Think in Code — MANDATORY
|
|
6
|
+
|
|
7
|
+
When you need to analyze, count, filter, compare, search, parse, transform, or process data: **write code** that does the work via `mcp:context-mode:ctx_execute(language, code)` and `console.log()` only the answer. Do NOT read raw data into context to process mentally. Your role is to PROGRAM the analysis, not to COMPUTE it. Write robust, pure JavaScript — no npm dependencies, only Node.js built-ins (`fs`, `path`, `child_process`). Always use `try/catch`, handle `null`/`undefined`, and ensure compatibility with both Node.js and Bun. One script replaces ten tool calls and saves 100x context.
|
|
8
|
+
|
|
5
9
|
## BLOCKED commands — do NOT use these
|
|
6
10
|
|
|
7
11
|
### curl / wget — FORBIDDEN
|
package/hooks/core/routing.mjs
CHANGED
|
@@ -220,7 +220,7 @@ export function routePreToolUse(toolName, toolInput, projectDir, platform) {
|
|
|
220
220
|
return {
|
|
221
221
|
action: "modify",
|
|
222
222
|
updatedInput: {
|
|
223
|
-
command: `echo "context-mode: curl/wget blocked.
|
|
223
|
+
command: `echo "context-mode: curl/wget blocked. Think in Code — use ${t("ctx_execute")}(language, code) to write code that fetches, processes, and prints only the answer. Or use ${t("ctx_fetch_and_index")}(url, source) to fetch and index. Write pure JS with try/catch, no npm deps. Do NOT retry with curl/wget."`,
|
|
224
224
|
},
|
|
225
225
|
};
|
|
226
226
|
}
|
|
@@ -242,7 +242,7 @@ export function routePreToolUse(toolName, toolInput, projectDir, platform) {
|
|
|
242
242
|
return {
|
|
243
243
|
action: "modify",
|
|
244
244
|
updatedInput: {
|
|
245
|
-
command: `echo "context-mode: Inline HTTP blocked.
|
|
245
|
+
command: `echo "context-mode: Inline HTTP blocked. Think in Code — use ${t("ctx_execute")}(language, code) to write code that fetches, processes, and console.log() only the result. Write robust pure JS with try/catch, no npm deps. Do NOT retry with Bash."`,
|
|
246
246
|
},
|
|
247
247
|
};
|
|
248
248
|
}
|
|
@@ -254,7 +254,7 @@ export function routePreToolUse(toolName, toolInput, projectDir, platform) {
|
|
|
254
254
|
return {
|
|
255
255
|
action: "modify",
|
|
256
256
|
updatedInput: {
|
|
257
|
-
command: `echo "context-mode: Build tool redirected
|
|
257
|
+
command: `echo "context-mode: Build tool redirected. Think in Code — use ${t("ctx_execute")}(language: \\"shell\\", code: \\"${safeCmd} 2>&1 | tail -30\\") to run and print only errors/summary. Do NOT retry with Bash."`,
|
|
258
258
|
},
|
|
259
259
|
};
|
|
260
260
|
}
|
|
@@ -278,7 +278,7 @@ export function routePreToolUse(toolName, toolInput, projectDir, platform) {
|
|
|
278
278
|
const url = toolInput.url ?? "";
|
|
279
279
|
return {
|
|
280
280
|
action: "deny",
|
|
281
|
-
reason: `context-mode: WebFetch blocked.
|
|
281
|
+
reason: `context-mode: WebFetch blocked. Think in Code — use ${t("ctx_fetch_and_index")}(url: "${url}", source: "...") to fetch and index, then ${t("ctx_search")}(queries: [...]) to query. Or use ${t("ctx_execute")}(language, code) to fetch, process, and console.log() only what you need. Write pure JS, no npm deps. Do NOT use curl, wget, or WebFetch.`,
|
|
282
282
|
};
|
|
283
283
|
}
|
|
284
284
|
|
package/openclaw.plugin.json
CHANGED
|
@@ -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.64",
|
|
7
7
|
"sandbox": {
|
|
8
8
|
"mode": "permissive",
|
|
9
9
|
"filesystem_access": "full",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.64",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MCP plugin that saves 98% of your context window. Works with Claude Code, Gemini CLI, VS Code Copilot, OpenCode, and Codex CLI. Sandboxed code execution, FTS5 knowledge base, and intent-driven search.",
|
|
6
6
|
"author": "Mert Koseoğlu",
|