mksglu/context-modePublic

Context window optimization for AI coding agents. Sandboxes tool output (98% reduction), persists session memory, and enforces routing across 17 platforms via MCP + hooks.

AI summary: A context window optimization tool that sandboxes AI agent tool outputs and enforces routing across 17+ platforms.

Stars
19.7K
+46 today
Forks
1.4K
Watchers
86
Open issues
60
Open PRs
61
Contributors
~112
Commits
2.1K
Branches
2

TypeScriptOtherCreated Feb 23, 2026Last push todayLatest release v1.0.169+194 stars this week+194 this month

Star history

since Mar 1, 2026
05K10K15KMar 2026Apr 2026Jun 2026Aug 2026
19.7K stars as of Aug 7, 2026, tracked back to Mar 1, 2026. Historical curve reconstructed from public GitHub event archives, calibrated to the current total.

Contribution activity

commits per day, last 52 weeks
AugSepOctNovDecJanFebMarAprMayJunJulMonWedFri2025-08-02: 0 commits2025-08-03: 0 commits2025-08-04: 0 commits2025-08-05: 0 commits2025-08-06: 0 commits2025-08-07: 0 commits2025-08-08: 0 commits2025-08-09: 0 commits2025-08-10: 0 commits2025-08-11: 0 commits2025-08-12: 0 commits2025-08-13: 0 commits2025-08-14: 0 commits2025-08-15: 0 commits2025-08-16: 0 commits2025-08-17: 0 commits2025-08-18: 0 commits2025-08-19: 0 commits2025-08-20: 0 commits2025-08-21: 0 commits2025-08-22: 0 commits2025-08-23: 0 commits2025-08-24: 0 commits2025-08-25: 0 commits2025-08-26: 0 commits2025-08-27: 0 commits2025-08-28: 0 commits2025-08-29: 0 commits2025-08-30: 0 commits2025-08-31: 0 commits2025-09-01: 0 commits2025-09-02: 0 commits2025-09-03: 0 commits2025-09-04: 0 commits2025-09-05: 0 commits2025-09-06: 0 commits2025-09-07: 0 commits2025-09-08: 0 commits2025-09-09: 0 commits2025-09-10: 0 commits2025-09-11: 0 commits2025-09-12: 0 commits2025-09-13: 0 commits2025-09-14: 0 commits2025-09-15: 0 commits2025-09-16: 0 commits2025-09-17: 0 commits2025-09-18: 0 commits2025-09-19: 0 commits2025-09-20: 0 commits2025-09-21: 0 commits2025-09-22: 0 commits2025-09-23: 0 commits2025-09-24: 0 commits2025-09-25: 0 commits2025-09-26: 0 commits2025-09-27: 0 commits2025-09-28: 0 commits2025-09-29: 0 commits2025-09-30: 0 commits2025-10-01: 0 commits2025-10-02: 0 commits2025-10-03: 0 commits2025-10-04: 0 commits2025-10-05: 0 commits2025-10-06: 0 commits2025-10-07: 0 commits2025-10-08: 0 commits2025-10-09: 0 commits2025-10-10: 0 commits2025-10-11: 0 commits2025-10-12: 0 commits2025-10-13: 0 commits2025-10-14: 0 commits2025-10-15: 0 commits2025-10-16: 0 commits2025-10-17: 0 commits2025-10-18: 0 commits2025-10-19: 0 commits2025-10-20: 0 commits2025-10-21: 0 commits2025-10-22: 0 commits2025-10-23: 0 commits2025-10-24: 0 commits2025-10-25: 0 commits2025-10-26: 0 commits2025-10-27: 0 commits2025-10-28: 0 commits2025-10-29: 0 commits2025-10-30: 0 commits2025-10-31: 0 commits2025-11-01: 0 commits2025-11-02: 0 commits2025-11-03: 0 commits2025-11-04: 0 commits2025-11-05: 0 commits2025-11-06: 0 commits2025-11-07: 0 commits2025-11-09: 0 commits2025-11-10: 0 commits2025-11-11: 0 commits2025-11-12: 0 commits2025-11-13: 0 commits2025-11-14: 0 commits2025-11-15: 0 commits2025-11-16: 0 commits2025-11-17: 0 commits2025-11-18: 0 commits2025-11-19: 0 commits2025-11-20: 0 commits2025-11-21: 0 commits2025-11-22: 0 commits2025-11-23: 0 commits2025-11-24: 0 commits2025-11-25: 0 commits2025-11-26: 0 commits2025-11-27: 0 commits2025-11-28: 0 commits2025-11-29: 0 commits2025-11-30: 0 commits2025-12-01: 0 commits2025-12-02: 0 commits2025-12-03: 0 commits2025-12-04: 0 commits2025-12-05: 0 commits2025-12-06: 0 commits2025-12-07: 0 commits2025-12-08: 0 commits2025-12-09: 0 commits2025-12-10: 0 commits2025-12-11: 0 commits2025-12-12: 0 commits2025-12-13: 0 commits2025-12-14: 0 commits2025-12-15: 0 commits2025-12-16: 0 commits2025-12-17: 0 commits2025-12-18: 0 commits2025-12-19: 0 commits2025-12-20: 0 commits2025-12-21: 0 commits2025-12-22: 0 commits2025-12-23: 0 commits2025-12-24: 0 commits2025-12-25: 0 commits2025-12-26: 0 commits2025-12-27: 0 commits2025-12-28: 0 commits2025-12-29: 0 commits2025-12-30: 0 commits2025-12-31: 0 commits2026-01-01: 0 commits2026-01-02: 0 commits2026-01-03: 0 commits2026-01-04: 0 commits2026-01-05: 0 commits2026-01-06: 0 commits2026-01-07: 0 commits2026-01-08: 0 commits2026-01-09: 0 commits2026-01-10: 0 commits2026-01-11: 0 commits2026-01-12: 0 commits2026-01-13: 0 commits2026-01-14: 0 commits2026-01-15: 0 commits2026-01-16: 0 commits2026-01-17: 0 commits2026-01-18: 0 commits2026-01-19: 0 commits2026-01-20: 0 commits2026-01-21: 0 commits2026-01-22: 0 commits2026-01-23: 0 commits2026-01-24: 0 commits2026-01-25: 0 commits2026-01-26: 0 commits2026-01-27: 0 commits2026-01-28: 0 commits2026-01-29: 0 commits2026-01-30: 0 commits2026-01-31: 0 commits2026-02-01: 0 commits2026-02-02: 0 commits2026-02-03: 0 commits2026-02-04: 0 commits2026-02-05: 0 commits2026-02-06: 0 commits2026-02-07: 0 commits2026-02-08: 0 commits2026-02-09: 0 commits2026-02-10: 0 commits2026-02-11: 0 commits2026-02-12: 0 commits2026-02-13: 0 commits2026-02-14: 0 commits2026-02-15: 0 commits2026-02-16: 0 commits2026-02-17: 0 commits2026-02-18: 0 commits2026-02-19: 0 commits2026-02-20: 0 commits2026-02-21: 0 commits2026-02-22: 0 commits2026-02-23: 26 commits2026-02-24: 40 commits2026-02-25: 22 commits2026-02-26: 4 commits2026-02-27: 1 commit2026-02-28: 4 commits2026-03-01: 58 commits2026-03-02: 21 commits2026-03-03: 30 commits2026-03-04: 16 commits2026-03-05: 47 commits2026-03-06: 24 commits2026-03-07: 16 commits2026-03-08: 4 commits2026-03-09: 2 commits2026-03-10: 14 commits2026-03-11: 4 commits2026-03-12: 2 commits2026-03-13: 32 commits2026-03-14: 22 commits2026-03-15: 16 commits2026-03-16: 34 commits2026-03-17: 7 commits2026-03-18: 6 commits2026-03-19: 34 commits2026-03-20: 25 commits2026-03-21: 23 commits2026-03-22: 7 commits2026-03-23: 4 commits2026-03-24: 11 commits2026-03-25: 7 commits2026-03-26: 1 commit2026-03-27: 2 commits2026-03-28: 19 commits2026-03-29: 5 commits2026-03-30: 1 commit2026-03-31: 2 commits2026-04-01: 2 commits2026-04-02: 50 commits2026-04-03: 30 commits2026-04-04: 32 commits2026-04-05: 20 commits2026-04-06: 1 commit2026-04-07: 1 commit2026-04-08: 2 commits2026-04-09: 2 commits2026-04-10: 2 commits2026-04-11: 2 commits2026-04-12: 1 commit2026-04-13: 47 commits2026-04-14: 44 commits2026-04-15: 3 commits2026-04-16: 5 commits2026-04-17: 2 commits2026-04-18: 2 commits2026-04-19: 2 commits2026-04-20: 1 commit2026-04-21: 3 commits2026-04-22: 3 commits2026-04-23: 3 commits2026-04-24: 2 commits2026-04-25: 63 commits2026-04-26: 34 commits2026-04-27: 10 commits2026-04-28: 15 commits2026-04-29: 1 commit2026-04-30: 2 commits2026-05-01: 2 commits2026-05-02: 49 commits2026-05-03: 21 commits2026-05-04: 27 commits2026-05-05: 3 commits2026-05-06: 3 commits2026-05-07: 12 commits2026-05-08: 9 commits2026-05-09: 39 commits2026-05-10: 83 commits2026-05-11: 57 commits2026-05-12: 89 commits2026-05-13: 27 commits2026-05-14: 45 commits2026-05-15: 20 commits2026-05-16: 3 commits2026-05-17: 8 commits2026-05-18: 24 commits2026-05-19: 18 commits2026-05-20: 23 commits2026-05-21: 2 commits2026-05-22: 2 commits2026-05-23: 7 commits2026-05-24: 24 commits2026-05-25: 7 commits2026-05-26: 4 commits2026-05-27: 2 commits2026-05-28: 2 commits2026-05-29: 4 commits2026-05-30: 2 commits2026-05-31: 43 commits2026-06-01: 28 commits2026-06-02: 19 commits2026-06-03: 14 commits2026-06-04: 3 commits2026-06-05: 4 commits2026-06-06: 34 commits2026-06-07: 11 commits2026-06-08: 1 commit2026-06-09: 3 commits2026-06-10: 4 commits2026-06-11: 3 commits2026-06-12: 16 commits2026-06-13: 5 commits2026-06-14: 3 commits2026-06-15: 1 commit2026-06-16: 4 commits2026-06-17: 2 commits2026-06-18: 2 commits2026-06-19: 2 commits2026-06-20: 1 commit2026-06-21: 30 commits2026-06-22: 12 commits2026-06-23: 6 commits2026-06-24: 4 commits2026-06-25: 6 commits2026-06-26: 26 commits2026-06-27: 0 commits2026-06-28: 0 commits2026-06-29: 3 commits2026-06-30: 2 commits2026-07-01: 2 commits2026-07-02: 2 commits2026-07-03: 2 commits2026-07-04: 2 commits2026-07-05: 1 commit2026-07-06: 1 commit2026-07-07: 2 commits2026-07-08: 2 commits2026-07-09: 1 commit2026-07-10: 2 commits2026-07-11: 2 commits2026-07-12: 1 commit2026-07-13: 1 commit2026-07-14: 2 commits2026-07-15: 2 commits2026-07-16: 2 commits2026-07-17: 2 commits2026-07-18: 2 commits2026-07-19: 1 commit2026-07-20: 1 commit2026-07-21: 2 commits2026-07-22: 2 commits2026-07-23: 2 commits2026-07-24: 2 commits2026-07-25: 2 commits2026-07-26: 1 commit2026-07-27: 1 commit2026-07-28: 2 commits2026-07-29: 2 commits2026-07-30: 2 commits2026-07-31: 0 commits2026-08-01: 0 commits
1,941 commits in the last yearLessMore

