filesystem-context
하는 일
이 스킬은 긴 출력, 계획, 메모를 파일에 저장하고 필요할 때만 다시 읽어서 AI의 작업 창을 깨끗하게 유지하는 방법을 보여 줍니다. 오래 걸리는 작업을 실행하거나 에이전트 사이에 작업을 주고받는 에이전트 개발자를 위한 스킬입니다.
사용하는 경우
- ✓도구 출력이나 로그가 에이전트의 컨텍스트 창을 채우고 있을 때.
- ✓에이전트가 긴 작업 동안 계획이나 임시 메모를 유지해야 할 때.
- ✓여러 에이전트가 직접 메시지 대신 파일을 통해 정보를 공유해야 할 때.
스킬 링크
https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/blob/main/skills/filesystem-context/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“긴 명령 출력은 파일에 저장하고, 필요한 부분만 읽도록 제 에이전트를 설정해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 에이전트가 결과를 파일에 쓰고, 프롬프트에 모든 것을 담아 두는 대신 필요할 때 관련 부분을 찾아보게 합니다.
기술 내용 (원본 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:
- 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.
- 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).
- 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.
- 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
자주 묻는 질문
왜 컨텍스트를 파일에 저장하나요?
파일은 컨텍스트 창보다 훨씬 많은 정보를 담을 수 있고, 에이전트는 필요한 것만 불러옵니다.
장기 메모리와 같은 것인가요?
아니요. 세션을 넘는 장기 메모리는 따로 다루고, 이 스킬은 작업 중에 쓰는 파일에 집중합니다.
오래된 파일은 정리되나요?
스킬은 프롬프트 밖에 저장된 컨텍스트를 위한 정리 정책을 언급합니다.
상세 정보
작성자의 원본 설명
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.
인기도
- GitHub 스타
- 18k
- 순위
- #10642
- 라이선스
- MIT
- 업데이트
- 2026. 10. 11.
댓글
- …
이 저장소의 다른 스킬
context-engineering-collection
18k에이전트가 AI 모델의 컨텍스트 창에 들어가는 내용을 관리하도록 돕습니다. 메모리와 도구부터 다중 에이전트 구성, 평가까지 다룹니다.
advanced-evaluation
18k에이전트가 다른 AI를 이용해 AI 답변을 평가하는 방법을 가르칩니다. 점수 매기기, 나란히 비교, 편향 점검을 포함합니다.
bdi-mental-states
18k에이전트가 BDI 방식으로 믿음, 목표, 계획을 모델링하도록 가르쳐서, 결정을 추적하고 설명할 수 있게 합니다.
context-compression
18k에이전트가 긴 AI 세션을 결정, 파일, 위험, 다음 단계를 유지한 요약으로 줄이도록 돕습니다.
비슷한 스킬
add-model-provider
394k에이전트가 안전한 설정 명령으로 새 AI 모델 제공자를 OpenClaw에 연결하고, API 키를 평문으로 두지 않으며, 실시간 테스트를 실행하도록 돕습니다.
acp-router
394k에이전트가 OpenClaw를 통해 Claude Code나 Cursor 같은 코딩 도우미에 작업을 전달해, 작업이 그 도구에서 실행되도록 돕습니다.
browser-automation
394k에이전트가 로그인, 탭, 페이지 응답이 멈췄을 때의 복구를 포함해 웹 페이지를 단계별로 조작하도록 가르칩니다.