---
name: Context Mode
slug: context-mode-3
category: AI Engineering
description: "Context Mode enforces mandatory routing rules that keep raw bytes out of an agent's context window. Use it when analyzing, counting, filtering, comparing, searching, parsing, or transforming data, fetching URLs, or running data-heavy commands."
github: "https://github.com/mksglu/context-mode/tree/main/configs/copilot-cli/skills/context-mode"
language: TypeScript
stars: 19850
forks: 1430
install: "npx degit https://github.com/mksglu/context-mode/tree/main/configs/copilot-cli/skills/context-mode ~/.claude/skills/context-mode"
installs_to: ~/.claude/skills/context-mode
source_path: configs/copilot-cli/skills/context-mode/SKILL.md
collection_size: 11
category_size: 2451
collection_url: "https://dirskills.com/collections/mksglu/context-mode"
added: 2026-08-14T07:12:40.908Z
last_synced: 2026-08-14T07:12:40.908Z
canonical_url: "https://dirskills.com/skills/context-mode-3"
---

# Context Mode

Context Mode enforces mandatory routing rules that keep raw bytes out of an agent's context window. Use it when analyzing, counting, filtering, comparing, searching, parsing, or transforming data, fetching URLs, or running data-heavy commands.

**Install:**

```bash
npx degit https://github.com/mksglu/context-mode/tree/main/configs/copilot-cli/skills/context-mode ~/.claude/skills/context-mode
```

## README

# 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)` then `ctx_search(queries)`.
- **Inline HTTP** (`node -e "fetch(...)"`, `python -c "requests.get(...)"`) — use
  `ctx_execute(language, code)`; only stdout enters context.
- **Reading large files to analyze** — use
  `ctx_execute_file(path, language, code)`.

## Tool selection

1. **GATHER**: `ctx_batch_execute(commands, queries)` — runs all commands,
   auto-indexes, returns search. One call replaces dozens.
2. **PROCESS**: `ctx_execute` / `ctx_execute_file` — sandbox; only stdout enters
   context.
3. **WEB**: `ctx_fetch_and_index(url, source)` then `ctx_search(queries)` — raw
   HTML never enters context.
4. **SEARCH**: `ctx_search(queries: [...])` — all questions in one call.

Write artifacts to FILES; return a path + one-line description, not inline dumps.
