By eskoNBG
Claude Code MCP plugin that saves 98% of your context window. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.
Use context-mode tools (execute, execute_file) instead of Bash/cat when processing large outputs. Trigger phrases: "analyze logs", "summarize output", "process data", "parse JSON", "filter results", "extract errors", "check build output", "analyze dependencies", "process API response", "large file analysis", "extract elements", "page snapshot", "browser snapshot", "take a snapshot", "DOM structure", "inspect page", "form fields", "element selectors", "web page structure", "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", "hit endpoint", "call API", "check response", "query results", "show tables", "find TODOs", "count lines", "codebase statistics", "security audit", "outdated packages", "dependency tree", "cloud resources", "CI/CD output". Also triggers on ANY MCP tool output (Playwright, Context7, GitHub API) that may exceed 20 lines, and any operation where output size is uncertain. Subagent routing is handled automatically via PreToolUse hook — no manual tool names needed in prompts.
Run context-mode diagnostics. Checks runtimes, hooks, FTS5, plugin registration, npm and marketplace versions. Trigger: /context-mode:doctor
Show how much context window context-mode saved this session. Displays token consumption, context savings ratio, and per-tool breakdown. Trigger: /context-mode:stats
Update context-mode from GitHub and fix hooks/settings. Pulls latest, builds, installs, updates npm global, configures hooks. Trigger: /context-mode:upgrade
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.
The other half of the context problem.
Every MCP tool call in Claude Code dumps raw data into your 200K context window. A Playwright snapshot costs 56 KB. Twenty GitHub issues cost 59 KB. One access log — 45 KB. After 30 minutes, 40% of your context is gone.
Inspired by Cloudflare's Code Mode — which compresses tool definitions from millions of tokens into ~1,000 — we asked: what about the other direction?
Context Mode is an MCP server that sits between Claude Code and these outputs. 315 KB becomes 5.4 KB. 98% reduction.
https://github.com/user-attachments/assets/07013dbf-07c0-4ef1-974a-33ea1207637b
/plugin marketplace add mksglu/claude-context-mode
/plugin install context-mode@claude-context-mode
Restart Claude Code. Done. This installs the MCP server + a PreToolUse hook that automatically routes tool outputs through the sandbox + slash commands for diagnostics and upgrades.
| Command | What it does |
|---|---|
/context-mode:stats | Show context savings for the current session — per-tool breakdown, tokens consumed, savings ratio. |
/context-mode:doctor | Run diagnostics — checks runtimes, hooks, FTS5, plugin registration, npm and marketplace versions. |
/context-mode:upgrade | Pull latest from GitHub, rebuild, migrate cache, fix hooks. |
claude mcp add context-mode -- npx -y context-mode
claude --plugin-dir ./path/to/context-mode
MCP has become the standard way for AI agents to use external tools. But there is a tension at its core: every tool interaction fills the context window from both sides — definitions on the way in, raw output on the way out.
With 81+ tools active, 143K tokens (72%) get consumed before your first message. And then the tools start returning data. A single Playwright snapshot burns 56 KB. A gh issue list dumps 59 KB. Run a test suite, read a log file, fetch documentation — each response eats into what remains.
Code Mode showed that tool definitions can be compressed by 99.9%. Context Mode applies the same principle to tool outputs — processing them in sandboxes so only summaries reach the model.
| Tool | What it does | Context saved |
|---|---|---|
batch_execute | Run multiple commands + search multiple queries in ONE call. | 986 KB → 62 KB |
execute | Run code in 10 languages. Only stdout enters context. | 56 KB → 299 B |
execute_file | Process files in sandbox. Raw content never leaves. | 45 KB → 155 B |
index | Chunk markdown into FTS5 with BM25 ranking. | 60 KB → 40 B |
search | Query indexed content with multiple queries in one call. | On-demand retrieval |
fetch_and_index | Fetch URL, convert to markdown, index. | 60 KB → 40 B |
Each execute call spawns an isolated subprocess with its own process boundary. Scripts can't access each other's memory or state. The subprocess runs your code, captures stdout, and only that stdout enters the conversation context. The raw data — log files, API responses, snapshots — never leaves the sandbox.
Eleven language runtimes are available: JavaScript, TypeScript, Python, Shell, Ruby, Go, Rust, PHP, Perl, R, and Elixir. Bun is auto-detected for 3-5x faster JS/TS execution.
Authenticated CLIs work through credential passthrough — gh, aws, gcloud, kubectl, docker inherit environment variables and config paths without exposing them to the conversation.
When output exceeds 5 KB and an intent is provided, Context Mode switches to intent-driven filtering: it indexes the full output into the knowledge base, searches for sections matching your intent, and returns only the relevant matches with a vocabulary of searchable terms for follow-up queries.
Production-grade configuration framework for Claude Code
npx claudepluginhub eskonbg/claude-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. 35 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.
Core Hugging Face Hub operations through the hf CLI, including skill installation, repo management, jobs, datasets, models, Spaces, and discovery.