context-mode 1.0.131 → 1.0.133
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/README.md +26 -15
- package/build/cli.js +32 -0
- package/build/lifecycle.d.ts +51 -2
- package/build/lifecycle.js +67 -3
- package/build/server.js +118 -16
- package/build/session/analytics.d.ts +38 -0
- package/build/session/analytics.js +58 -1
- package/build/session/extract.d.ts +7 -0
- package/build/session/extract.js +22 -6
- package/build/store.d.ts +17 -2
- package/build/store.js +17 -13
- package/build/util/sibling-mcp.d.ts +40 -0
- package/build/util/sibling-mcp.js +116 -11
- package/cli.bundle.mjs +174 -165
- package/configs/jetbrains-copilot/mcp.json +1 -2
- package/configs/vscode-copilot/mcp.json +1 -2
- package/hooks/session-extract.bundle.mjs +2 -2
- package/hooks/session-loaders.mjs +15 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +5 -2
- package/scripts/heal-better-sqlite3.mjs +99 -2
- package/scripts/postinstall.mjs +58 -0
- package/server.bundle.mjs +106 -104
- package/skills/context-mode/SKILL.md +1 -0
- package/skills/context-mode/references/anti-patterns.md +26 -0
|
@@ -283,6 +283,7 @@ Subagents automatically receive context-mode tool routing via a PreToolUse hook.
|
|
|
283
283
|
- Using `cat large-file.json` via Bash → entire file in context. Use `ctx_execute_file` instead.
|
|
284
284
|
- Using `gh pr list` via Bash → raw JSON in context. Use `ctx_execute` with `--jq` filter instead.
|
|
285
285
|
- Piping Bash output through `| head -20` → you lose the rest. Use `ctx_execute` to analyze ALL data and print summary.
|
|
286
|
+
- Narrowing `ctx_execute` output upstream of capture → `ctx_execute` captures, `ctx_search` filters; merging the layers drops data that the index never sees. See `references/anti-patterns.md` §8.
|
|
286
287
|
- Running `npm test` via Bash → full test output in context. Use `ctx_execute` to capture and summarize.
|
|
287
288
|
- Calling `browser_snapshot()` WITHOUT `filename` parameter → 135K tokens flood context. **Always** use `browser_snapshot(filename: "/tmp/snap.md")`.
|
|
288
289
|
- Calling `browser_console_messages()` or `browser_network_requests()` WITHOUT `filename` → entire output floods context. **Always** use the `filename` parameter.
|
|
@@ -244,6 +244,32 @@ GOOD — specific and actionable:
|
|
|
244
244
|
|
|
245
245
|
---
|
|
246
246
|
|
|
247
|
+
## 8. `ctx_execute` Captures, `ctx_search` Filters — Don't Merge the Layers
|
|
248
|
+
|
|
249
|
+
`ctx_execute` and `ctx_search` are two layers, not one. `ctx_execute` exists to **capture** full output into the index. `ctx_search` exists to **filter** what was captured. When you narrow the output *inside* `ctx_execute` — at the shell layer, in script logic, anywhere upstream of capture — the dropped lines never reach the index. `ctx_search` cannot recover what was never written. You've spent the capture budget and lost the data you'd want to query later, for no context-window benefit: large stdout is already auto-indexed, not returned inline.
|
|
250
|
+
|
|
251
|
+
The mental model:
|
|
252
|
+
|
|
253
|
+
```
|
|
254
|
+
┌──────────────────────┐ ┌──────────────────────┐
|
|
255
|
+
│ ctx_execute │ ───▶ │ ctx_search │
|
|
256
|
+
│ (capture layer) │ │ (filter layer) │
|
|
257
|
+
│ │ │ │
|
|
258
|
+
│ produces full │ │ queries the │
|
|
259
|
+
│ output into index │ │ captured index │
|
|
260
|
+
└──────────────────────┘ └──────────────────────┘
|
|
261
|
+
▲ ▲
|
|
262
|
+
│ │
|
|
263
|
+
Job: capture Job: narrow
|
|
264
|
+
Do NOT narrow here. Do all narrowing here.
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
**Rule:** Treat `ctx_execute`'s output as write-once to the index. Run the command in full and let it index. Do every narrowing step downstream, via `ctx_search`. If you find yourself trimming inside `ctx_execute`, you are doing the filter layer's job in the capture layer — stop and move the narrowing to a `ctx_search` call.
|
|
268
|
+
|
|
269
|
+
**Why the layer separation matters:** the index is what survives across calls and across sessions. Anything you discard before the index is gone permanently from this session's queryable surface. Anything you keep is queryable, repeatedly, with different questions, at zero re-execution cost.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
247
273
|
## Summary Checklist
|
|
248
274
|
|
|
249
275
|
Before using `execute`, verify:
|