context-mode — What is it?

mksglu/context-mode is an open-source MCP plugin designed to optimize context window usage for AI coding agents, significantly reducing data bloat and improving session continuity.

⭐ 18,050 Stars 🍴 1,272 Forks TypeScript NOASSERTION Author: mksglu
Source: Official README and linked documentation View on GitHub →

Why it matters

This project is being discussed because its innovative approach to context window optimization, addressing the issue of data bloat in AI coding agents. Its unique technical choices, such as sandboxed code execution and FTS5 knowledge base, differs through the field of AI-assisted coding tools.

Source: Official README and linked documentation

Core Features

Context Saving

Sandbox tools keep raw data out of the context window, reducing data bloat by 98%.

Source: Official README and linked documentation
Session Continuity

Tracks all file edits, git operations, tasks, errors, and user decisions in SQLite, ensuring the model picks up exactly where the user left off.

Source: Official README and linked documentation
Think in Code

Encourages the use of scripts for analysis, reducing context usage by 100x compared to traditional tool calls.

Source: Official README and linked documentation
No Prose-style Enforcement

Keeps raw data out of context but does not dictate how the model writes its final answer, allowing for brevity and completeness in responses.

Source: Official README and linked documentation

Architecture

The architecture is modular, with distinct components for different platforms and functionalities. It employs design patterns like dependency injection for flexibility and uses a FTS5 knowledge base for efficient data retrieval.

Source: Official repository tree and dependency files

Project Knowledge Graph

Knowledge graph: project (center) + core features (inner hexagons) + key dependencies (outer chips) SQLite FTS5 BM25 Context Saving Session Continuity Think in Code No Prose-style EnforcementNo Prose-style Enfo… context-mode Project Core feature Key dependency

Tech Stack

LanguageTypeScriptFrameworkClaude Code, Gemini CLI, VS Code Copilot, OpenCode, and Codex CLI
SQLiteFTS5BM25
Not specified, but likely to be platform-specific
Source: Official repository tree and dependency files

Quick Start

For Claude Code: 1. Install Claude Code v1.0.33+ 2. Add context-mode to the plugin marketplace 3. Install context-mode 4. Verify installation with /context-mode:ctx-doctor For Gemini CLI: 1. Install Node.js >= 22.5 2. Install context-mode globally 3. Add context-mode to ~/.gemini/settings.json 4. Restart Gemini CLI
Source: Official README and linked documentation

Use Cases

mksglu/context-mode is suitable for developers and technical teams using AI coding agents in scenarios such as code analysis, debugging, and collaborative coding. It helps in reducing context bloat and improving the efficiency of AI-assisted coding processes.

Source: Official README and linked documentation

Strengths & Limitations

Strengths

  • Significantly reduces context bloat in AI coding agents
  • Improves session continuity and model efficiency
  • Supports multiple platforms and integrates with popular coding tools

Limitations

  • Lack of detailed documentation on architecture and implementation
  • Dependency on specific platforms and tools for full functionality
Source: Official README and linked documentation

Latest Release

v1.0.135 (2026-05-15): Fixed critical issues in the Pi adapter and Linux SIGSEGV escape hatch.

Source: Official releases

Verdict

mksglu/context-mode is a project for developers looking to optimize AI coding agents' context window usage. Its innovative features and platform support make it a tool for improving the efficiency of AI-assisted coding processes, particularly in scenarios involving large codebases and complex tasks.

Sources and review scope
This review is based on the project's public documentation. Versions, installation commands, and feature boundaries can change upstream; check the cited sources and current release before use. Sources checked on: 2026-05-22 20:52.

Reference materials: README, GitHub API, dependency files