Signals and awards

derived from tracked data
  • Widely adopted

    19,690 stars

  • Very active

    1,941 commits in 52 weeks

  • Community-driven

    ~112 contributors

  • Continuous integration

    Automated checks passing

What context-mode does

Context Mode acts as middleware for AI coding agents to drastically reduce their token usage and context window consumption. It intercepts tool executions and sandboxes their verbose outputs, summarizing or filtering the data before feeding it back to the agent. This approach achieves up to a 98% reduction in context bloat, preventing agents from forgetting early instructions. Additionally, it provides session memory persistence so context isn't lost between restarts. The system integrates via Model Context Protocol (MCP) and hooks, enabling seamless routing across more than 17 different AI coding environments.

Built for power users of AI coding agents who frequently hit context window limits or use multiple different assistant platforms. It requires familiarity with CLI environments and running AI coding tools like Claude Code or Cursor.

  • Output sandboxing: Intercepts raw tool outputs and condenses them to prevent massive logs from overwhelming the context window.
  • Session memory persistence: Saves the agent's contextual state to disk so you can resume work exactly where you left off.
  • Multi-platform routing: Normalizes interactions across 17+ different coding agents, including Claude Code, Codex, and Cursor.
  • Model Context Protocol integration: Uses standard MCP interfaces to connect tools and agents without writing custom adapters.
  • Token usage reduction: Empirically drops context footprint by up to 98% during heavy file-reading or command-execution loops.

Where teams use it

Long-running autonomous coding sessions

Developers running agents on large refactors use this to prevent the agent from hitting the token limit and halting mid-task.

Standardizing cross-agent tooling

Teams using multiple different AI assistants (e.g., Cursor for one task, Claude Code for another) share the same underlying tool context.

Managing verbose build outputs

When an agent runs a failing build, the tool prevents the massive error log from flushing the agent's memory of the original goal.

Resuming interrupted workflows

Users who need to restart their terminal can reload the preserved context and continue the agent's task seamlessly.

Getting started: npm install -g context-mode

README

main branch

Context Mode

The other half of the context problem.

users npm marketplace GitHub stars GitHub forks Last commit License: ELv2 Discord Hacker News #1

Used across teams at

Microsoft Google Meta Amazon IBM NVIDIA ByteDance Stripe Datadog Salesforce GitHub Red Hat Supabase Canva Notion Hasura Framer Cursor

The 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. On top of that, the agent wastes output tokens on filler, pleasantries, and verbose explanations — burning context from both sides.

How Context Mode Solves It

Context Mode is an MCP server that solves all four sides of this problem:

  1. Context Saving — Sandbox tools keep raw data out of the context window. 315 KB becomes 5.4 KB. 98% reduction.

  2. Session Continuity — Every file edit, git operation, task, error, and user decision is tracked in SQLite. When the conversation compacts, context-mode doesn't dump this data back into context — it indexes events into FTS5 and retrieves only what's relevant via BM25 search. The model picks up exactly where you left off. If you don't --continue, previous session data is deleted immediately — a fresh session means a clean slate.

  3. Think in Code — The LLM should program the analysis, not compute it. Instead of reading 50 files into context to count functions, the agent writes a script that does the counting and console.log()s only the result. One script replaces ten tool calls and saves 100x context. This is a mandatory paradigm across all 17 supported clients, plus the OpenClaw gateway integration: stop treating the LLM as a data processor, treat it as a code generator.

    // Before: 47 × Read() = 700 KB.  After: 1 × ctx_execute() = 3.6 KB.
    ctx_execute("javascript", `
      const files = fs.readdirSync('src').filter(f => f.endsWith('.ts'));
      files.forEach(f => console.log(f + ': ' + fs.readFileSync('src/'+f,'utf8').split('\\n').length + ' lines'));
    `);
  4. No prose-style enforcement — context-mode keeps raw data out of context but never dictates how the model writes its final answer. Brevity, completeness, formatting — your model's call (or yours via your own CLAUDE.md / AGENTS.md). Aggressive brevity prompts have been shown to degrade coding/reasoning benchmarks (Moonshot AI on kimi-k2.5) — the routing block stays focused on where data goes, not on how the model talks.

