context-mode
🤖 AI Summary
This skill enforces a strict execution policy: all commands must use `ctx_execute` or `ctx_execute_file` by default, with only a whitelist of file mutation, Git write, navigation, process control, package management, and simple output commands allowed to run directly via Bash.
How to Install
Claude Code:
git clone --depth 1 https://github.com/mksglu/context-mode.git && cp context-mode/skills/context-mode ~/.claude/skills/context-mode -r# Context Mode: Default for All Large Output
## MANDATORY RULE
Default to context-mode for ALL commands. Only use Bash for guaranteed-small-output operations.
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_execute_file (file lo
Details
| Category | DevOps → cicd |
| Source | mksglu/context-mode |
| SKILL.md | View on GitHub → |
| Repo Stars | ★ 18.0K |
| Est. per Skill | ~2.0K (shared across 9 skills from this repo) |
| Difficulty | Advanced |
| Risk Level | N/A |
Related Skills
bash-defensive-patterns
Bash Defensive Patterns Comprehensive guidance for writing production-ready Bash scripts using defen
deployment-procedures
Deployment Procedures Deployment principles and decision-making for safe production releases. Learn
makepad-deployment
Makepad Packaging & Deployment This skill covers packaging Makepad applications for all supporte
cloud-devops
Cloud/DevOps Workflow Bundle Overview Comprehensive cloud and DevOps workflow for infrastructure pro
Works Well With
Skills from the same repository — often designed to work together
ctx-doctor
Context Mode Doctor Run diagnostics and display results directly in the conversation. Instructions 1
ctx-index
Context Mode Index Index local project content for later search. Instructions 1. Prefer the ctxindex
ctx-insight
Context Mode Insight Open the personal analytics dashboard in the browser. Instructions 1. Call the