
Context Mode
Install context-mode so your coding agent routes heavy command and MCP output through ctx_execute instead of flooding the chat with raw Bash dumps.
Overview
Context-mode is a journey-wide agent skill that routes large command and MCP outputs through ctx_execute instead of Bash—usable whenever a solo builder needs reliable log, test, and API processing without token blowups.
Install
npx skills add https://github.com/mksglu/context-mode --skill context-modeWhat is this skill?
- Mandates ctx_execute and ctx_execute_file as the default for any command whose stdout may exceed a few lines
- Defines a Bash whitelist for safe small-output ops: mkdir, git writes, cd, ls, rg, tail-capped test runs, and similar
- Requires context-mode for any MCP tool return longer than 20 lines
- Documents decision logic: small guaranteed output → Bash; everything else → context-mode
- Notes automatic subagent routing via a PreToolUse hook for oversized workloads
- MCP tool outputs longer than 20 lines must use context-mode
- Bash whitelist covers file mutations, git writes, navigation, and capped test tails
Adoption & trust: 826 installs on skills.sh; 16.7k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You ask the agent to analyze tests or MCP results and the reply becomes an unreadable wall of raw terminal text.
Who is it for?
Solo builders who live in Claude Code or Cursor, run tests and git often, and use MCP tools that return bulky structured output.
Skip if: Sessions limited to quick mkdir, commit, or ls-style commands where every operation is already on the Bash whitelist with guaranteed short stdout.
When should I use this skill?
Triggers include analyze logs, summarize output, process data, parse JSON, run tests, git log/diff, MCP output over 20 lines, browser snapshots, and any command where stdout is not guaranteed small.
What do I get? / Deliverables
After the skill is active, heavy output stays inside context-mode tooling while only whitelisted small-output Bash ops run inline, keeping summaries and extractions usable in chat.
- Large stdout/stderr processed via context-mode rather than raw chat paste
- Bash used only for whitelisted low-volume file, git, and navigation commands
Recommended Skills
Journey fit
Useful at every journey phase - explore requirements and options before committing to a direction.
Where it fits
Parse a bulky API response or dependency tree with ctx_execute instead of dumping raw JSON into chat.
Summarize failed test or coverage output after routing npm test through context-mode with an explicit tail cap.
Extract errors from application logs or kubectl pod listings without pasting full cluster state.
Process long Playwright or accessibility snapshots when validating landing pages for AI-search visibility checks.
Filter and aggregate analytics or query-result exports that exceed a screenful of lines.
How it compares
Use this procedural skill to default execution through context-mode instead of treating unconstrained Bash and cat as the normal path for data-heavy tasks.
Common Questions / FAQ
Who is context-mode for?
It is for solo and indie developers using agentic IDEs who routinely process logs, test output, JSON, git history, Kubernetes listings, docs fetches, and large MCP responses.
When should I use context-mode?
Use it whenever output might exceed a few lines—in Build while parsing dependencies or API responses, in Ship while reviewing test or CI/CD output, in Operate while analyzing logs or pod status, and for any MCP return over about 20 lines.
Is context-mode safe to install?
Review the Security Audits panel on this Prism page for published audit results and risk signals; the skill encourages broad shell execution via context-mode, so confirm it matches your trust model before enabling it in production repos.
SKILL.md
READMESKILL.md - Context Mode
# Context Mode: Default for All Large Output ## MANDATORY RULE <context_mode_logic> <mandatory_rule> Default to context-mode for ALL commands. Only use Bash for guaranteed-small-output operations. </mandatory_rule> </context_mode_logic> Bash whitelist (safe to run directly): - **File mutations**: `mkdir`, `mv`, `cp`, `rm`, `touch`, `chmod` - **Git writes**: `git add`, `git commit`, `git push`, `git checkout`, `git branch`, `git merge` - **Navigation**: `cd`, `pwd`, `which` - **Process control**: `kill`, `pkill` - **Package management**: `npm install`, `npm publish`, `pip install` - **Simple output**: `echo`, `printf` **Everything else → `ctx_execute` or `ctx_execute_file`.** Any command that reads, queries, fetches, lists, logs, tests, builds, diffs, inspects, or calls an external service. This includes ALL CLIs (gh, aws, kubectl, docker, terraform, wrangler, fly, heroku, gcloud, etc.) — there are thousands and we cannot list them all. **When uncertain, use context-mode.** Every KB of unnecessary context reduces the quality and speed of the entire session. ## Decision Tree ``` About to run a command / read a file / call an API? │ ├── Command is on the Bash whitelist (file mutations, git writes, navigation, echo)? │ └── Use Bash │ ├── Output MIGHT be large or you're UNSURE? │ └── Use context-mode ctx_execute or ctx_execute_file │ ├── Fetching web documentation or HTML page? │ └── Use ctx_fetch_and_index → ctx_search │ ├── Using Playwright (navigate, snapshot, console, network)? │ └── ALWAYS use filename parameter to save to file, then: │ browser_snapshot(filename) → ctx_index(path) or ctx_execute_file(path) │ browser_console_messages(filename) → ctx_execute_file(path) │ browser_network_requests(filename) → ctx_execute_file(path) │ ⚠ browser_navigate returns a snapshot automatically — ignore it, │ use browser_snapshot(filename) for any inspection. │ ⚠ Playwright MCP uses a SINGLE browser instance — NOT parallel-safe. │ For parallel browser ops, use agent-browser via execute instead. │ ├── Using agent-browser (parallel-safe browser automation)? │ └── Run via execute (shell) — each call gets its own subprocess: │ execute("agent-browser open example.com && agent-browser snapshot -i -c") │ ✓ Supports sessions for isolated browser instances │ ✓ Safe for parallel subagent execution │ ✓ Lightweight accessibility tree with ref-based interaction │ ├── Processing output from another MCP tool (Context7, GitHub API, etc.)? │ ├── Output already in context from a previous tool call? │ │ └── Use it directly. Do NOT re-index with ctx_index(content: ...). │ ├── Need to search the output multiple times? │ │ └── Save to file via ctx_execute, then ctx_index(path) → ctx_search │ └── One-shot extraction? │ └── Save to file via ctx_execute, then ctx_execute_file(path) │ └── Reading a file to analyze/summarize (not edit)? └── Use ctx_exec