मुख्य सामग्री पर जाएँ
Skillpedia
एजेंट18k · #10642

filesystem-context

यह क्या करती है

यह स्किल दिखाती है कि लंबे आउटपुट, योजनाएँ और नोट्स फ़ाइलों में कैसे सेव करें और ज़रूरत पड़ने पर ही वापस पढ़ें, ताकि AI की कार्यशील window साफ़ रहे। यह उन एजेंट बनाने वालों के लिए है जो लंबे काम चलाते हैं या एजेंटों के बीच काम साझा करते हैं।

कब इस्तेमाल करें

  • ✓जब टूल आउटपुट या logs एजेंट की context window भर रहे हों।
  • ✓जब एजेंट को लंबे काम के दौरान योजना या scratch नोट्स रखने हों।
  • ✓जब कई एजेंटों को सीधे संदेशों के बजाय फ़ाइलों से जानकारी साझा करनी हो।

Skill का लिंक

https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/blob/main/skills/filesystem-context/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/blob/main/skills/filesystem-context/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरे एजेंट को ऐसा सेट कीजिए कि वह लंबे command आउटपुट फ़ाइलों में सेव करे और केवल ज़रूरी हिस्से पढ़े।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट नतीजे फ़ाइलों में लिखता है, फिर ज़रूरत के अनुसार प्रासंगिक हिस्से खोजता है, बजाय इसके कि सब कुछ prompt में रखा जाए।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Filesystem-Based Context Engineering

Use the filesystem as the primary overflow layer for agent context because context windows are limited while tasks often require more information than fits in a single window. Files let agents store, retrieve, and update an effectively unlimited amount of context through a single interface.

Prefer dynamic context discovery -- pulling relevant context on demand -- over static inclusion, because static context consumes tokens regardless of relevance and crowds out space for task-specific information.

When to Activate

Activate this skill when:

  • Tool outputs are bloating the context window
  • Agents need to persist state across long trajectories
  • Sub-agents must share information without direct message passing
  • Tasks require more context than fits in the window
  • Building agents that learn and update their own instructions
  • Implementing scratch pads for intermediate results
  • Terminal outputs or logs need to be accessible to agents

Do not activate this skill for adjacent work owned by other skills:

  • Semantic cross-session memory, entity tracking, or temporal knowledge graphs: memory-systems.
  • Conversation summarization, compaction, or durable handoff wording: context-compression.
  • Token-efficiency tactics that do not require file-backed storage: context-optimization.
  • Multi-agent topology or handoff protocol design: multi-agent-patterns.
  • Model edits that evict content from the live window itself: self-managed-context.

Core Concepts

Diagnose context failures against these four modes, because each requires a different filesystem remedy:

  1. Missing context -- needed information is absent from the total available context. Fix by persisting tool outputs and intermediate results to files so nothing is lost.
  2. Under-retrieved context -- retrieved content fails to encapsulate what the agent needs. Fix by structuring files for targeted retrieval (grep-friendly formats, clear section headers).
  3. Over-retrieved context -- retrieved content far exceeds what is needed, wasting tokens and degrading attention. Fix by offloading bulk content to files and returning compact references.
  4. Buried context -- niche information is hidden across many files. Fix by combining glob and grep for structural search alongside semantic search for conceptual queries.

Use the filesystem as the persistent layer that addresses all four: write once, store durably, retrieve selectively.

Detailed Topics

The Static vs Dynamic Context Trade-off

Treat static context (system instructions, tool definitions, critical rules) as expensive real estate -- it consumes tokens on every turn regardless of relevance. As agents accumulate capabilities, static context grows and crowds out dynamic information.

Use dynamic context discovery instead: include only minimal static pointers (names, one-line descriptions, file paths) and load full content with search tools when relevant. This is more token-efficient and often improves response quality by reducing contradictory or irrelevant information in the window.

Accept the trade-off: dynamic discovery requires the model to recognize when it needs more context. Current frontier models handle this well, but less capable models may fail to trigger loads. When in doubt, err toward including critical safety or correctness constraints statically.

Pattern 1: Filesystem as Scratch Pad

Redirect large tool outputs to files instead of returning them directly to context, because a single web search or database query can dump thousands of tokens into message history where they persist for the entire conversation.

Write the output to a scratch file, extract a compact summary, and return a file reference. The agent then uses targeted retrieval (grep for patterns, read with line ranges) to access only what it needs.

def handle_tool_output(output: str, threshold: int = 2000) -> str:
    if len(output) < threshold:
        return output

    file_path = f"scratch/{tool_name}_{timestamp}.txt"
    write_file(file_path, output)

    key_summary = extract_summary(output, max_tokens=200)
    return f"[Output written to {file_path}. Summary: {key_summary}]"

Use grep to search the offloaded file and read_file with line ranges to retrieve targeted sections, because this preserves full output for later reference while keeping only ~100 tokens in the active context.

Pattern 2: Plan Persistence

Write plans to the filesystem be

अक्सर पूछे जाने वाले सवाल

context फ़ाइलों में क्यों रखें?

फ़ाइलों में context window से कहीं ज़्यादा जानकारी आ सकती है, और एजेंट केवल वही लोड करता है जो उसे चाहिए।

क्या यह लंबी अवधि की मेमोरी जैसा ही है?

नहीं। सत्रों के बीच की लंबी अवधि की मेमोरी अलग विषय है, जबकि यह काम के दौरान इस्तेमाल होने वाली फ़ाइलों पर केंद्रित है।

क्या पुरानी फ़ाइलें साफ़ होती हैं?

स्किल prompt के बाहर सेव context के लिए सफ़ाई नीतियों का ज़िक्र करती है।

जानकारी

लेखक का मूल विवरण

This skill should be used when agent work needs file-backed context: durable scratchpads, tool-output offloading, just-in-time discovery, cross-agent handoff files, filesystem memory, or cleanup policies for context stored outside the prompt.

repo: muratcankoylan/Agent-Skills-for-Context-Engineering

लोकप्रियता

GitHub स्टार
18k
रैंकिंग में स्थान
#10642
लाइसेंस
MIT
अपडेट की गई
11/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

context-engineering-collection

18k

यह आपके एजेंट को AI मॉडल की context window में क्या जाए, इसका प्रबंधन करने में मदद करती है, मेमोरी और टूल्स से लेकर मल्टी-एजेंट सेटअप और मूल्यांकन तक।

AI और एजेंटएजेंट

advanced-evaluation

18k

यह आपके एजेंट को सिखाती है कि दूसरे AI की मदद से AI के जवाबों को कैसे परखा जाए, स्कोरिंग, आमने-सामने तुलना और पूर्वाग्रह जाँच के साथ।

AI और एजेंटएजेंट

bdi-mental-states

18k

यह आपके एजेंट को BDI तरीके से विश्वास, लक्ष्य और योजनाओं का मॉडल बनाना सिखाती है, ताकि उसके फ़ैसले ट्रेस और समझाए जा सकें।

AI और एजेंटएजेंट

context-compression

18k

यह आपके एजेंट को लंबे AI सत्रों को ऐसे सारांशों में छोटा करने में मदद करती है जिनमें फ़ैसले, फ़ाइलें, जोखिम और अगले कदम बचे रहें।

AI और एजेंटएजेंट

मिलती-जुलती skills