Watch context-mode demo on YouTube

Watch on YouTube

Install

Platforms are grouped by install complexity. Hook-capable platforms get automatic routing enforcement. Non-hook platforms need a one-time routing file copy.

Claude Code — plugin marketplace, fully automatic

Prerequisites: Claude Code v1.0.33+ (claude --version). If /plugin is not recognized, update first: brew upgrade claude-code or npm update -g @anthropic-ai/claude-code.

Install:

/plugin marketplace add mksglu/context-mode
/plugin install context-mode@context-mode

Restart Claude Code (or run /reload-plugins).

Verify:

/context-mode:ctx-doctor

All checks should show [x]. The doctor validates runtimes, hooks, FTS5, and plugin registration.

Routing: Automatic. The SessionStart hook injects routing instructions at runtime — no file is written to your project. The plugin registers all hooks (PreToolUse, PostToolUse, UserPromptSubmit, PreCompact, SessionStart, Stop) and 11 MCP tools — six sandbox tools (ctx_batch_execute, ctx_execute, ctx_execute_file, ctx_index, ctx_search, ctx_fetch_and_index) plus five meta-tools (ctx_stats, ctx_doctor, ctx_upgrade, ctx_purge, ctx_insight).

Slash 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-index Index a local file or directory into the persistent FTS5 knowledge base.
/context-mode:ctx-search Search previously indexed content.
/context-mode:ctx-upgrade Pull latest, rebuild, migrate cache, fix hooks.
/context-mode:ctx-purge Permanently delete all indexed content from the knowledge base.
/context-mode:ctx-insight Opens the hosted Insight dashboard (context-mode.com/insight) in your browser — org analytics for AI-assisted engineering teams.

Note: Slash commands are a Claude Code plugin feature. On other platforms, type ctx stats, ctx doctor, ctx index, ctx search, ctx upgrade, or ctx insight in the chat — the model calls the MCP tool automatically. See Utility Commands.

Status line (optional): Claude Code's plugin manifest cannot declare a status line, so this is a one-time manual edit to ~/.claude/settings.json:

{
  "statusLine": {
    "type": "command",
    "command": "context-mode statusline"
  }
}

After saving, restart Claude Code. The bar shows $ saved this session · $ saved across sessions · % efficient so you can see savings accumulate in real time. The wiring is path-free — context-mode statusline resolves through the bundled CLI regardless of where the plugin cache lives.

Alternative — MCP-only install (no hooks or slash commands)
claude mcp add context-mode -- npx -y context-mode

This gives you all 11 MCP tools 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.

Gemini CLI — one config file, hooks included

Prerequisites: Node.js >= 22.5 (or Bun), Gemini CLI installed.

Install:

  1. Install context-mode globally:

    npm install -g context-mode
  2. Add the following to ~/.gemini/settings.json. This single file registers the MCP server and all four hooks:

    {
      "mcpServers": {
        "context-mode": {
          "command": "context-mode"
        }
      },
      "hooks": {
        "BeforeTool": [
          {
            "matcher": "run_shell_command|read_file|read_many_files|grep_search|search_file_content|web_fetch|activate_skill|mcp__plugin_context-mode|mcp__context-mode|mcp__(?!.*context-mode)",
            "hooks": [{ "type": "command", "command": "context-mode hook gemini-cli beforetool" }]
          }
        ],
        "AfterTool": [
          {
            "matcher": "",
            "hooks": [{ "type": "command", "command": "context-mode hook gemini-cli aftertool" }]
          }
        ],
        "PreCompress": [
          {
            "matcher": "",
            "hooks": [{ "type": "command", "command": "context-mode hook gemini-cli precompress" }]
          }
        ],
        "SessionStart": [
          {
            "matcher": "",
            "hooks": [{ "type": "command", "command": "context-mode hook gemini-cli sessionstart" }]
          }
        ]
      }
    }
  3. Restart Gemini CLI.

Verify:

/mcp list

You should see context-mode: ... - Connected.

Routing: Automatic via SessionStart hook. Optionally copy routing instructions for full model awareness:

cp node_modules/context-mode/configs/gemini-cli/GEMINI.md ./GEMINI.md

Why the BeforeTool matcher? It targets only tools that produce large output (run_shell_command, read_file, read_many_files, grep_search, search_file_content, web_fetch, activate_skill) plus context-mode's own tools (mcp__plugin_context-mode). This avoids unnecessary hook overhead on lightweight tools while intercepting every tool that could flood your context window.

Full config reference: configs/gemini-cli/settings.json

VS Code Copilot — hooks with SessionStart

Prerequisites: Node.js >= 22.5 (or Bun), VS Code with Copilot Chat v0.32+.

Install:

  1. Install context-mode globally:

    npm install -g context-mode
  2. Create .vscode/mcp.json in your project root:

    {
      "servers": {
        "context-mode": {
          "command": "context-mode"
        }
      }
    }
  3. Create .github/hooks/context-mode.json:

    {
      "hooks": {
        "PreToolUse": [
          { "type": "command", "command": "context-mode hook vscode-copilot pretooluse" }
        ],
        "PostToolUse": [
          { "type": "command", "command": "context-mode hook vscode-copilot posttooluse" }
        ],
        "SessionStart": [
          { "type": "command", "command": "context-mode hook vscode-copilot sessionstart" }
        ]
      }
    }
  4. Restart VS Code.

Verify: Open Copilot Chat and type ctx stats. Context-mode tools should appear and respond.

Routing: Automatic via SessionStart hook. Optionally copy routing instructions for full model awareness:

cp node_modules/context-mode/configs/vscode-copilot/copilot-instructions.md .github/copilot-instructions.md

Full hook config including PreCompact: configs/vscode-copilot/hooks.json

JetBrains Copilot — hooks with SessionStart

Prerequisites: Node.js >= 22.5 (or Bun), JetBrains IDE with GitHub Copilot plugin v1.5.57+.

Install:

  1. Install context-mode globally:

    npm install -g context-mode
  2. Add MCP server via Settings UI: Settings > Tools > AI Assistant > Model Context Protocol (MCP) > Add Server:

    • Name: context-mode
    • Command: context-mode
  3. Create .github/hooks/context-mode.json:

    {
      "hooks": {
        "PreToolUse": [
          { "type": "command", "command": "context-mode hook jetbrains-copilot pretooluse" }
        ],
        "PostToolUse": [
          { "type": "command", "command": "context-mode hook jetbrains-copilot posttooluse" }
        ],
        "SessionStart": [
          { "type": "command", "command": "context-mode hook jetbrains-copilot sessionstart" }
        ]
      }
    }
  4. Restart the JetBrains IDE.

Verify: Open Copilot Chat and type ctx stats. Context-mode tools should appear and respond.

Routing: Automatic via SessionStart hook. Optionally copy routing instructions for full model awareness:

cp node_modules/context-mode/configs/jetbrains-copilot/copilot-instructions.md .github/copilot-instructions.md

Full hook config including PreCompact: configs/jetbrains-copilot/hooks.json

Full setup guide: docs/jetbrains-copilot.md

GitHub Copilot CLI — MCP + hooks

Prerequisites: Node.js >= 22.5 (or Bun), GitHub Copilot CLI (copilot) installed. Set COPILOT_HOME first if you use an isolated Copilot home.

