filesystem-context

Offload large tool outputs and agent plans to filesystem files for context management.

Updated Jul 10, 2026
One-click install
npx skills add https://github.com/CodeCrafterAdi2006/Ink-and-Code --skill filesystem-context-codecrafteradi2006
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: filesystem-context
Source: https://github.com/CodeCrafterAdi2006/Ink-and-Code/tree/main/Skills/FileSystem_Context
Command: npx skills add https://github.com/CodeCrafterAdi2006/Ink-and-Code --skill filesystem-context-codecrafteradi2006

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? LLM agents lose critical information when tool outputs bloat the context window, plans get summarized away, and sub-agents degrade information through message-passing chains. This Skill provides file-backed context patterns so agents persist, retrieve, and share context through the filesystem instead of the prompt. ## Core Features & Use Cases - Scratch Pad Offloading: Automatically detect tool outputs exceeding a token threshold, write them to timestamped scratch files, and return compact references with summaries. - Plan Persistence: Save structured multi-step agent plans as JSON on disk so agents can reload objectives and progress after context refreshes or summarization. - Sub-Agent Workspaces & Dynamic Skill Loading: Route sub-agent findings through per-agent file directories and load full skill definitions on demand instead of stuffing the system prompt. - Use Case: A research agent receives an 8000-token web search result; the ToolOutputHandler writes it to a scratch file and returns a ~100-token reference, which the agent later greps for specific details. ## Quick Start Ask the agent to offload any tool output over 2000 tokens to a scratch file and persist the current task plan to disk so it survives context refreshes.

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 from an LLM context window?

Write the output to a timestamped scratch file and return a compact reference with a summary instead of the full content. The ScratchPadManager estimates tokens at roughly 4 characters per token and offloads anything above a configurable threshold, defaulting to 2000 tokens.

How to persist an agent plan across context window refreshes?

Serialize the plan as structured JSON or YAML to disk with objective, step statuses, and notes, then reload it at the start of each turn. The AgentPlan class provides save, load, current_step, and progress_summary methods for this workflow.

When should I use filesystem context instead of keeping everything in the prompt?

Use filesystem context when tool outputs exceed roughly 2000 tokens, tasks span multiple turns, or multiple agents share state. Avoid it for single-turn tasks, latency-critical paths, or when the context already fits comfortably in the window.

Does filesystem context management require external Python packages?

No, the core implementation uses only the Python standard library: json, pathlib, datetime, shutil, and dataclasses. YAML-based plan variants in the reference patterns require PyYAML, but the main module runs dependency-free.

What are the risks of scratch pad files in multi-agent systems?

Concurrent writes to the same file can silently corrupt state, and scratch directories grow unbounded without cleanup. Enforce per-agent directory isolation, use append-only files, and run age-based cleanup at session boundaries.