By zhangyejian
MCP server that saves 98% of your context window with session continuity. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and automatic state restore across compactions.
Use context-mode tools (ctx_execute, ctx_execute_file) instead of Bash/cat when processing large outputs. Triggers: "analyze logs", "summarize output", "process data", "parse JSON", "filter results", "extract errors", "check build output", "analyze dependencies", "process API response", "large file analysis", "page snapshot", "browser snapshot", "DOM structure", "inspect page", "accessibility tree", "Playwright snapshot", "run tests", "test output", "coverage report", "git log", "recent commits", "diff between branches", "list containers", "pod status", "disk usage", "fetch docs", "API reference", "index documentation", "call API", "check response", "query results", "find TODOs", "count lines", "codebase statistics", "security audit", "outdated packages", "dependency tree", "cloud resources", "CI/CD output". Also triggers on ANY MCP tool output that may exceed 20 lines. Subagent routing is handled automatically via PreToolUse hook.
Run context-mode diagnostics. Checks runtimes, hooks, FTS5, plugin registration, npm and marketplace versions. Trigger: /context-mode:ctx-doctor
Open the context-mode Insight analytics dashboard in the browser. Shows personal metrics: session activity, tool usage, error rate, parallel work patterns, project focus, and actionable insights. First run installs dependencies (~30s). Subsequent runs open instantly. Trigger: /context-mode:ctx-insight
Purge the context-mode knowledge base. Permanently deletes all indexed content and resets session stats. This is destructive and cannot be undone. Trigger: /context-mode:ctx-purge
Show how much context window context-mode saved this session. Displays token consumption, context savings ratio, and per-tool breakdown. Read-only — shows stats only, no reset capability. To wipe the knowledge base entirely, use ctx_purge instead. Trigger: /context-mode:ctx-stats
Admin access level
Server config contains admin-level keywords
Executes bash commands
Hook triggers when Bash tool is used
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Modifies files
Hook triggers on file write and edit operations
Modifies files
Hook triggers on file write and edit operations
This repository is a modified distribution of mksglu/context-mode v1.0.151.
The upstream project is licensed under the Elastic License 2.0. This repository keeps the same license and preserves the upstream copyright notice. See LICENSE.
Chinese documentation: README.zh-CN.md
Original upstream README: README.upstream.md
This fork is intended for environments where context-mode runs inside a container and outbound web access must go through a local Clash/mihomo proxy.
The relevant changes are:
start.mjs
HTTP_PROXY=http://127.0.0.1:7890HTTPS_PROXY=http://127.0.0.1:7890ALL_PROXY=socks5h://127.0.0.1:7891NO_PROXY=localhost,127.0.0.1,::1,10.0.0.0/8,192.168.0.0/16,172.16.0.0/12.codex-plugin/mcp.json
src/executor.ts and server.bundle.mjs
ctx_execute, ctx_execute_file, and ctx_batch_execute.src/server.ts and server.bundle.mjs
ctx_fetch_and_index.ctx_fetch_and_index: when proxy
variables are present, the generated fetch script uses curl, which honors
HTTP_PROXY, HTTPS_PROXY, and ALL_PROXY, then continues through the
normal context-mode markdown conversion and indexing path.See MODIFICATIONS.md for implementation details.
In some containerized setups:
.bashrc;fetch does not automatically use
HTTP_PROXY / HTTPS_PROXY / ALL_PROXY;This fork makes context-mode proxy-aware by default for that environment.
This fork intentionally changes part of upstream's ctx_fetch_and_index
security behavior.
Upstream removed proxy environment variables from the fetch subprocess to avoid
proxy-based bypasses of its DNS rebinding / SSRF checks. This fork keeps proxy
variables and uses curl when proxy variables are present. That is necessary
for the target proxy-based environment, but it is less restrictive than the
upstream design.
Do not use this fork for untrusted URL fetching unless you accept that tradeoff.
The default proxy endpoints assume a common Clash/mihomo setup:
HTTP_PROXY=http://127.0.0.1:7890
HTTPS_PROXY=http://127.0.0.1:7890
ALL_PROXY=socks5h://127.0.0.1:7891
If your proxy uses different ports, set those environment variables before starting Codex/context-mode. Existing values are preserved; the defaults are only used when the variables are missing.
The modified version was tested with:
ctx_execute reading proxy variables inside the sandbox;ctx_execute successfully fetching https://news.ycombinator.com/;ctx_fetch_and_index successfully fetching and indexing Hacker News through
the proxy-aware path;ctx_search retrieving content from the indexed Hacker News source;start.mjs, server.bundle.mjs, and .codex-plugin/mcp.json.This is a derivative work of context-mode and remains under the Elastic License 2.0. See LICENSE.
npx claudepluginhub zhangyejian/contextmodewithproxy --plugin context-modeMCP server that saves 98% of your context window with session continuity. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and automatic state restore across compactions.
Open-source, local-first Claude Code plugin for token reduction, context compression, and cost optimization using hybrid RAG retrieval (BM25 + vector search), reranking, AST-aware chunking, and compact context packets.
Give your AI a memory — mine projects and conversations into a searchable palace. 33 MCP tools, auto-save hooks, and guided setup.
Complete AI coding workflow system. Self-correcting memory + persistent FTS5-indexed research wikis + auto-research loop + multi-LLM council on a single SQLite store. 33 skills, 8 agents, 22 commands, 37 hook scripts across 24 events. Cross-agent via SkillKit.
Write SQL, explore datasets, and generate insights faster. Build visualizations and dashboards, and turn raw data into clear stories for stakeholders.
Agent Skills for AI/ML tasks including dataset creation, model training, evaluation, and research paper publishing on Hugging Face Hub