context-mode

context-mode is an MCP server that saves 98% of your context window by sandboxing tool outputs. It routes large file reads, shell outputs, and web fetches through SQLite + FTS5 instead of flooding the context. Also provides session continuity across context compactions via BM25 retrieval.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "context-mode" with this command: npx skills add 1yihui/yihui-context-mode

Context Mode

An MCP server that solves the context window problem in AI coding agents. It provides:

  1. Context Saving — sandbox tools keep raw data out of context window
  2. Session Continuity — SQLite + FTS5 for event tracking
  3. Think in Code — program analysis instead of reading files
  4. Output Compression — terse output format reducing tokens 65-75%

Available Tools

ToolWhen to UseToken Savings
ctx_batch_executeRun multiple commands + auto-search results90%+ vs raw exec
ctx_executeSingle script execution (JS/Python/Shell)90%+ vs raw exec
ctx_execute_fileRun code from a file, return only resulthigh
ctx_indexIndex docs/knowledge into searchable FTS5
ctx_searchSearch indexed content with BM25fast recall
ctx_fetch_and_indexFetch URL + index into knowledge base90%+ vs raw web fetch

Decision Rules

Use ctx_batch_execute instead of multiple exec/read calls when:

  • Analyzing multiple files at once
  • Counting/grepping across many files
  • Need command output + search results together

Use ctx_execute instead of reading files when:

  • User asks "how many lines/funcs/classes in X"
  • Need to compute something, not just read it

Use ctx_fetch_and_index instead of web_fetch when:

  • Researching a topic across multiple pages
  • Full raw content won't fit in context

Output Format

Terse. Drop filler, pleasantries, hedging.

❌ "So I ran a command to check the files and found that there are..."
✅ "Checked. 3 TypeScript files: src/index.ts (142 lines), src/cli.ts (89 lines)."

OpenClaw Integration

Install via MCP:

openclaw mcp set context-mode '{"command":"npx","args":["-y","context-mode"]}'
openclaw gateway restart

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Dida Coach

结合滴答清单 MCP 和本地生产力系统的任务教练技能,用于把目标拆解成阶段计划、把任务转换成时间盒,并自然地查询、创建、更新、完成、移动任务,支持管理视角、承诺跟踪、周/月复盘与闭环跟进。用户提到“拆目标”“做计划”“时间盒”“复盘”“改时间”“提醒”“拖延”“查任务”“完成任务”“清单管理”“生产力系统”“承诺...

Registry SourceRecently Updated
2421Profile unavailable
General

Token Budget Guard

Automatically manages and compresses context to optimize token usage by summarizing, selectively loading, and budgeting for tool schemas, history, and tasks.

Registry SourceRecently Updated
1140Profile unavailable
General

OmniFocus MCP for OpenClaw

Review what is due, capture new tasks, build projects from notes, and organize OmniFocus from natural language in OpenClaw on macOS. Use this when the user w...

Registry SourceRecently Updated
831Profile unavailable
General

OpenClaw Token Optimizer

Reduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session prunin...

Registry Source
9.8K28Profile unavailable