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
.cursor/rules/context-mode.mdcWhat 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_searchto check our previous decisions on database schema. - Fetch the documentation page with
ctx_fetch_and_indexand extract auth headers.
How to install context-mode
Manually: put the files in place
.cursor/rules/context-mode.mdcFrontmatter: description, globs, alwaysApply
1Plugin marketplace
/plugin marketplace add mksglu/context-mode/plugin install context-mode@context-mode2Manually: put the files in place
.claude/rules/context-mode.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/context-mode.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/context-mode.mdManually: put the files in place
.clinerules/context-mode.mdStep 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.