← Back to Leaderboard
Cmksglu

mksglu/context-mode

Local MCP execution and SQLite search keep bulky tool output out of agent context

Engineering Health (Methodology)
A · 81/100
Maintenance Activity
● Updated today
Latest Release
v2.2.6
Commercial License Check
Custom / Check Repo

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption20/25
Release Cadence20/20
License Clarity6/20
MCPCLILocal AI
Total Stars
★ 34,726
24h Growth
+13
7d Growth
+200
Forks
2,402

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

mksglu/context-mode Star History (2026-02-22 - 2026-12-04) ALL-TIME STAR HISTORY (2026-02 – 2026-12) +34.7k in 285d · avg +122/day 36.7k 18.3k 0 2026-02-22: ★ 12026-03-14: ★ 4,3342026-04-04: ★ 6,2912026-04-25: ★ 9,8752026-05-16: ★ 14,4862026-06-06: ★ 16,1392026-06-27: ★ 17,8592026-07-18: ★ 18,7082026-08-08: ★ 19,4072026-08-29: ★ 19,9612026-09-19: ★ 23,4132026-10-10: ★ 26,2012026-10-31: ★ 32,8882026-11-18: ★ 34,2232026-12-04: ★ 34,726 ★ 34.7k 2026-02 2026-07 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

Context Mode is a local Node.js MCP server and host-plugin layer, not a model runtime. SessionStart opens the project's context.db under ~/.context-mode and can prompt the agent to call ctx_resume. The PreToolUse policy in src/core/policy/decide.ts checks the user's deny list first, then evaluates fetches, shell commands, and large whole-file reads for routing. Reads with an explicit line range proceed normally.

In Code Mode, ctx_execute writes the agent's script to a temporary directory and launches the chosen runtime with an argument list, using the project directory as the working directory. It strips preload variables such as NODE_OPTIONS, caps returned output at 16,384 bytes, and terminates the process tree on timeout. Large results can be retained in SQLite and retrieved selectively through FTS5 rather than inserted wholesale into the model's context.

Key Capabilities & Differentiators

The integration covers 11 coding agents, including Claude Code, Codex, Gemini CLI, Pi, OpenCode, and VS Code with Copilot. ctx_execute reduces data in code before the agent has to read it; ctx_index and ctx_search support later lookups; ctx_batch runs multiple commands before searching their results. Hook-based routing can also externalize supported host-tool output without requiring the agent to request each explicit tool call.

The macOS arm64 benchmark of 2.0.0-next.23 measured ctx_bytes against raw_bytes, using five runs per row. For the 36 rows with at least 10 KB of raw output, median byte savings were 99.4%; sandbox execution saved 99.5%, while retrieval saved 77.2% because it returns matching text. These figures quantify bytes withheld from context, not equivalent reductions in tokens, latency, or model cost.

Trade-offs & Limitations

Compared with native line-range reads or shell filters, Context Mode pays off most when a large result will be queried repeatedly or reduced to a few facts. For short outputs or a known line range, native tools are simpler. FTS5 is lexical retrieval, so important evidence can be missed by a poorly phrased query; check excerpts or rerun a targeted read when completeness matters. Local indexes also use disk and can retain sensitive output.

The sandbox is designed to control execution output and time, not to establish a strong trust boundary: child processes run in the project directory and inherit most of the environment. Keep host permissions and secret handling in place. The local plugin is free and source-available, but review LICENSE before redistribution or bundling. The paid Gateway is a separate hosted service for conversation recall and cross-session memory, not a requirement for the local plugin.

Hardware & Deployment Guide

Run it alongside the coding agent with Node.js 24.15.0 or later. On Windows, shell tools require Git for Windows and run in Git Bash. Use the host's native plugin installer or install with npm i -g context-mode and run context-mode setup; setup backs up configuration and can repair incomplete installations. The native Codex path also requires a one-time hook setup with context-mode setup --agents codex. Restart the host and run /ctx-doctor or the host-specific equivalent.

Execution, indexing, and search can run offline after installation; fetching a remote URL still requires network access. No model serving or GPU is required by the plugin. Release v2.2.3 fixed the replacement trigger at 4,096 bytes, distinct from the 16,384-byte output cap. Version 2.2.5 added support for passing Claude Code's session scratchpad to ctx_index and ctx_execute.

Host integration: 11 coding agents use packaged hooks, configured hooks, or in-process event handlers.
Execution limits: ctx_execute uses an argument-list subprocess, a 16,384-byte output cap, and a 600,000 ms default and maximum timeout.
Local retrieval: SQLite FTS5 searches tool output kept in a per-project context.db under ~/.context-mode.
Session continuity: SessionStart opens the project database and can prompt the agent to call ctx_resume.
Benchmark scope: On 36 rows with at least 10 KB of raw output, the median share of bytes kept out of context was 99.4%; retrieval alone saved 77.2%.
Operational checks: context-mode setup repairs integration, and packed-package CI checks setup, doctor, a hook, and MCP handshakes across Linux, macOS, and Windows.
Best For

Coding-agent workflows that generate large build logs, API responses, or documentation dumps and need only a few facts or excerpts at a time.

Skip If

Native reads and filters already keep output small, you need full transcripts in model context, or policy prohibits local retention of tool output.

Reviewed on 2026-12-03 · Grounded in GitHub README, root file tree & releases · Newer release v2.2.6 (2026-12-03) shipped after this reviewMethodology

Quick Start & Installation

MCPCLILocal AI
codex plugin marketplace add mksglu/context-mode
codex plugin add context-mode@context-mode
# one-time step: trust the plugin hooks
npm i -g context-mode
context-mode setup --agents codex

Comparison vs. Top Coding, Skills & MCP Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
context-mode ★34.7k+200JavaScript—Local MCP execution and SQLite search keep bulky tool output out of agent contex
agent-skills122.5k+1.7kJavaScriptMITA modular skill pack for consistent coding-agent workflows, from spec to release
graphify156.8k+2.4kPythonApache-2.0Local AST graphs for dependency tracing, with CLI and MCP access.
taste-skill125.3k+2.9kJavaScriptMITAn agent skill for directing company website design and checking builds in a bro

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/mksglu/context-mode.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

mksglu/context-mode Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about context-mode

Does a working MCP connection mean automatic output interception is active?

No. Hooks handle automatic routing of supported host calls; ctx_execute, ctx_index, and ctx_search provide explicit execution, indexing, and retrieval. The hook delivery mechanism varies by host: a packaged hook, a configured hook file, or in-process plugin handlers. Verify both hooks and tool availability with the host's doctor workflow.

What should I budget for CPU, disk, and VRAM?

The plugin requires Node.js 24.15.0 or later, local SQLite storage, and the runtimes used by the scripts you execute. It does not require a GPU or its own model. Size disk for retained output and indexes, and CPU and RAM for the subprocesses you actually run. Any GPU requirement belongs to your separately configured model or workload.

Can my company run the plugin locally without buying Gateway?

The local plugin is free for personal and workplace use under a source-available license. Review the repository's LICENSE before redistributing it, shipping a fork, or bundling it in a product; free use does not establish those rights. The local plugin does not require the separately hosted Gateway subscription.

When is this better than line-range reads and shell filters?

Use line-range reads or shell filters when you already know what to extract. Context Mode is more useful when follow-up questions are unpredictable: it can retain large results in a local index and let the agent query them again without rerunning the original command or reinserting the full output into the conversation.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining mksglu/context-mode? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature mksglu/context-mode on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare