context-mode
Use context-mode tools (ctx_execute, ctx_execute_file) instead of Bash/cat when processing large outputs.
Skill by som1shi
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/som1shi-context-mode
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents, backend, testing, devops
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
context-mode- Description
- Use context-mode tools (ctx_execute, ctx_execute_file) instead of Bash/cat when processing large outputs. Triggers: "analyze logs", "summarize output", "process data", "parse JSON", "filter results", "extract errors", "check build output", "analyze dependencies", "process API response", "large file analysis", "page snapshot", "browser snapshot", "DOM structure", "inspect page", "accessibility tree", "Playwright snapshot", "run tests", "test output", "coverage report", "git log", "recent commits", "diff between branches", "list containers", "pod status", "disk usage", "fetch docs", "API reference", "index documentation", "call API", "check response", "query results", "find TODOs", "count lines", "codebase statistics", "security audit", "outdated packages", "dependency tree", "cloud resources", "CI/CD output". Also triggers on ANY MCP tool output that may exceed 20 lines. Subagent routing is handled automatically via PreToolUse hook.
- License
- MIT
- Instructions
- 294 lines in SKILL.md · view on GitHub
Before installing
- Instructions call the network
Files (5)
- SKILL.md
- anti-patterns.md · references/
- patterns-javascript.md · references/
- patterns-python.md · references/
- patterns-shell.md · references/
SKILL.md (first lines)
# Context Mode: Default for Large Output
## MANDATORY RULE
<context_mode_logic>
<mandatory_rule>
Use context-mode for commands, files, tool outputs, API calls, logs, tests, builds, or datasets that may produce large output or need server-side analysis. Do not use it as a blanket replacement for normal Pi tools or bounded shell execution.
</mandatory_rule>
</context_mode_logic>
Use normal Pi tools for:
- exact small file reads before editing;
- exact edits and writes;
- symbol and module tools, AST tools, and LSP tools for code intelligence;
- small grep/find/ls lookups where direct output is already bounded.
Use Bash directly only for bounded commands that genuinely need shell execution, such as tests/builds/package commands, read-only git inspection, cloud/database CLIs with narrow filters, and small purpose-built scripts. Root prompt policy still controls destructive shell commands, mutating git, sudo, secret paths, and user approval requirements.
Use `ctx_execute`, `ctx_execute_file`, indexing, or search for commands that read, query, fetch, list, log, test, build, diff, inspect, or call external services when their output may exceed the useful context budget or needs analysis before summarization.
When uncertain about output size, prefer context-mode. Every KB of unnecessary context reduces the quality and speed of the session.
## Decision Tree
```
About to run a command / read a file / call an API?
│
├── Need an exact small file read for editing or source inspection?
│ └── Use normal Pi read, symbol/module, AST, or LSP tools
│
├── Command genuinely needs shell execution and has bounded output?
│ └── Use Bash, subject to root prompt safety and git rules
│
├── 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 loads into FILE_CONTENT, not context)
```
## When to Use Each Tool
| Situation | Tool | Example |
| -------------------------------------------- | --------------------------------------------------------------- | -------------------------------------------------- |
| Hit an API endpoint | `ctx_execute` | `fetch('http://localhost:3000/api/orders')` |
| Run CLI that returns sizable data | `ctx_execute` | `gh pr list`, `aws s3 ls`, `kubectl get pods` |
| Run tests with potentially large output | `ctx_execute` | `npm test`, `pytest`, `go test ./...` |
| Read-only git operations with sizable output | `ctx_execute` | `git log --oneline -50`, `git diff HEAD~5` |
| Docker/K8s inspection | `ctx_execute` | `docker stats --no-stream`, `kubectl describe pod` |
| Read a log file | `ctx_execute_file` | Parse access.log, error.log, build output |
| Read a data file | `ctx_execute_file` | Analyze CSV, JSON, YAML, XML |
| Read source code to analyze | `ctx_execute_file` | Count functions, find patterns, extract metrics |
| Fetch web docs | `ctx_fetch_and_index` | Index React/Next.js/Zod docs, then search |
| Playwright snapshot | `browser_snapshot(filename)` → `ctx_index(path)` → `ctx_search` | Save to file, index server-side, query |
| Playwright snapshot (one-shot) | `browser_snapshot(filename)` → `ctx_execute_file(path)` | Save to file, extract in sandbox |
| Playwright console/network | `browser_*(filename)` → `ctx_execute_file(path)` | Save to file, analyze in sandbox |
| MCP output (already in context) | Use directly | Don't re-index — it's already loaded |
| MCP output (need multi-query) | `ctx_execute` to save → `ctx_index(path)` → `ctx_search` | Save to file first, index server-side |
| Wipe indexed KB content | `ctx_purge(confirm: true)` | Permanently deletes all indexed content |
## Automatic Triggers
Use context-mode for these when output may be large, needs filtering/summarization, or benefits from server-side analysis:
- **API debugging**: "hit this endpoint", "call the API", "check the response", "find the bug in the response"
- **Log analysis**: "check the logs", "what errors", "read access.log", "debug the 500s"
- **Test runs**: "run the tests", "check if tests pass", "test suite output"
- **Git history**: "show recent commits", "git log", "what changed", "diff between branches"
- **Data inspection**: "look at the CSV", "parse the JSON", "analyze the config"
- **Infrastructure**: "list containers", "check pods", "S3 buckets", "show running services"
- **Dependency audit**: "check dependencies", "outdated packages", "security audit"
- **Build output**: "build the project", "check for warnings", "compile errors"
- **Code metrics**: "count lines", "find TODOs", "function count", "analyze codebase"
- **Web docs lookup**: "look up the docs", "check the API reference", "find examples"
For bounded one-shot commands with small expected output, use the normal Pi tool or Bash path allowed by root policy instead.
## Language Selection
| Situation | Language | Why |
| ------------------------- | ------------ | ------------------------------------- |
| HTTP/API calls, JSON | `javascript` | Native fetch, JSON.parse, async/await |
| Data analysis, CSV, stats | `python` | csv, statistics, collections, re |
| Shell commands with pipes | `shell` | grep, awk, jq, native tools |
| File pattern matching | `shell` | find, wc, sort, uniq |
## Search Query Strategy
- BM25 uses **OR semantics** — results matching more terms rank higher automatically
- Use 2-4 specific technical terms per queryFrom som1shi/pi-config, MIT.
More from som1shi/pi-config
- 0.524score
commit
som1shi
Git commit and branch naming conventions only — ss/ branch prefix, terse imperative commit messages.
SkillBFreshness: BClaude Code +9 - 0.521score
delegation
som1shi
Use subagents for nontrivial work, review support, research, reconnaissance, validation, and exceptional isolated implementation.
SkillBFreshness: BClaude Code +9 - 0.521score
brainstorming
som1shi
Use for unclear intent or a material goal, behavior, placement, or design choice unresolved after inspection.
SkillBFreshness: BClaude Code +9 - 0.521score
code-intelligence
som1shi
Use for code ownership, structure, symbols, types, references, call relationships, structural patterns, and diagnostics.
SkillBFreshness: BClaude Code +9 - 0.521score
code-quality-review
som1shi
Deep code-quality and simplification review for explicit review requests or concrete useful background quality checks.
SkillBFreshness: BClaude Code +9 - 0.521score
context-mode
som1shi
Use Context Mode for large command, test, log, API, document, data, browser, or MCP output that would otherwise flood the model context.
SkillBFreshness: BClaude Code +9 - 0.471score
behavioral-proof
som1shi
Selects proportionate evidence for material behavior changes and bug fixes.
SkillCFreshness: CClaude Code +9 - 0.455score
diagnose
som1shi
Disciplined diagnosis loop for hard bugs and performance regressions.
SkillCFreshness: CClaude Code +9 - 0.450score
improve-codebase-architecture
som1shi
Find deepening opportunities in a codebase, informed by the domain language in CONTEXT.md and the decisions in docs/adr/.
SkillCFreshness: CClaude Code +9 - 0.450score
grill-with-docs
som1shi
Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as…
SkillCFreshness: CClaude Code +9 - 0.450score
tdd
som1shi
Test-driven development with red-green-refactor loop.
SkillCFreshness: CClaude Code +9 - 0.445score
grill-me
som1shi
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree.
SkillCFreshness: CClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Jul 22, 2026 (3 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/som1shi/pi-config
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.766score
context-mode
mksglu
Use context-mode tools (ctx_execute, ctx_execute_file) instead of Bash/cat when processing large outputs.
SkillCFreshness: C★ 32.1KClaude Code +9 - 0.339score
context-mode
xzang2026
Use context-mode tools (ctx_execute, ctx_execute_file) instead of Bash/cat when processing large outputs.
SkillAFreshness: AClaude Code +9 - 0.326score
context-mode
exoad
Use context-mode tools (ctx_execute, ctx_execute_file) instead of Bash/cat when processing large outputs.
SkillCFreshness: C★ 9Claude Code +9 - 0.285score
context-mode
IliaRL
Use context-mode tools (ctx_execute, ctx_execute_file) instead of Bash/cat when processing large outputs.
SkillCFreshness: CClaude Code +9 - 0.285score
context-mode
hgxszhj
Use context-mode tools (ctx_execute, ctx_execute_file) instead of Bash/cat when processing large outputs.
SkillCFreshness: CClaude Code +9 - 0.285score
context-mode
msg-life-slovakia
Use context-mode tools (ctx_execute, ctx_execute_file) instead of Bash/cat when processing large outputs.
SkillCFreshness: CClaude Code +9 - 0.285score
context-mode
zhangyejian
Use context-mode tools (ctx_execute, ctx_execute_file) instead of Bash/cat when processing large outputs.
SkillCFreshness: CClaude Code +9 - 0.246score
context-mode
infodigitalmissionary
Use context-mode tools (ctx_execute, ctx_execute_file) instead of Bash/cat when processing large outputs.
SkillDFreshness: DClaude Code +9
More from som1shi
- 0.524score
commit
som1shi
Git commit and branch naming conventions only — ss/ branch prefix, terse imperative commit messages.
SkillBFreshness: BClaude Code +9 - 0.521score
delegation
som1shi
Use subagents for nontrivial work, review support, research, reconnaissance, validation, and exceptional isolated implementation.
SkillBFreshness: BClaude Code +9 - 0.521score
brainstorming
som1shi
Use for unclear intent or a material goal, behavior, placement, or design choice unresolved after inspection.
SkillBFreshness: BClaude Code +9 - 0.521score
code-intelligence
som1shi
Use for code ownership, structure, symbols, types, references, call relationships, structural patterns, and diagnostics.
SkillBFreshness: BClaude Code +9 - 0.521score
code-quality-review
som1shi
Deep code-quality and simplification review for explicit review requests or concrete useful background quality checks.
SkillBFreshness: BClaude Code +9 - 0.521score
context-mode
som1shi
Use Context Mode for large command, test, log, API, document, data, browser, or MCP output that would otherwise flood the model context.
SkillBFreshness: BClaude Code +9
Cite this page
context-mode skill. Agent Mart. https://agentmart.dev/skills/som1shi-context-mode (last updated 2026-10-24)