context-mode 0.5.3 → 0.5.5
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.
|
@@ -13,7 +13,7 @@
|
|
|
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 10 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.",
|
|
16
|
-
"version": "0.5.
|
|
16
|
+
"version": "0.5.5",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "Mert Koseoğlu"
|
|
19
19
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"description": "Claude Code MCP plugin that saves 98% of your context window. Sandboxed code execution in 10 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mert Koseoğlu",
|
package/build/server.js
CHANGED
|
@@ -5,7 +5,7 @@ import { z } from "zod";
|
|
|
5
5
|
import { PolyglotExecutor } from "./executor.js";
|
|
6
6
|
import { ContentStore } from "./store.js";
|
|
7
7
|
import { detectRuntimes, getRuntimeSummary, getAvailableLanguages, hasBunRuntime, } from "./runtime.js";
|
|
8
|
-
const VERSION = "0.5.
|
|
8
|
+
const VERSION = "0.5.5";
|
|
9
9
|
const runtimes = detectRuntimes();
|
|
10
10
|
const available = getAvailableLanguages(runtimes);
|
|
11
11
|
const server = new McpServer({
|
|
@@ -389,9 +389,10 @@ server.registerTool("search", {
|
|
|
389
389
|
"- Get configuration details ('Tailwind responsive breakpoints')\n" +
|
|
390
390
|
"- Find migration steps ('App Router data fetching')\n\n" +
|
|
391
391
|
"SEARCH TIPS:\n" +
|
|
392
|
-
"-
|
|
392
|
+
"- Queries use OR semantics — results matching more terms rank higher via BM25\n" +
|
|
393
|
+
"- Use 2-4 specific technical terms per query for best results\n" +
|
|
393
394
|
"- Check 'Searchable terms' from execute/execute_file results for available vocabulary\n" +
|
|
394
|
-
"-
|
|
395
|
+
"- For broad topics, send multiple focused searches in parallel\n\n" +
|
|
395
396
|
"Returns exact content — not summaries. Each result includes heading hierarchy and full section text.",
|
|
396
397
|
inputSchema: z.object({
|
|
397
398
|
query: z.string().describe("Natural language search query"),
|
package/build/store.js
CHANGED
|
@@ -40,7 +40,7 @@ function sanitizeQuery(query) {
|
|
|
40
40
|
!["AND", "OR", "NOT", "NEAR"].includes(w.toUpperCase()));
|
|
41
41
|
if (words.length === 0)
|
|
42
42
|
return '""';
|
|
43
|
-
return words.map((w) => `"${w}"`).join(" ");
|
|
43
|
+
return words.map((w) => `"${w}"`).join(" OR ");
|
|
44
44
|
}
|
|
45
45
|
// ─────────────────────────────────────────────────────────
|
|
46
46
|
// ContentStore
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Claude Code MCP plugin that saves 98% of your context window. Sandboxed code execution, FTS5 knowledge base, and intent-driven search.",
|
|
6
6
|
"author": "Mert Koseoğlu",
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: context-mode
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
Use context-mode tools (execute, execute_file, fetch_and_index, index, search) instead of
|
|
5
|
+
Bash/curl/cat when processing large outputs. The cost of routing through context-mode is near zero,
|
|
6
|
+
but flooding context with 50KB+ of raw data is catastrophic.
|
|
7
|
+
|
|
8
|
+
Use when: user wants to "fetch documentation", "look up the docs", "fetch the docs",
|
|
9
|
+
"check the API reference", "find examples in docs", "index documentation", "search docs",
|
|
10
|
+
"analyze logs", "check the logs", "read access.log", "debug the 500s",
|
|
11
|
+
"run tests", "run the test suite", "check if tests pass", "npm test", "vitest", "pytest",
|
|
12
|
+
"git log", "show recent commits", "list commits", "what changed", "diff between branches",
|
|
13
|
+
"analyze output", "summarize output", "process data", "parse JSON", "parse CSV",
|
|
14
|
+
"filter results", "extract errors", "check build output", "analyze dependencies",
|
|
15
|
+
"process API response", "large file analysis", "hit this endpoint", "call the API",
|
|
16
|
+
"check the response", "list containers", "check pods", "outdated packages",
|
|
17
|
+
"count lines", "find TODOs", "analyze codebase", "security audit",
|
|
18
|
+
or ANY operation where output might exceed 20 lines.
|
|
19
|
+
Also use when routing output from other MCP tools (Playwright snapshots, Context7 docs,
|
|
20
|
+
GitHub API responses, Sentry data) through index → search to avoid context bloat.
|
|
10
21
|
---
|
|
11
22
|
|
|
12
23
|
# Context Mode: Default for All Large Output
|
|
@@ -81,6 +92,14 @@ Use context-mode for ANY of these, without being asked:
|
|
|
81
92
|
| Shell commands with pipes | `shell` | grep, awk, jq, native tools |
|
|
82
93
|
| File pattern matching | `shell` | find, wc, sort, uniq |
|
|
83
94
|
|
|
95
|
+
## Search Query Strategy
|
|
96
|
+
|
|
97
|
+
- BM25 uses **OR semantics** — results matching more terms rank higher automatically
|
|
98
|
+
- Use 2-4 specific technical terms per query: `search("transform refine pipe")`
|
|
99
|
+
- Send multiple `search()` calls **in parallel** for different aspects of a topic
|
|
100
|
+
- Example: instead of one broad search, send 3 focused parallel queries:
|
|
101
|
+
- `search("transform pipe preprocess")` + `search("refine superRefine check")` + `search("coerce codec")`
|
|
102
|
+
|
|
84
103
|
## Critical Rules
|
|
85
104
|
|
|
86
105
|
1. **Always console.log/print your findings.** stdout is all that enters context. No output = wasted call.
|