Install — Option A (plugin, one command — recommended):

npm install -g context-mode                                     # the plugin's MCP server runs the global binary
copilot plugin install mksglu/context-mode:configs/copilot-cli  # registers MCP + hooks + routing skill

The bundle's .mcp.json pins CONTEXT_MODE_PLATFORM=copilot-cli, so context-mode self-identifies as Copilot — ctx_upgrade and platform detection resolve copilot-cli even when Claude Code is co-installed (whose ~/.claude/ would otherwise win). No context-mode upgrade / agent call needed. To try it from a local clone before it lands on the default branch, point Copilot at the bundle directory: copilot --plugin-dir /path/to/context-mode/configs/copilot-cli.

Install — Option B (manual, no plugin):

  1. Install context-mode globally:

    npm install -g context-mode
  2. Register the MCP server with Copilot CLI's built-in command (writes ~/.copilot/mcp-config.json for you):

    copilot mcp add context-mode -- context-mode
  3. Configure hooks in ~/.copilot/hooks/context-mode.json (or $COPILOT_HOME/hooks/context-mode.json). The config uses flat { "type": "command", "command": "..." } entries; context-mode also writes a top-level "version": 1, but that field is optional — the Copilot CLI accepts hook configs that omit it (it is pinned only for self-documentation). Copilot CLI fires six events context-mode uses:

    {
      "version": 1,
      "hooks": {
       "preToolUse":          [{ "type": "command", "command": "context-mode hook copilot-cli pretooluse" }],
       "postToolUse":         [{ "type": "command", "command": "context-mode hook copilot-cli posttooluse" }],
       "preCompact":          [{ "type": "command", "command": "context-mode hook copilot-cli precompact" }],
       "sessionStart":        [{ "type": "command", "command": "context-mode hook copilot-cli sessionstart" }],
       "userPromptSubmitted": [{ "type": "command", "command": "context-mode hook copilot-cli userpromptsubmit" }],
       "agentStop":           [{ "type": "command", "command": "context-mode hook copilot-cli stop" }]
      }
    }

    Or let context-mode write this hooks file for you: context-mode upgrade (run from a Copilot CLI context, or with CONTEXT_MODE_PLATFORM=copilot-cli). upgrade writes the hooks file only — register the MCP server with copilot mcp add in step 2.

  4. Restart Copilot CLI.

Plugins: Option A above uses Copilot CLI's plugin system, which registers MCP servers (.mcp.json), hooks (hooks.json), and skills (skills/) together — not just skills/agents. The shipped bundle is configs/copilot-cli/; copilot plugin install owner/repo:path installs it in one command (no clone). Option B is the equivalent without a plugin.

Version note: the hook commands run the global context-mode (context-mode hook copilot-cli …), so they need a context-mode version with Copilot CLI support. On an older global the hooks are inert (no routing/capture) until you upgrade — but they do not block your tools (context-mode fails open). Upgrade with npm install -g context-mode@latest.

Verify: In a Copilot CLI session, type ctx stats. Context-mode tools should appear and respond. Run context-mode doctor to confirm hook + MCP registration.

Routing: Automatic via hooks (PreToolUse interception + SessionStart routing block). Auto-detected via MCP clientInfo.name (GitHub Copilot CLI) or, in a bare shell, a context-mode-written marker (~/.copilot/mcp-config.json or ~/.copilot/hooks/context-mode.json) — not a bare ~/.copilot/ dir, so a co-installed-but-unconfigured Copilot CLI is not mis-detected as context-mode-on-copilot.

See docs/platform-support.md for the full reference. Tracking: #775.

Cursor — hooks with stop support

Prerequisites: Node.js >= 22.5 (or Bun), Cursor with agent mode.

🚧 Work in progress — the Marketplace plugin is awaiting Cursor team review. Until it's listed, install via the local-folder path described in Option A. Tracking in #485 / #489.

Option A — Marketplace plugin (recommended once published)

After Cursor lists context-mode in the Marketplace, install with one click. The plugin auto-registers MCP, hooks (preToolUse, postToolUse, sessionStart, stop, afterAgentResponse), rules, and skills. No manual config required.

Until then, use the local-folder path:

Windows (PowerShell) — Cursor does not follow Windows symlinks/junctions, so use robocopy:

git clone https://github.com/mksglu/context-mode.git
cd context-mode
robocopy . "$env:USERPROFILE\.cursor\plugins\local\context-mode" /MIR `
  /XD node_modules .git build web tests scripts .vscode `
  /XF *.log .gitignore *.bundle.mjs.map

macOS / Linux:

git clone https://github.com/mksglu/context-mode.git
ln -s "$PWD/context-mode" ~/.cursor/plugins/local/context-mode

Restart Cursor. The plugin appears in Settings → Plugins as "Context Mode (Local)". To pull updates, re-run the same robocopy / ln -s line.

Note: if .cursor/hooks.json already contains context-mode entries from a prior Option B install, context-mode doctor will warn about duplicate hook firings. Remove one configuration to keep events single-fire.

Option B — Manual install (existing path)

  1. Install context-mode globally:

    npm install -g context-mode
  2. Create .cursor/mcp.json in your project root (or ~/.cursor/mcp.json for global):

    {
      "mcpServers": {
        "context-mode": {
          "command": "context-mode"
        }
      }
    }
  3. Create .cursor/hooks.json (or ~/.cursor/hooks.json for global):

    {
      "version": 1,
      "hooks": {
        "preToolUse": [
          {
            "command": "context-mode hook cursor pretooluse",
            "matcher": "Shell|Read|Grep|WebFetch|Task|MCP:ctx_execute|MCP:ctx_execute_file|MCP:ctx_batch_execute"
          }
        ],
        "postToolUse": [
          {
            "command": "context-mode hook cursor posttooluse"
          }
        ],
        "stop": [
          {
            "command": "context-mode hook cursor stop"
          }
        ]
      }
    }

    The preToolUse matcher is optional — without it, the hook fires on all tools. The stop hook fires when the agent turn ends and can send a followup message to continue the loop. afterAgentResponse is also available (fire-and-forget, receives full response text).

  4. Copy the routing rules file. Cursor lacks a SessionStart hook, so the model needs a rules file for routing awareness:

    mkdir -p .cursor/rules
    cp node_modules/context-mode/configs/cursor/context-mode.mdc .cursor/rules/context-mode.mdc
  5. Restart Cursor or open a new agent session.

Verify: Open Cursor Settings > MCP and confirm "context-mode" shows as connected. In agent chat, type ctx stats.

Routing: Hooks enforce routing programmatically via preToolUse/postToolUse/stop. The .cursor/rules/context-mode.mdc file provides routing instructions at session start since Cursor's sessionStart hook is currently rejected by their validator (forum report). Project .cursor/hooks.json overrides ~/.cursor/hooks.json.

Known limitation: Cursor accepts additional_context in hook responses but does not surface it to the model (forum #155689). Routing relies on the .mdc rules file instead of hook context injection.

Full configs: configs/cursor/hooks.json | configs/cursor/mcp.json | configs/cursor/context-mode.mdc

OpenCode — TypeScript plugin with hooks

Prerequisites: Node.js >= 22.5 (or Bun), OpenCode installed.

Install:

  1. Add to opencode.json in your project root (or ~/.config/opencode/opencode.json for global):

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["context-mode"]
    }

    The plugin entry registers all 11 ctx_* tools natively and enables hooks — OpenCode calls context-mode's TypeScript plugin in-process, so there is no redundant stdio MCP child per session.

  2. (Optional) Copy the routing rules file. The model needs an AGENTS.md file for routing awareness:

    cp node_modules/context-mode/configs/opencode/AGENTS.md AGENTS.md

    This tells the model which tools to use and which commands are blocked. Without it, hooks still enforce routing — but the model won't know why a command was denied.

  3. Restart OpenCode.

