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.
@@ -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
@@ -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
@@ -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 `@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
@@ -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
@@ -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
@@ -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. You MUST use ${t("ctx_fetch_and_index")}(url, source) to fetch URLs, or ${t("ctx_execute")}(language, code) to run HTTP calls in sandbox. Do NOT retry with curl/wget."`,
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. Use ${t("ctx_execute")}(language, code) to run HTTP calls in sandbox, or ${t("ctx_fetch_and_index")}(url, source) for web pages. Do NOT retry with Bash."`,
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 to sandbox. Use ${t("ctx_execute")}(language: \\"shell\\", code: \\"${safeCmd}\\") to run this command. Do NOT retry with Bash."`,
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. Use ${t("ctx_fetch_and_index")}(url: "${url}", source: "...") to fetch this URL in sandbox. Then use ${t("ctx_search")}(queries: [...]) to query results. Do NOT use curl, wget, mcp_web_fetch, or mcp_fetch_tool.`,
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
 
@@ -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.62",
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.62",
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",