
Context Mode
github.com/mksglu/context-mode- Category
- Developer Tools
- Rank
- No. 405Tools index
- Type
- APP
- Builder
- mksglu
- GitHub
- 21.4k stars
- Latest release
- v1.0.169
- Date
About
Tool for optimizing context windows in AI coding agents across multiple platforms.
What it does
Context Mode intercepts bulky agent work before raw results fill the conversation. It runs analysis through sandboxed scripts, records session events in SQLite, indexes useful material with FTS5, and retrieves relevant fragments through BM25 search after compaction.
Why it's ranked here
This is a strong choice for long, tool-heavy coding sessions. It combines output containment, searchable session memory, diagnostics, and automatic routing on hook-capable clients. The repository also shows deliberate handling of concurrency, runtime detection, database fallback, and cross-platform failures.
What's good
Its design keeps exact source material searchable instead of replacing everything with summaries. Session tracking covers edits, Git operations, tasks, errors, and user decisions. The sandbox supports multiple languages, caps output, cleans temporary work, preserves batch result order, and isolates individual job failures.
Tradeoffs
Installation quality varies by host. Hook-capable clients get automatic routing, while others require a routing file, and MCP-only installation provides no automatic preference over raw tools. Node.js 22.5 or newer is required. Previous session data is deleted when continuation is not requested. The Elastic License 2.0 may also matter for redistribution or hosted-service plans.
How to use it well
Use it when coding agents repeatedly inspect large files, logs, web responses, or issue sets across long sessions. Try the MCP-only setup first, then adopt hooks when automatic routing proves useful. Index documentation that must remain exactly searchable. It does not manage answer tone or enforce concise prose, so keep those instructions in your agent configuration.
Technical notes+
src/server.ts builds the stdio MCP server, registers the tool surface, coordinates sandbox execution, search, session persistence, analytics, lifecycle handling, and platform adapters. src/cli.ts supplies server startup, indexing, search, diagnostics, upgrades, hook dispatch, and status-line commands. src/store.ts chunks content, limits oversized chunks, stores it in SQLite FTS5, and applies BM25 plus proximity-oriented reranking. src/db-base.ts selects Bun SQLite, modern Node SQLite with an explicit FTS5 probe, or better-sqlite3 as fallback. src/executor.ts runs temporary scripts across twelve declared languages with output caps, timeout handling, project-relative working directories, and platform-specific cleanup. src/runPool.ts provides bounded concurrency with ordered settled results. package.json configures ESM packaging, an npm binary, plugin exports, TypeScript builds, bundled artifacts, Vitest, and a Node.js >=22.5.0 engine requirement.
Observed
- License
- Elastic License 2.0
- Primary language
- TypeScript, compiled and bundled as ECMAScript modules
- Packaging
- npm package with a context-mode executable, package exports, bundled server and CLI artifacts
- Interfaces
- Stdio MCP server, command-line interface, Claude Code plugin, and native plugin adapters
- Platform support
- Repository text names Claude Code, Gemini CLI, VS Code Copilot, OpenCode, Codex CLI, OpenClaw, Cursor, Kiro, JetBrains Copilot, Kimi, Qwen Code, and others
- Runtime requirement
- Node.js 22.5 or newer; Bun integration is also implemented
- Testing surface
- Vitest unit testing plus benchmark, use-case, context-comparison, and ecosystem scripts
Read from README.md, package.json, src/cli.ts, src/server.ts, src/store.ts, src/types.ts, src/db-base.ts, src/runPool.ts, src/runtime.ts, src/executor.ts.
What it can do
Optimize context windows for AI coding agents
AI agent context data → Optimized context configuration
Analyze context window usage across platforms
Multi-platform AI agent data → Context usage analytics and insights
Configure context parameters for different AI platforms
Platform specifications and requirements → Platform-specific context settings
Monitor context window performance
AI agent execution data → Performance metrics and reports
Manage context allocation across multiple agents
Multiple AI agent instances → Distributed context allocation plan
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.