# /filesystem-context: Use files as overflow memory for agents

Source: https://trendhub.net/skills/muratcankoylan-agent-skills-for-context-engineering/filesystem-context
Skill folder: https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/tree/main/skills/filesystem-context
Pack: Agent Skills for Context Engineering (https://trendhub.net/skills/muratcankoylan-agent-skills-for-context-engineering)
Works with: Claude Code (plugin marketplace), Cursor, Codex, Claude Code (single skill copy)

This skill makes the filesystem the agent's extra memory. Large tool outputs go to scratch files with a short summary in context, plans live in a structured file the agent re-reads, sub-agents write findings to their own folders, skills and logs load on demand, and grep and line-range reads fetch only what is needed.

## When to use it

- Search results or logs are flooding the context window.
- A long task loses its plan after a few rounds of summarization.
- Several sub-agents need to share findings without passing long messages.

## How it works

1. **Classify the failure**: Decides whether context is missing, under-retrieved, over-retrieved or buried, since each needs a different file-based fix.
2. **Offload outputs**: Writes tool results above about 2,000 tokens to a scratch file and returns a reference with a short summary.
3. **Persist plans and findings**: Keeps the plan in a YAML file re-read each turn and gives every sub-agent its own workspace directory.
4. **Retrieve selectively**: Combines listing, glob, grep and ranged reads for exact matches, and adds semantic search for conceptual questions.
5. **Clean up**: Applies retention rules to scratch files and checks that cached paths still exist before reading them.

## What it steers the agent away from

- Reading a huge file into context without checking its size.
- Concurrent agents overwriting the same file.
- Scratch folders growing without any cleanup.

## What it can touch

Guides the agent to create, search and prune scratch, plan and log files in your project.

## Pairs well with

- `/context-compression`
- `/memory-systems`
- `/multi-agent-patterns`

## Questions

### When is it not worth it?

For single-turn tasks, contexts that already fit comfortably, latency-critical work or models without file tools.

### Can agents learn by editing their own instruction files?

The skill describes it but calls it experimental and asks for validation and periodic review of what gets saved.
