context-mode
What it does
This skill sets routing rules for an AI agent that uses context-mode tools in GitHub Copilot CLI. It is for people who analyze large files, logs or web pages and want their conversation kept small.
When to use it
- βWhen an agent needs to count, filter, compare or parse a large amount of data.
- βWhen a task involves fetching a web page that would otherwise dump raw HTML into the conversation.
- βWhen a command produces a large output that should be processed rather than read in full.
Skill link
https://github.com/mksglu/context-mode/blob/main/configs/copilot-cli/skills/context-mode/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βCount the failing tests in this large log file without pasting the whole log into our chat.β
5 new skills a week. 1 minute to read.
How it works
The skill tells the agent to write code that runs in a sandbox and returns only the final answer. Large outputs are saved and searched instead of being read in full.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
context-mode β MANDATORY routing rules
context-mode MCP tools are available in GitHub Copilot CLI. These rules protect the context window from flooding β one unrouted command can dump tens of KB into the conversation. Follow them strictly.
Think in Code β MANDATORY
Analyze / count / filter / compare / search / parse / transform data: write
code via ctx_execute(language, code) and console.log() only the answer. Do
NOT read raw data into context. PROGRAM the analysis, do not COMPUTE it by
reading. One script replaces ten tool calls.
BLOCKED β do NOT use
- curl / wget β dumps raw HTTP into context. Use
ctx_fetch_and_index(url, source)thenctx_search(queries). - Inline HTTP (
node -e "fetch(...)",python -c "requests.get(...)") β usectx_execute(language, code); only stdout enters context. - Reading large files to analyze β use
ctx_execute_file(path, language, code).
Tool selection
- GATHER:
ctx_batch_execute(commands, queries)β runs all commands, auto-indexes, returns search. One call replaces dozens. - PROCESS:
ctx_execute/ctx_execute_fileβ sandbox; only stdout enters context. - WEB:
ctx_fetch_and_index(url, source)thenctx_search(queries)β raw HTML never enters context. - SEARCH:
ctx_search(queries: [...])β all questions in one call.
Write artifacts to FILES; return a path + one-line description, not inline dumps.
FAQ
Which tools does it rely on?
It relies on context-mode tools such as sandboxed code execution, batch commands, indexed search and web fetching.
Does it block normal commands?
It blocks a few commands, such as curl and wget, that dump raw output, and asks the agent to use the sandbox instead.
Do I need the context-mode tools installed?
Yes. The context-mode tools must be available in GitHub Copilot CLI for these rules to work.
Details
Original description by the author
MANDATORY routing rules for context-mode. Invoke whenever you analyze, count, filter, compare, search, parse, or transform data; fetch a URL; or run a data-heavy command β so raw bytes stay out of the context window.
repo: mksglu/context-mode
Popularity
- GitHub stars
- 33k
- Ranking position
- #8509
- License
- β
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
context-mode
33kTeaches your agent to use context-mode tools for reading, searching and running data-heavy tasks, so large outputs stay out of the main conversation.
context-mode
33kTeaches your agent to use context-mode tools instead of plain shell commands when output may be large, such as logs, JSON or build results.
ctx-doctor
33kRuns context-mode diagnostics that check runtimes, hooks, search storage, plugin setup and versions, then shows a clear pass or fail report.
ctx-index
33kLets your agent index a local project or folder into a searchable store, so later questions find the right snippets without rereading every file.
Similar skills
add-model-provider
394kLets your agent connect a new AI model provider to OpenClaw using safe setup commands, keep API keys out of plain text, and run a live test.
acp-router
394kHelps your agent send a task to a coding assistant such as Claude Code or Cursor through OpenClaw, so the work runs in that tool.
browser-automation
394kTeaches your agent to control web pages step by step, including logins, tabs, and recovery when a page stops responding.