Zum Inhalt springen
Skillpedia
Agenten18k · #10642

filesystem-context

Was er macht

Dieser Skill zeigt, wie du lange Ausgaben, Pläne und Notizen in Dateien speicherst und nur bei Bedarf wieder einliest, damit das Arbeitsfenster der KI frei bleibt. Er ist für Bauende von Agenten gedacht, die lange Aufgaben ausführen oder Arbeit zwischen Agenten teilen.

Wann du ihn nutzt

  • ✓Wenn Werkzeugausgaben oder Protokolle das Kontextfenster des Agenten füllen.
  • ✓Wenn ein Agent einen Plan oder Notizen über eine lange Aufgabe hinweg halten muss.
  • ✓Wenn mehrere Agenten Informationen über Dateien statt über direkte Nachrichten teilen sollen.

Link zum Skill

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

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/blob/main/skills/filesystem-context/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Richte meinen Agenten so ein, dass er lange Befehlsausgaben in Dateien speichert und nur die Teile liest, die er braucht.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Der Skill lässt den Agenten Ergebnisse in Dateien schreiben und die relevanten Teile bei Bedarf nachschlagen, statt alles im Prompt zu behalten.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von 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

Häufige Fragen

Warum Kontext in Dateien speichern?

Dateien können weit mehr Informationen aufnehmen als das Kontextfenster, und der Agent lädt nur, was er braucht.

Ist das dasselbe wie Langzeitgedächtnis?

Nein. Langzeitgedächtnis über Sitzungen hinweg ist ein eigenes Thema, hier geht es um Dateien während einer Aufgabe.

Werden alte Dateien aufgeräumt?

Der Skill erwähnt Aufräumregeln für Kontext, der außerhalb des Prompts gespeichert wird.

Details

Originalbeschreibung des Autors

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

Beliebtheit

GitHub-Sterne
18k
Platz im Ranking
#10642
Lizenz
MIT
Aktualisiert
11.10.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills