Skip to main content
rule CX Codex

context-mode · mksglu, cursor — Claude Code rule: what it does, how to install

context-mode routes heavy tool outputs and web pages into an MCP sandbox so raw data does not clutter the agent context window.

Elastic-2.0 ★ 34,370 updated 2026-10-24

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/context-mode.mdc
Open on GitHub

What context-mode does

The rule instructs the assistant to avoid dumping large text streams or terminal logs directly into the chat. When filtering or parsing data, the model runs JavaScript scripts through ctx_execute with Node.js standard libraries. Only the final printed lines reach the session.

Network lookups and web pages pass through ctx_fetch_and_index into an FTS5 index. For external API calls, parallel execution stays between 4 and 8 workers, while GitHub CLI commands are capped at 4. The rule strictly forbids using execution sandboxes to alter files; source code changes must happen through native file-writing tools.

Past decisions and constraints persist across session compaction. Upon reconnecting, the agent runs ctx_search against the timeline instead of asking the developer what was done before.

What it helps with

  • keep raw terminal logs out of the model context
  • filter large files using sandbox scripts
  • retrieve previous decisions from an indexed timeline
  • throttle concurrent network calls and GitHub API requests

Example prompts for the agent

  • Inspect the test log with a sandbox script and return only failing assertions.
  • Run ctx_search to check our previous decisions on database schema.
  • Fetch the documentation page with ctx_fetch_and_index and extract auth headers.

How to install context-mode

Manually: put the files in place

.cursor/rules/context-mode.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about context-mode

How to install context-mode in Claude Code?

Register the catalog with /plugin marketplace add mksglu/context-mode and install the package with /plugin install context-mode@context-mode.

What does context-mode do?

It directs the assistant to run data processing inside a sandbox rather than pasting raw output into the chat. This keeps the active context window lean during heavy tasks.

Can context-mode scripts edit project files?

No, the rule prohibits editing or creating files through ctx_execute. The agent must rely on native platform file editing tools for all code modifications.

Similar IDE rules

All IDE rules for Agent setup: memory, context, orchestration →

context-mode by other authors comes first.

context-mode Mert Koseoğlu This rule routes data work through context-mode MCP tools and keeps raw files out of the conversation. Use it for analysis, search, and transformations. CX Codex +1 ★ 34,370repo stars context-surfing pskoett context-surfing monitors context coherence during extended coding sessions, saving state and performing clean handoffs before hallucinations ruin output. CX Codex +1 272installs context-optimizer Rohit Ghumare The context-optimizer command checks context window fill rates in Claude Code and helps cut token waste before responses degrade. CX Codex +1 ★ 2,966repo stars context-engineer Rohit Ghumare context-engineer audits context window usage across project files, tools, and MCP servers. Useful when sessions run slow or hit token compaction too often. CX Codex ★ 2,966repo stars context-budget affaan-m context-budget — a skill for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode that displays live context usage and remaining capacity through the provider's native commands. CX Codex +1 7,000installs context-compression muratcankoylan context-compression gives an agent a written procedure for folding a long session into a structured summary: intent, files touched, decisions, next steps. CX Codex +1 669installs codex-1m-context-window-setup daymade codex-1m-context-window-setup inspects Codex context settings, adjusts auto-compaction, and applies a model-aware expansion toward 500K or 1M when supported. CX Codex +1 211installs

From the same set14

The whole set →
ctx-purge ctx-purge — a skill to permanently delete project context data in bulk or by session. Wipes the knowledge base, session records, and stats — this action cannot be undone. CX Codex +1 1,600installs ctx-insight The ctx-insight skill opens the Insight dashboard in your default browser. Use it to review engineer-level productivity, retry waste, blockers, and role-based views. CX Codex +1 1,500installs ctx-index ctx-index indexes local files and directories into context-mode's FTS5 database. It allows future searches to pull exact snippets without reloading raw project files into context. CX Codex +1 1,200installs ctx-search ctx-search searches a persistent project knowledge base without reloading source files into context. Queries indexed code, documentation, and session memory via FTS5. CX Codex +1 1,100installs context-mode This skill routes data analysis, searches, and page retrieval through context-mode tools. It helps keep large raw inputs out of an agent’s context. CX Codex +1 ★ 34,370repo stars context-mode A rules file that tells the agent when to run code in the context-mode sandbox instead of pasting files and command output into the chat. CX Codex +1 ★ 34,370repo stars context-mode This rule routes data work through context-mode MCP tools and keeps raw files out of the conversation. Use it for analysis, search, and transformations. CX Codex +1 ★ 34,370repo stars context-mode 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. ★ 34,370repo stars

More in the catalog

Project sponsors

Companies that keep this analytics open