Verify: In the OpenCode session, type ctx stats. Context-mode tools should appear and respond.

Upgrade note: If an existing config has BOTH plugin: ["context-mode"] AND mcp.context-mode, OpenCode will register zero ctx_* tools — the plugin path correctly suppresses MCP duplicates, but the legacy MCP entry confuses the loader. Run context-mode upgrade to remove the legacy mcp.context-mode entry; your other MCP servers are preserved. v1.0.140+ emits a stderr diagnostic with the same guidance when this happens.

Routing: Hooks enforce routing programmatically via tool.execute.before and tool.execute.after. The optional AGENTS.md file provides routing instructions for model awareness. The experimental.session.compacting hook builds resume snapshots when the conversation compacts. The experimental.chat.system.transform hook injects the routing block and prior-session snapshots at session start, enabling session continuity across restarts. The chat.message hook captures user prompts and decisions (UserPromptSubmit equivalent).

Note: OpenCode lacks a real SessionStart hook (#14808, #5409). The plugin uses experimental.chat.system.transform as a surrogate — it injects both the routing block and resume snapshots into the system prompt. User-prompt capture uses chat.message instead of the missing UserPromptSubmit hook. AGENTS.md/CLAUDE.md/CONTEXT.md rules are captured automatically on first hook fire per project.

Full configs: configs/opencode/opencode.json | configs/opencode/AGENTS.md

KiloCode — TypeScript plugin with hooks

Prerequisites: Node.js >= 22.5 (or Bun), KiloCode installed.

Install:

  1. Add to kilo.json in your project root (or ~/.config/kilo/kilo.json for global):

    {
      "$schema": "https://app.kilo.ai/config.json",
      "plugin": ["context-mode"]
    }

    The plugin entry registers all 11 ctx_* tools natively and enables hooks — KiloCode calls context-mode's TypeScript plugin in-process, so there is no redundant stdio MCP child per session.

  2. (Optional) Copy the routing rules file. KiloCode shares the OpenCode plugin architecture, so the model needs an AGENTS.md file for routing awareness:

    cp node_modules/context-mode/configs/opencode/AGENTS.md AGENTS.md
  3. Restart KiloCode.

Verify: In the KiloCode session, type ctx stats. Context-mode tools should appear and respond.

Upgrade note: If an existing config has BOTH plugin: ["context-mode"] AND mcp.context-mode, KiloCode will register zero ctx_* tools — the plugin path correctly suppresses MCP duplicates, but the legacy MCP entry confuses the loader. Run context-mode upgrade to remove the legacy mcp.context-mode entry; your other MCP servers are preserved. v1.0.140+ emits a stderr diagnostic with the same guidance when this happens.

Routing: Hooks enforce routing programmatically via tool.execute.before and tool.execute.after. The optional AGENTS.md file provides routing instructions for model awareness. The experimental.session.compacting hook builds resume snapshots when the conversation compacts. The experimental.chat.system.transform hook injects the routing block and prior-session snapshots at session start, enabling session continuity across restarts. The chat.message hook captures user prompts and decisions (UserPromptSubmit equivalent).

Note: KiloCode shares the same plugin architecture as OpenCode, using the OpenCodeAdapter with platform-specific configuration paths (kilo.json instead of opencode.json, ~/.config/kilo/ instead of ~/.config/opencode/). Like OpenCode, it lacks a real SessionStart hook — the plugin uses experimental.chat.system.transform as a surrogate. User-prompt capture uses chat.message instead of the missing UserPromptSubmit hook. AGENTS.md/CLAUDE.md/CONTEXT.md rules are captured automatically on first hook fire per project.

OpenClaw / Pi Agent — native gateway plugin

Prerequisites: OpenClaw gateway running (>2026.1.29), Node.js 22+.

context-mode runs as a native OpenClaw gateway plugin, targeting Pi Agent sessions (Read/Write/Edit/Bash tools). Unlike other platforms, there's no separate MCP server — the plugin registers directly into the gateway runtime via OpenClaw's plugin API.

Install:

  1. Clone and install:

    git clone https://github.com/mksglu/context-mode.git
    cd context-mode
    npm run install:openclaw

    The installer uses $OPENCLAW_STATE_DIR from your environment (default: /openclaw). To specify a custom path:

    npm run install:openclaw -- /path/to/openclaw-state

    Common locations: Docker/openclaw (the default). Local~/.openclaw or wherever you set OPENCLAW_STATE_DIR.

    The installer handles everything: npm install, npm run build, better-sqlite3 native rebuild, extension registration in runtime.json, and gateway restart via SIGUSR1.

  2. Open a Pi Agent session.

Verify: The plugin registers 8 hooks via api.on() (lifecycle) and api.registerHook() (commands). Type ctx stats to confirm tools are loaded.

Routing: Automatic. All tool interception, session tracking, and compaction recovery hooks activate automatically — no manual hook configuration or routing file needed.

Minimum version: OpenClaw >2026.1.29 — this includes the api.on() lifecycle fix from PR #9761. On older versions, lifecycle hooks silently fail. The adapter falls back to DB snapshot reconstruction (less precise but preserves critical state).

Full documentation: docs/adapters/openclaw.md

Codex CLI — MCP + hooks

Prerequisites: Node.js >= 22.5 (or Bun), Codex CLI installed.

Install:

  1. Add the context-mode marketplace and install the plugin from Codex's plugin UI:

    codex plugin marketplace add mksglu/context-mode
  2. Enable plugin-provided hooks while the Codex feature is still gated:

    [features]
    plugin_hooks = true
    hooks = true

    Feature flag note: Current Codex builds expose hooks under [features].hooks (or codex --enable hooks). Prefer [features].hooks; [features].codex_hooks remains accepted as a legacy alias in current Codex builds. Bundled plugin hooks additionally require plugin_hooks until Codex enables plugin hooks by default.

    Custom storage location: if Codex cannot write the adapter default storage directory, set CONTEXT_MODE_DIR to an absolute writable root in the environment that launches Codex. Sessions and stats use <root>/sessions; indexed content uses <root>/content.

    CONTEXT_MODE_DIR="$HOME/.codex-context-mode" codex
  3. Restart Codex CLI and verify MCP with ctx stats.

    ctx stats proves the plugin MCP server is installed and reachable; it does not prove hooks are trusted or running.

  4. Review and trust the context-mode plugin hooks if Codex prompts for hook approval. Plugin hooks are only active after both feature flags are enabled and Codex has accepted the hook commands.

The Codex plugin manifest provides MCP via .codex-plugin/mcp.json, skills via skills/, and bundled hooks via .codex-plugin/hooks.json. No manual [mcp_servers.context-mode] block or $CODEX_HOME/hooks.json is needed when plugin_hooks is enabled and the plugin hooks are trusted.

Node/PATH note: context-mode still needs node visible to the Codex process. The plugin removes manual Codex config, but it does not vendor Node or inherit login-shell PATH fixes automatically.

Manual fallback for Codex builds without plugin_hooks:

  1. Install context-mode globally:

    npm install -g context-mode
  2. Add to ~/.codex/config.toml:

    [features]
    hooks = true
    
    [mcp_servers.context-mode]
    command = "context-mode"
    
    [mcp_servers.context-mode.env]
    CONTEXT_MODE_PLATFORM = "codex"
  3. Create $CODEX_HOME/hooks.json (or ~/.codex/hooks.json when CODEX_HOME is unset):

    {
      "hooks": {
       "PreToolUse": [{ "matcher": "local_shell|shell|shell_command|exec_command|Bash|Shell|apply_patch|Edit|Write|grep_files|ctx_execute|ctx_execute_file|ctx_batch_execute|ctx_fetch_and_index|ctx_search|ctx_index|mcp__", "hooks": [{ "type": "command", "command": "context-mode hook codex pretooluse" }] }],
        "PostToolUse": [{ "hooks": [{ "type": "command", "command": "context-mode hook codex posttooluse" }] }],
        "SessionStart": [{ "hooks": [{ "type": "command", "command": "context-mode hook codex sessionstart" }] }],
        "PreCompact": [{ "hooks": [{ "type": "command", "command": "context-mode hook codex precompact" }] }],
        "UserPromptSubmit": [{ "hooks": [{ "type": "command", "command": "context-mode hook codex userpromptsubmit" }] }],
        "Stop": [{ "hooks": [{ "type": "command", "command": "context-mode hook codex stop" }] }]
      }
    }

    PreToolUse enforces deny/block routing today and is prepared for input rewrites once Codex supports them. PostToolUse captures session events. PreCompact builds the resume snapshot before compaction. SessionStart restores state after compaction. UserPromptSubmit captures user decisions and corrections. Stop records turn-end state.

    Note: Codex PreToolUse routing currently supports deny rules only (blocks dangerous commands). It still needs upstream updatedInput support before context-mode can rewrite tool input; track openai/codex#18491. Context injection (additionalContext) is not supported in Codex PreToolUse — it works via PostToolUse and SessionStart instead. This is handled automatically.

    PreCompact support is runtime-gated: it is present in Codex CLI 0.130.0, while the public Codex hooks docs may lag the shipped hook-event list. Older Codex builds that do not emit PreCompact will not create pre-compaction snapshots.

  4. Copy routing instructions (recommended even with hooks for full routing awareness):

    CM_ROOT="$(npm root -g)/context-mode"
    cp "$CM_ROOT/configs/codex/AGENTS.md" ./AGENTS.md

    For global use: CM_ROOT="$(npm root -g)/context-mode"; cp "$CM_ROOT/configs/codex/AGENTS.md" ~/.codex/AGENTS.md. Global applies to all projects. If both exist, Codex CLI merges them.

  5. Restart Codex CLI.

Verify: Start a session and type ctx stats to verify MCP. To verify hook routing, confirm Codex lists/trusts the context-mode plugin hooks, then run a command that matches the routing rules.

Routing: MCP tools work after plugin install. Plugin hook routing is active only when hooks and plugin_hooks are enabled and Codex trusts the plugin hook commands. Manual hook routing is active when $CODEX_HOME/hooks.json or ~/.codex/hooks.json is configured. The AGENTS.md file provides routing instructions for model awareness.

Kimi Code — MCP + hooks (TOML config, same JSON wire protocol as Codex)

Prerequisites: Node.js >= 22.5 (or Bun), Kimi Code CLI installed.

  1. Install context-mode:

    npm install -g context-mode
  2. Add context-mode as an MCP server. Add to ~/.kimi-code/mcp.json:

    {
      "mcpServers": {
        "context-mode": {
          "command": "context-mode",
          "args": []
        }
      }
    }
  3. Add hooks to ~/.kimi-code/config.toml:

    [[hooks]]
    event = "PreToolUse"
    matcher = "Bash|Shell|Read|Edit|Write|WebFetch|Agent|ctx_execute|ctx_execute_file|ctx_batch_execute|ctx_fetch_and_index|ctx_search|ctx_index|mcp__"
    command = "context-mode hook kimi pretooluse"
    timeout = 30
    
    [[hooks]]
    event = "PostToolUse"
    command = "context-mode hook kimi posttooluse"
    timeout = 30
    
    [[hooks]]
    event = "SessionStart"
    command = "context-mode hook kimi sessionstart"
    timeout = 30
    
    [[hooks]]
    event = "PreCompact"
    command = "context-mode hook kimi precompact"
    timeout = 30
    
    [[hooks]]
    event = "UserPromptSubmit"
    command = "context-mode hook kimi userpromptsubmit"
    timeout = 30
    
    [[hooks]]
    event = "Stop"
    command = "context-mode hook kimi stop"
    timeout = 30
  4. Restart Kimi Code CLI and verify MCP with ctx stats.

    Note: Kimi Code uses the same JSON stdin/stdout wire protocol as Codex, but accepts additionalContext, updatedInput, and permissionDecision: "ask" in PreToolUse responses (Codex rejects these). The kimi hook normalizes ContentPart[] prompt arrays to strings for downstream extractors.

  5. (Optional) Copy the routing instructions file for your project:

    cp "$(npm root -g)/context-mode/configs/codex/AGENTS.md" ./AGENTS.md

    Or for global use:

    CM_ROOT="$(npm root -g)/context-mode"; cp "$CM_ROOT/configs/codex/AGENTS.md" ~/.kimi-code/AGENTS.md

Full documentation: docs/adapters/kimi-code.md

Qwen Code — MCP + hooks (identical wire protocol to Claude Code)

Prerequisites: Node.js >= 22.5 (or Bun), Qwen Code installed (npm install -g @qwen-code/qwen-code).

  1. Install context-mode:

    npm install -g context-mode
  2. Add context-mode as an MCP server. Add to ~/.qwen/settings.json:

    {
      "mcpServers": {
        "context-mode": {
          "command": "context-mode",
          "args": []
        }
      }
    }
  3. Add hooks for routing enforcement and session tracking. Add to ~/.qwen/settings.json:

    {
      "hooks": {
        "PreToolUse": [{ "matcher": "run_shell_command|read_file|read_many_files|grep_search|web_fetch|agent|mcp__plugin_context-mode_context-mode__ctx_execute|mcp__plugin_context-mode_context-mode__ctx_execute_file|mcp__plugin_context-mode_context-mode__ctx_batch_execute|mcp__(?!.*context-mode)", "hooks": [{ "type": "command", "command": "context-mode hook qwen-code pretooluse" }] }],
        "PostToolUse": [{ "matcher": "", "hooks": [{ "type": "command", "command": "context-mode hook qwen-code posttooluse"
    

    (README truncated)

View on GitHub

Recent activity

commits and pull requests

Releases and announcements

195 total
  1. v1.0.169v1.0.169Jun 29, 2026

    ## Context-savings reporting + FinOps accuracy This release aligns context-savings reporting between the local `ctx stats` view and the Insight platform, and corrects per-turn cost attribution. ### Improvements - The local "Where you are now" savings bar now reflects the whole live conversation window — the main session plus the sub-agent and sandbox sessions it spawns — rather than a single session id. - The kept-out ratio is reported to one decimal, so a genuine 99.9% window is no longer rounded up to a misleading 100%. ### Fixes - Retrieval access cost (`bytes_retrieved`) for `ctx_search` / `ctx_fetch_and_index` is now bridged from the MCP server to the forward pipe, so the platform can derive the with/without ratio. Previously the retrieval signal never reached the dashboard. - "With context-mode" counts retrieval-tool returns only, not sandbox compute output, so the ratio is honest. - A Task sub-agent's cumulative usage is no longer priced as a single turn, preventing inflated per-event cost from poisoning FinOps aggregates. All changes are additive and backward compatible.

  2. v1.0.168v1.0.168Jun 26, 2026

    ## FinOps accuracy and context-savings reporting Follow-up to v1.0.167's per-turn cost capture. This release corrects how savings and cost are measured and reported. ### Fixes - **Context-savings bar accuracy.** `ctx stats` previously rendered "With context-mode: 1 B / 100% kept out" on tool-heavy sessions. The "With context-mode" figure now reflects the real bytes the model paid to access kept-out content (ctx_search + ctx_fetch_and_index returns), not sandbox compute output, so the kept-out ratio is honest. - **With/without ratio for the platform.** The plugin now forwards `bytes_retrieved` (the retrieval access cost) alongside `bytes_avoided`, so org-level reporting can derive the full kept-out percentage rather than the savings half alone. - **Cumulative cost no longer mispriced.** A Task sub-agent's `usage` is the total summed across its entire run; pricing it as a single turn produced inflated four-figure per-event costs that poisoned FinOps aggregates. Task usage is now tagged `usage_scope: "task_cumulative"` and is not priced per-turn; per-turn cost comes only from per-turn signals. All changes are additive and backward compatible.

  3. v1.0.167v1.0.167Jun 26, 2026

    ## Per-turn token, cost, and savings capture (FinOps) Events now carry real per-turn token usage, model id, and `cost_usd`, replacing the flat per-event cost proxy. Engineering leaders can see actual AI spend per model, how much context-mode saved, and net/ROI. ### Highlights - Real per-model pricing catalog (63 curated models across Anthropic, OpenAI, Google, and other vendors) behind a small no-regex lookup module. Non-Claude models are now priced from their own rates instead of defaulting to Claude pricing. - Structured cost event (`model_id` plus four token counts and `cost_usd`), replacing the prior string encoding, so the platform persists typed columns. - Per-turn capture across the nine adapters that expose usage: claude-code (session transcript, cursor-gated to avoid double counting), pi, omp, opencode, openclaw, gemini-cli, codex, qwen-code, and kimi. Adapters whose host does not expose usage remain on a clearly labeled estimate. - `bytes_avoided` is now forwarded so the platform can attribute context-saving value. All changes are additive and backward compatible. ### Contributors This release also includes community contributions — thank you: - @ken-jo — Zed MCP conf

  4. v1.0.166v1.0.166Jun 23, 2026

    # context-mode v1.0.166 A Pi-focused reliability and DX release: the in-editor diagnostic that blocked typing on Pi is gone, and the foreground session's tools no longer drop after an idle pause. ## Bug fixes - **Pi: a background diagnostic no longer appears in the editor and blocks typing** ([#868](https://github.com/mksglu/context-mode/issues/868), reported by @carolitascl, confirmed by @frsswq). context-mode loads in-process under Pi, and its MCP bridge was writing diagnostics to `process.stderr` — which is Pi's raw-mode TUI terminal. The idle-helper notice (`[mcp-bridge] … idle MCP bridge child self-shutdown …`) rendered straight into the prompt box, corrupting the input. All Pi-adapter diagnostics now route to `pi.logger` (Pi's rotating log under `~/.omp/logs/`), the documented channel for in-process extensions — never the terminal. Crash diagnostics are still captured (in the log), not swallowed. - **Pi: the foreground session no longer loses its `ctx_*` tools after a pause.** The idle reaper that bounds abandoned sub-agent helpers was also reaping the *active* interactive session's helper after three minutes of inactivity, so a human pause dropped the tools (they reconne

  5. v1.0.165v1.0.165Jun 22, 2026

    # context-mode v1.0.165 A reliability follow-up to [v1.0.164](https://github.com/mksglu/context-mode/releases/tag/v1.0.164): two community-reported, platform-specific first-run defects — an orphaned-process CPU spin on Linux and an every-session install failure on Windows. ## Bug fixes - **Linux: orphaned MCP servers no longer busy-spin at ~100% CPU after the client exits** ([#862](https://github.com/mksglu/context-mode/issues/862), reported by @elhoim). On Linux, `start.mjs` re-execs itself under Bun to take the crash-safe SQLite path (#564); the node proxy forwards stdin to the Bun child. Its stdin-EOF handler was a no-op and the proxy parked forever, so when the MCP client exited the proxy never closed the child's stdin nor exited — the child's parent stayed alive (defeating its ppid watchdog) and its stdin never reached EOF, leaving an orphaned pair pinned to a CPU core indefinitely. The proxy now propagates client death: it forwards EOF to the child for a graceful self-reap, then escalates `SIGTERM` → `SIGKILL` so a wedged child can never outlive its client. The Bun re-exec is unchanged. - **Windows: the boot-time fetch-dependency install no longer fails with EPERM (and no

Code frequency

additions and deletions
+53.4K-53.4KWeek of 2026-02-22: +24,012 linesWeek of 2026-02-22: -3,870 linesWeek of 2026-03-01: +53,421 linesWeek of 2026-03-01: -27,023 linesWeek of 2026-03-08: +9,088 linesWeek of 2026-03-08: -2,159 linesWeek of 2026-03-15: +18,927 linesWeek of 2026-03-15: -16,169 linesWeek of 2026-03-22: +2,442 linesWeek of 2026-03-22: -1,506 linesWeek of 2026-03-29: +16,778 linesWeek of 2026-03-29: -9,281 linesWeek of 2026-04-05: +890 linesWeek of 2026-04-05: -145 linesWeek of 2026-04-12: +10,984 linesWeek of 2026-04-12: -5,026 linesWeek of 2026-04-19: +9,908 linesWeek of 2026-04-19: -4,077 linesWeek of 2026-04-26: +21,349 linesWeek of 2026-04-26: -7,422 linesWeek of 2026-05-03: +38,895 linesWeek of 2026-05-03: -15,610 linesWeek of 2026-05-10: +40,124 linesWeek of 2026-05-10: -14,337 linesWeek of 2026-05-17: +12,097 linesWeek of 2026-05-17: -6,914 linesWeek of 2026-05-24: +8,062 linesWeek of 2026-05-24: -2,328 linesWeek of 2026-05-31: +26,685 linesWeek of 2026-05-31: -6,944 linesWeek of 2026-06-07: +8,545 linesWeek of 2026-06-07: -6,492 linesWeek of 2026-06-14: +1,044 linesWeek of 2026-06-14: -499 linesWeek of 2026-06-21: +18,082 linesWeek of 2026-06-21: -11,906 linesWeek of 2026-06-28: +324 linesWeek of 2026-06-28: -322 linesWeek of 2026-07-05: +24 linesWeek of 2026-07-05: -24 linesWeek of 2026-07-12: +25 linesWeek of 2026-07-12: -25 linesWeek of 2026-07-19: +25 linesWeek of 2026-07-19: -25 linesWeek of 2026-07-26: +17 linesWeek of 2026-07-26: -17 linesFeb 22, 2026Jul 26, 2026
+321.7K lines added, -142.1K removed over the last year.

Commits per week

last 52 weeks
3240Week of 2025-08-02: 0 commitsWeek of 2025-08-09: 0 commitsWeek of 2025-08-16: 0 commitsWeek of 2025-08-23: 0 commitsWeek of 2025-08-30: 0 commitsWeek of 2025-09-06: 0 commitsWeek of 2025-09-13: 0 commitsWeek of 2025-09-20: 0 commitsWeek of 2025-09-27: 0 commitsWeek of 2025-10-04: 0 commitsWeek of 2025-10-11: 0 commitsWeek of 2025-10-18: 0 commitsWeek of 2025-10-25: 0 commitsWeek of 2025-11-01: 0 commitsWeek of 2025-11-09: 0 commitsWeek of 2025-11-16: 0 commitsWeek of 2025-11-23: 0 commitsWeek of 2025-11-30: 0 commitsWeek of 2025-12-07: 0 commitsWeek of 2025-12-14: 0 commitsWeek of 2025-12-21: 0 commitsWeek of 2025-12-28: 0 commitsWeek of 2026-01-04: 0 commitsWeek of 2026-01-11: 0 commitsWeek of 2026-01-18: 0 commitsWeek of 2026-01-25: 0 commitsWeek of 2026-02-01: 0 commitsWeek of 2026-02-08: 0 commitsWeek of 2026-02-15: 0 commitsWeek of 2026-02-22: 97 commitsWeek of 2026-03-01: 212 commitsWeek of 2026-03-08: 80 commitsWeek of 2026-03-15: 145 commitsWeek of 2026-03-22: 51 commitsWeek of 2026-03-29: 122 commitsWeek of 2026-04-05: 30 commitsWeek of 2026-04-12: 104 commitsWeek of 2026-04-19: 77 commitsWeek of 2026-04-26: 113 commitsWeek of 2026-05-03: 114 commitsWeek of 2026-05-10: 324 commitsWeek of 2026-05-17: 84 commitsWeek of 2026-05-24: 45 commitsWeek of 2026-05-31: 145 commitsWeek of 2026-06-07: 43 commitsWeek of 2026-06-14: 15 commitsWeek of 2026-06-21: 84 commitsWeek of 2026-06-28: 13 commitsWeek of 2026-07-05: 11 commitsWeek of 2026-07-12: 12 commitsWeek of 2026-07-19: 12 commitsWeek of 2026-07-26: 8 commitsAug 2, 2025Jul 26, 2026
1.9K commits in the last 52 weeks.

When work happens

weekday and hour
SunMonTueWedThuFriSat036912151821Sun 0:00 — 25 commitsSun 1:00 — 3 commitsSun 2:00 — 3 commitsSun 3:00 — 0 commitsSun 4:00 — 1 commitsSun 5:00 — 2 commitsSun 6:00 — 19 commitsSun 7:00 — 8 commitsSun 8:00 — 1 commitsSun 9:00 — 5 commitsSun 10:00 — 7 commitsSun 11:00 — 22 commitsSun 12:00 — 40 commitsSun 13:00 — 29 commitsSun 14:00 — 25 commitsSun 15:00 — 35 commitsSun 16:00 — 30 commitsSun 17:00 — 23 commitsSun 18:00 — 32 commitsSun 19:00 — 29 commitsSun 20:00 — 18 commitsSun 21:00 — 5 commitsSun 22:00 — 6 commitsSun 23:00 — 6 commitsMon 0:00 — 0 commitsMon 1:00 — 7 commitsMon 2:00 — 6 commitsMon 3:00 — 0 commitsMon 4:00 — 0 commitsMon 5:00 — 0 commitsMon 6:00 — 12 commitsMon 7:00 — 13 commitsMon 8:00 — 2 commitsMon 9:00 — 57 commitsMon 10:00 — 17 commitsMon 11:00 — 8 commitsMon 12:00 — 13 commitsMon 13:00 — 5 commitsMon 14:00 — 5 commitsMon 15:00 — 13 commitsMon 16:00 — 18 commitsMon 17:00 — 19 commitsMon 18:00 — 19 commitsMon 19:00 — 19 commitsMon 20:00 — 22 commitsMon 21:00 — 13 commitsMon 22:00 — 16 commitsMon 23:00 — 27 commitsTue 0:00 — 4 commitsTue 1:00 — 6 commitsTue 2:00 — 11 commitsTue 3:00 — 5 commitsTue 4:00 — 10 commitsTue 5:00 — 7 commitsTue 6:00 — 15 commitsTue 7:00 — 5 commitsTue 8:00 — 1 commitsTue 9:00 — 6 commitsTue 10:00 — 4 commitsTue 11:00 — 6 commitsTue 12:00 — 52 commitsTue 13:00 — 36 commitsTue 14:00 — 5 commitsTue 15:00 — 14 commitsTue 16:00 — 24 commitsTue 17:00 — 22 commitsTue 18:00 — 19 commitsTue 19:00 — 21 commitsTue 20:00 — 17 commitsTue 21:00 — 4 commitsTue 22:00 — 7 commitsTue 23:00 — 22 commitsWed 0:00 — 9 commitsWed 1:00 — 7 commitsWed 2:00 — 5 commitsWed 3:00 — 1 commitsWed 4:00 — 0 commitsWed 5:00 — 0 commitsWed 6:00 — 6 commitsWed 7:00 — 8 commitsWed 8:00 — 2 commitsWed 9:00 — 9 commitsWed 10:00 — 13 commitsWed 11:00 — 6 commitsWed 12:00 — 18 commitsWed 13:00 — 17 commitsWed 14:00 — 5 commitsWed 15:00 — 1 commitsWed 16:00 — 11 commitsWed 17:00 — 10 commitsWed 18:00 — 13 commitsWed 19:00 — 7 commitsWed 20:00 — 0 commitsWed 21:00 — 2 commitsWed 22:00 — 2 commitsWed 23:00 — 3 commitsThu 0:00 — 13 commitsThu 1:00 — 24 commitsThu 2:00 — 11 commitsThu 3:00 — 9 commitsThu 4:00 — 8 commitsThu 5:00 — 0 commitsThu 6:00 — 12 commitsThu 7:00 — 5 commitsThu 8:00 — 1 commitsThu 9:00 — 1 commitsThu 10:00 — 1 commitsThu 11:00 — 3 commitsThu 12:00 — 18 commitsThu 13:00 — 7 commitsThu 14:00 — 2 commitsThu 15:00 — 5 commitsThu 16:00 — 3 commitsThu 17:00 — 8 commitsThu 18:00 — 16 commitsThu 19:00 — 17 commitsThu 20:00 — 32 commitsThu 21:00 — 17 commitsThu 22:00 — 9 commitsThu 23:00 — 12 commitsFri 0:00 — 10 commitsFri 1:00 — 8 commitsFri 2:00 — 3 commitsFri 3:00 — 1 commitsFri 4:00 — 0 commitsFri 5:00 — 1 commitsFri 6:00 — 10 commitsFri 7:00 — 6 commitsFri 8:00 — 1 commitsFri 9:00 — 4 commitsFri 10:00 — 8 commitsFri 11:00 — 1 commitsFri 12:00 — 26 commitsFri 13:00 — 18 commitsFri 14:00 — 7 commitsFri 15:00 — 11 commitsFri 16:00 — 20 commitsFri 17:00 — 13 commitsFri 18:00 — 13 commitsFri 19:00 — 18 commitsFri 20:00 — 9 commitsFri 21:00 — 7 commitsFri 22:00 — 9 commitsFri 23:00 — 10 commitsSat 0:00 — 13 commitsSat 1:00 — 5 commitsSat 2:00 — 10 commitsSat 3:00 — 6 commitsSat 4:00 — 4 commitsSat 5:00 — 4 commitsSat 6:00 — 12 commitsSat 7:00 — 3 commitsSat 8:00 — 1 commitsSat 9:00 — 2 commitsSat 10:00 — 2 commitsSat 11:00 — 4 commitsSat 12:00 — 32 commitsSat 13:00 — 4 commitsSat 14:00 — 1 commitsSat 15:00 — 12 commitsSat 16:00 — 33 commitsSat 17:00 — 14 commitsSat 18:00 — 19 commitsSat 19:00 — 32 commitsSat 20:00 — 21 commitsSat 21:00 — 34 commitsSat 22:00 — 32 commitsSat 23:00 — 36 commits
Commit volume by weekday and hour (UTC). Larger dots mean more commits.

Who is committing

last 52 weeks
Maintainer commits1,372 (65%)
Community commits740 (35%)

2,112 commits in total over the last year.

  • freeCodeCamp/freeCodeCamp

    freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.

    453.6K stars · TypeScript

  • openclaw/openclaw

    Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

    385.5K stars · TypeScript

  • openclaw/openclaw

    Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

    384.4K stars · TypeScript

  • openclaw/openclaw

    Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

    384.4K stars · TypeScript

  • openclaw/openclaw

    Your own personal AI assistant. Any OS. Any Platform. The lobster way. 🦞

    384.4K stars · TypeScript

  • obra/superpowers

    An agentic skills framework & software development methodology that works.

    268.6K stars · Shell