context-mode
하는 일
이 스킬은 AI 에이전트가 큰 명령 출력과 파일을 전체로 읽는 대신 context-mode 도구로 처리하도록 안내합니다. 긴 로그, 큰 API 응답, 빌드 출력을 다루는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓에이전트가 로그를 분석하거나 명령 출력을 요약하거나 큰 JSON 응답을 파싱해야 할 때.
- ✓빌드나 의존성 점검이 길게 출력되어 거를 필요가 있을 때.
- ✓페이지 스냅숏이나 브라우저 구조가 너무 커서 직접 읽기 어려울 때.
스킬 링크
https://github.com/mksglu/context-mode/blob/main/skills/context-mode/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 빌드 로그를 분석해서 오류만 알려 주세요. 전체 출력은 보여 주지 말아 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 기본 규칙을 정합니다. 읽거나, 조회하거나, 가져오거나, 목록을 만들거나, 빌드하는 모든 것에 context-mode 도구를 사용하고, 작고 안전한 동작에는 일반 셸 명령을 씁니다. 그다음 에이전트는 중요한 부분만 보여 줍니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
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_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 data | ctx_execute |
gh pr list, aws s3 ls, kubectl get pods |
| Run tests | ctx_execute |
npm test, pytest, go test ./... |
| Git operations | 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 |
자주 묻는 질문
어떤 명령은 바로 실행할 수 있나요?
폴더 만들기, 파일 이동, git 쓰기, 탐색, echo 같은 작고 안전한 작업은 셸에서 바로 실행할 수 있습니다.
큰 출력은 어떻게 하나요?
샌드박스에서 출력을 처리하고, 대화에는 관련 결과만 돌려줍니다.
모든 명령에 적용되나요?
대부분의 명령에 적용되며, 출력 크기를 확실히 모를 때는 context-mode를 쓰는 것이 규칙입니다.
상세 정보
작성자의 원본 설명
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 referen
repo: mksglu/context-mode
인기도
- GitHub 스타
- 33k
- 순위
- #8510
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
context-mode
33k에이전트가 context-mode 도구로 데이터가 많은 읽기, 검색, 실행 작업을 처리하도록 가르칩니다. 큰 출력이 메인 대화에 들어가지 않게 합니다.
context-mode
33k에이전트가 데이터가 많은 작업을 샌드박스에서 실행하고 답만 출력하도록 가르칩니다. 원시 파일과 웹 페이지가 대화를 채우지 않게 합니다.
ctx-doctor
33k런타임, 훅, 검색 저장소, 플러그인 설정, 버전을 점검하는 context-mode 진단을 실행하고 명확한 통과 또는 실패 보고서를 보여 줍니다.
ctx-index
33k에이전트가 로컬 프로젝트나 폴더를 검색 가능한 저장소에 인덱싱하도록 돕습니다. 나중 질문은 모든 파일을 다시 읽지 않고 맞는 코드 조각을 찾습니다.
비슷한 스킬
add-model-provider
394k에이전트가 안전한 설정 명령으로 새 AI 모델 제공자를 OpenClaw에 연결하고, API 키를 평문으로 두지 않으며, 실시간 테스트를 실행하도록 돕습니다.
acp-router
394k에이전트가 OpenClaw를 통해 Claude Code나 Cursor 같은 코딩 도우미에 작업을 전달해, 작업이 그 도구에서 실행되도록 돕습니다.
browser-automation
394k에이전트가 로그인, 탭, 페이지 응답이 멈췄을 때의 복구를 포함해 웹 페이지를 단계별로 조작하도록 가르칩니다.