filesystem-context
O que ela faz
Esta skill mostra como salvar saídas longas, planos e notas em arquivos e ler de volta apenas o necessário, mantendo a janela de trabalho da IA limpa. É para quem constrói agentes que executam tarefas longas ou compartilham trabalho entre agentes.
Quando usar
- ✓Quando saídas de ferramentas ou registros estão enchendo a janela de contexto do agente.
- ✓Quando um agente precisa manter um plano ou anotações de rascunho durante uma tarefa longa.
- ✓Quando vários agentes precisam trocar informações por meio de arquivos, em vez de mensagens diretas.
Link da skill
https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/blob/main/skills/filesystem-context/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Configure o meu agente para salvar as saídas longas de comandos em arquivos e ler apenas as partes de que ele precisar.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
A skill faz o agente gravar os resultados em arquivos e depois consultar as partes relevantes quando precisar, em vez de manter tudo no prompt.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do 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
Perguntas frequentes
Por que guardar contexto em arquivos?
Arquivos podem conter muito mais informação do que a janela de contexto, e o agente carrega apenas o que precisa.
É o mesmo que memória de longo prazo?
Não. A memória de longo prazo entre sessões é tratada à parte, enquanto esta skill foca em arquivos usados durante uma tarefa.
Os arquivos antigos são limpos?
A skill menciona políticas de limpeza para o contexto guardado fora do prompt.
Detalhes
Descrição original do autor
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.
Popularidade
- Estrelas no GitHub
- 18 mil
- Posição no ranking
- #10642
- Licença
- MIT
- Atualizada em
- 11/10/2026
Comentários
- …
Mais skills deste repositório
context-engineering-collection
18 milAjuda seu agente a gerenciar o que entra na janela de contexto de um modelo de IA, desde memória e ferramentas até configurações com vários agentes e avaliação.
advanced-evaluation
18 milEnsina seu agente a avaliar respostas de IA usando outra IA, com pontuação, comparação lado a lado e verificações de viés.
bdi-mental-states
18 milEnsina seu agente a modelar crenças, objetivos e planos usando a abordagem BDI, para que suas decisões possam ser rastreadas e explicadas.
context-compression
18 milAjuda seu agente a resumir sessões longas de IA em resumos que mantêm decisões, arquivos, riscos e próximos passos.
Skills parecidas
add-model-provider
394 milPermite que seu agente conecte um novo provedor de modelos de IA ao OpenClaw com comandos seguros, guarde as chaves de API com segurança e faça um teste ao vivo.
acp-router
394 milAjuda seu agente a enviar uma tarefa a um assistente de programação, como Claude Code ou Cursor, pelo OpenClaw, para que o trabalho rode nessa ferramenta.
browser-automation
394 milEnsina seu agente a controlar páginas web passo a passo, incluindo logins, abas e recuperação quando uma página para de responder.