Hasty Briefsbeta

Bilingual

GitHub - mksglu/context-mode: Context window optimization for AI coding agents. Sandboxes tool output, 98% reduction. 12 platforms

2 hours ago
  • #MCP
  • #context-window
  • #privacy
  • Context Mode is an MCP server that addresses context window issues by keeping raw data out of the context window using sandbox tools, achieving up to 98% reduction in context usage.
  • It ensures session continuity by tracking all session events (file edits, git operations, tasks, errors, user decisions) in SQLite and using BM25 search via FTS5 to restore state after conversation compaction, allowing the model to resume where it left off.
  • The tool promotes a 'Think in Code' paradigm, encouraging LLMs to generate code for analysis instead of processing data directly, which reduces tool calls and saves context.
  • Installation and configuration vary across 12 platforms (e.g., Claude Code, Gemini CLI, VS Code Copilot, Cursor), with differences in hook support, routing enforcement, and session continuity capabilities.
  • Key tools include ctx_execute, ctx_batch_execute, ctx_index, ctx_search, and ctx_fetch_and_index, which process data in isolation and return only relevant outputs.
  • Session continuity relies on hooks like PreToolUse, PostToolUse, PreCompact, and SessionStart to capture events, build snapshots, and restore state, with varying support across platforms.
  • Context Mode operates locally with no telemetry, uses permission rules for security, and is licensed under Elastic License 2.0, ensuring privacy and source availability.