context-mode
यह क्या करती है
यह स्किल AI एजेंट को बड़े कमांड आउटपुट और फ़ाइलों को पूरा पढ़ने के बजाय context-mode टूल से प्रोसेस करने का मार्गदर्शन देती है। यह लंबे लॉग, बड़े API जवाब और बिल्ड आउटपुट के साथ काम करने वाले डेवलपर्स के लिए है।
कब इस्तेमाल करें
- ✓जब एजेंट से लॉग का विश्लेषण करने, कमांड आउटपुट का सारांश देने या बड़े JSON जवाब को पार्स करने को कहा जाए।
- ✓जब कोई बिल्ड या डिपेंडेंसी जाँच लंबा आउटपुट दे सकती हो, जिसे फ़िल्टर करना चाहिए।
- ✓जब कोई पेज स्नैपशॉट या ब्राउज़र स्ट्रक्चर सीधे पढ़ने के लिए बहुत बड़ा हो।
Skill का लिंक
https://github.com/mksglu/context-mode/blob/main/skills/context-mode/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“इन बिल्ड लॉग का विश्लेषण कीजिए और मुझे केवल एरर बताइए, पूरा आउटपुट दिखाए बिना।”
हर हफ़्ते 5 नई skills, 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 जैसे छोटे, सुरक्षित काम शेल में चल सकते हैं।
बड़े आउटपुट के साथ यह क्या करती है?
यह आउटपुट को sandbox में प्रोसेस करती है और बातचीत में केवल प्रासंगिक नतीजे लौटाती है।
क्या यह हर कमांड पर लागू होता है?
यह अधिकतर कमांड पर लागू होता है, और नियम यह है कि जब एजेंट को आउटपुट के आकार का अंदाज़ा न हो, तब 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
- लाइसेंस
- —
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
context-mode
33kआपके एजेंट को पढ़ने, खोजने और डेटा-भारी काम चलाने के लिए context-mode टूल इस्तेमाल करना सिखाती है, ताकि बड़े आउटपुट मुख्य बातचीत में न आएँ।
context-mode
33kआपके एजेंट को डेटा-भारी काम sandbox में चलाकर केवल जवाब छापना सिखाती है, ताकि कच्ची फ़ाइलें और वेब पेज बातचीत न भरें।
ctx-doctor
33kcontext-mode के डायग्नोस्टिक चलाती है, जो रनटाइम, हुक, सर्च स्टोरेज, प्लगइन सेटअप और वर्शन जाँचती है, फिर साफ़ पास या फ़ेल रिपोर्ट दिखाती है।
ctx-index
33kआपके एजेंट को किसी लोकल प्रोजेक्ट या फ़ोल्डर को खोजने योग्य स्टोर में इंडेक्स करने देती है, ताकि बाद के सवालों के लिए हर फ़ाइल दोबारा न पढ़नी पड़े।
मिलती-जुलती skills
add-model-provider
394kयह आपके एजेंट को सुरक्षित कमांड से OpenClaw में नया AI मॉडल प्रोवाइडर जोड़ने, API कीज़ को सादे टेक्स्ट से बचाने और लाइव टेस्ट चलाने देती है।
acp-router
394kयह आपके एजेंट को OpenClaw के ज़रिए Claude Code या Cursor जैसे कोडिंग असिस्टेंट को काम भेजने देती है, ताकि काम उसी टूल में चले।
browser-automation
394kयह आपके एजेंट को लॉगिन, टैब और अटकी वेब पेज से उबरने समेत, वेबसाइट पर चरण-दर-चरण काम करना सिखाती है।