By ruizrica
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. 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:ctx-doctor
Show how much context window context-mode saved this session. Displays token consumption, context savings ratio, and per-tool breakdown. Trigger: /context-mode:ctx-stats
Update context-mode from GitHub and fix hooks/settings. Pulls latest, builds, installs, updates npm global, configures hooks. Trigger: /context-mode:ctx-upgrade
Matches all tools
Hooks run on every tool call, not just specific ones
Admin access level
Server config contains admin-level keywords
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.
Executes bash commands
Hook triggers when Bash tool is used
Executes bash commands
Hook triggers when Bash tool is used
The other half of the context problem.
Every MCP tool call dumps raw data into your 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. And when the agent compacts the conversation to free space, it forgets which files it was editing, what tasks are in progress, and what you last asked for.
Context Mode is an MCP server that solves both halves of this problem:
--continue, previous session data is deleted immediately — a fresh session means a clean slate.https://github.com/user-attachments/assets/07013dbf-07c0-4ef1-974a-33ea1207637b
Step 1 — Install the plugin:
/plugin marketplace add mksglu/context-mode
/plugin install context-mode@context-mode
Step 2 — Restart Claude Code.
That's it. The plugin installs everything automatically:
ctx_batch_execute, ctx_execute, ctx_execute_file, ctx_index, ctx_search, ctx_fetch_and_index)CLAUDE.md routing instructions file auto-created in your project root| Command | What it does |
|---|---|
/context-mode:ctx-stats | Context savings — per-tool breakdown, tokens consumed, savings ratio. |
/context-mode:ctx-doctor | Diagnostics — runtimes, hooks, FTS5, plugin registration, versions. |
/context-mode:ctx-upgrade | Pull latest, rebuild, migrate cache, fix hooks. |
Note: Slash commands are a Claude Code plugin feature. On other platforms, all three utility commands (
ctx stats,ctx doctor,ctx upgrade) work as MCP tools — just type the command name and the model will invoke it. See Utility Commands.
Alternative — MCP-only install (no hooks or slash commands):
claude mcp add context-mode -- npx -y context-mode
This gives you the 6 sandbox tools but without automatic routing. The model can still use them — it just won't be nudged to prefer them over raw Bash/Read/WebFetch. Good for trying it out before committing to the full plugin.
Step 1 — Install globally:
npm install -g context-mode
Step 2 — Register the MCP server. Add to ~/.gemini/settings.json:
{
"mcpServers": {
"context-mode": {
"command": "context-mode"
}
}
}
Step 3 — Add hooks. Without hooks, the model can ignore routing instructions and dump raw output into your context window. Hooks intercept every tool call and enforce sandbox routing programmatically — blocking curl, wget, and other data-heavy commands before they execute. Add to the same ~/.gemini/settings.json:
npx claudepluginhub ruizrica/claude-context-modeComplete Claude Code power-user configuration with multi-agent orchestration, TDD workflows, and advanced productivity commands
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.
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.