# context-mode

An MCP server that keeps raw tool output out of the context window and rebuilds session state after a compact. Useful when the agent burns through context fast.

- plugin · `type=plugin` · Claude Code · ★ 32324
- Author: mksglu
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/mksglu/context-mode
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/plugins/context-mode

## What it does

Every MCP tool call drops raw output straight into the context window. A Playwright snapshot, a batch of issues, an access log — and half an hour later the window is noticeably emptier. context-mode intercepts that: sandbox tools do the work off to the side, and only the result comes back. The README walks through a case where 315 KB shrinks to 5.4 KB.

Under the hood it's an MCP server with a SQLite database. File edits, git operations, tasks, errors and user decisions land there as events, get indexed into FTS5, and are pulled back through BM25 search when the conversation compacts. The model picks up where it stopped. One catch: without the `--continue` flag, the previous session's data is deleted right away, so a new session starts from a clean slate.

A separate principle is that the agent writes a script to do the analysis instead of computing it itself. Rather than reading fifty files, it runs code and prints only the result. The mode doesn't dictate how the model phrases its answer — brevity or completeness stays with the model and your `CLAUDE.md`. Claude v1.0.33 or newer is required; check with `claude --version`.

## Install

### Claude Code (native platform)

**Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin marketplace add anthropics/claude-plugins-community
```
In the agent chat (not a shell):
```text
/plugin install context-mode@claude-community
```

## When to use it
- keep raw MCP tool output out of the context window
- recover which files were being edited after a compact
- replace ten tool calls with a single script
- find a session event by search instead of rereading history
- start a fresh session without leftovers from the previous one

## Example prompts
- count lines in every .ts file under src with ctx_execute, don't read them into context
- what did I edit in the last session? pull it from the events
- take a Playwright snapshot but return only the headings

## Similar
- [context-sync](https://affpapa.org/en/nevibecode/mcp/context-sync.md) — MCP server · ★ 189
- [bmad-project-context](https://affpapa.org/en/nevibecode/skills/bmad-project-context.md) — skill · 11500 installs
- [context-engineering-collection](https://affpapa.org/en/nevibecode/skills/context-engineering-collection.md) — skill · 4200 installs
- [app-marketing-context](https://affpapa.org/en/nevibecode/skills/app-marketing-context.md) — skill · 3400 installs
- [social-media-context-sms](https://affpapa.org/en/nevibecode/skills/social-media-context-sms.md) — skill · 1900 installs
- [context-canary](https://affpapa.org/en/nevibecode/skills/context-canary.md) — skill · 1900 installs

From the same set: [mksglu/context-mode](https://affpapa.org/en/nevibecode/by/mksglu/context-mode.md) — 10 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
