filesystem-context

Stores large tool outputs and agent state in files for on-demand retrieval.

Updated Apr 15, 2025
One-click install
npx skills add https://github.com/khrore/nix-config --skill filesystem-context-khrore
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: filesystem-context
Source: https://github.com/khrore/nix-config/tree/main/dotfiles/common/.config/opencode/skills/filesystem-context
Command: npx skills add https://github.com/khrore/nix-config --skill filesystem-context-khrore

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

The filesystem-context skill solves the problem of limited model context windows by offloading large or persistent agent state to files so agents can read relevant information on demand instead of carrying bulky data in every prompt. It prevents token bloat from long tool outputs, preserves full tool results for later inspection, and enables sub-agents to share high-fidelity findings without repeated summarization.

Core Features & Use Cases

  • Scratch pad offloading: Write large tool outputs to timestamped files and return compact references and summaries to keep the active context small.
  • Plan persistence: Store structured plans on disk so agents can re-read objectives and progress across long-horizon workflows.
  • Sub-agent workspaces: Use per-agent files for findings, status, and logs so coordinators read raw outputs directly.
  • Dynamic skill loading: Keep only skill names and short descriptions in static context and load full SKILL.md files on demand.
  • Terminal and log persistence: Persist terminal session outputs as searchable files and grep for targeted retrieval.
  • Self-modification guardrails: Validate and bound agent-written preferences and provide cleanup strategies for scratch files.
  • Use cases include large web search results, multi-agent research coordination, long-running devops tasks, and incremental code or test outputs that would otherwise overflow the context window.

Quick Start

Save the large tool output to a scratch file, return a one-line summary and the saved file path for later grep-based retrieval.

Frequently Asked Questions about filesystem-context

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I offload large tool outputs to prevent agent context window overflow?

To prevent agent context window overflow, offload large tool outputs to timestamped filesystem-backed scratch files. This returns compact references and summaries to the active context while preserving full tool results for later on-demand retrieval.

What is the best way to persist agent state for long-horizon planning and multi-agent coordination?

The best way to persist agent state for long-horizon planning is writing structured plans, status logs, and findings to per-agent files on disk. This allows coordinators and sub-agents to re-read objectives and raw outputs directly across extended workflows.

Can I use filesystem search utilities like grep and glob for agent memory retrieval?

Yes, you can use basic filesystem search utilities like grep and glob for agent memory retrieval. By persisting terminal session outputs and large tool results as searchable files, agents can grep for targeted information on demand instead of carrying bulky data.

Do I need filesystem read and write access to manage agent scratch pads and plan persistence?

Yes, you need filesystem read and write access to manage agent scratch pads and plan persistence. The approach requires basic search utilities such as ls, glob, and grep, along with structured file formats for plans, manifests, and scratch outputs.

How does dynamic skill loading keep static context small in multi-agent systems?

Dynamic skill loading keeps static context small by storing only skill names and short descriptions in the active prompt. Agents then load full SKILL.md files from the filesystem on demand, preventing token bloat from carrying bulky skill definitions.

What are the limitations of using filesystem-backed files for agent context engineering?

A limitation of filesystem-backed agent context is the need for self-modification guardrails to validate agent-written preferences. Additionally, it requires implementing cleanup strategies to manage accumulated scratch files and prevent unbounded disk usage.