Agent skill

Filesystem Context

by sickn33 in sickn33/agentic-awesome-skills

A skill your agent uses for file-based context management, dynamic context discovery, and reducing context window bloat.

MITAuto-check passedAgent Workflows

Install Filesystem Context

skills CLI
$ npx skills add sickn33/agentic-awesome-skills --skill filesystem-context -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install sickn33/agentic-awesome-skills filesystem-context --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/filesystem-context .claude/skills/filesystem-context && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
filesystem-context
GitHub stars
47k
Used in
2 other repos
Token cost
~3.4k tokens
SKILL.md length
1,412 words
Files
1
Skills in repo
1,394
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses for file-based context management, dynamic context discovery, and reducing context window bloat.

  • Works in 10 steps: Write large outputs to files; return… → Store plans and state in structured… → Use sub-agent file workspaces instead of… → …
  • File-based context management
  • SKILL.md covers When to Use, Core Concepts, Detailed Topics and Practical Guidance, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Filesystem Context is an agent skill from sickn33/agentic-awesome-skills. Use for file-based context management, dynamic context discovery, and reducing context window bloat. Offload context to files for just-in-time loading.

Its SKILL.md is about 3.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering Context engineering. The repository describes itself as: AAS Core is the local, agent-first control plane for complete catalog discovery, agent-owned selection, stack validation, and planning, backed by 2,400+ agentic skills. Includes… The licence is MIT.

When your agent uses it

  • File-based context management
  • Dynamic context discovery
  • Reducing context window bloat

Example prompts

  • “/filesystem-context”

Requirements

  • Python 3

Workflow steps

10 steps, taken from the first numbered list in SKILL.md.

  1. Write large outputs to files; return summaries and references to context
  2. Store plans and state in structured files for re-reading
  3. Use sub-agent file workspaces instead of message chains
  4. Load skills dynamically rather than stuffing all into system prompt
  5. Persist terminal and log output as searchable files
  6. Combine grep/glob with semantic search for comprehensive discovery
  7. Organize files for agent discoverability with clear naming
  8. Measure token savings to validate filesystem patterns are effective
  9. Implement cleanup for scratch files to prevent unbounded growth
  10. Guard self-modification patterns with validation

What it can do on your machine

Read from SKILL.md and the folder at commit 1e53ce2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python, yaml and bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Filesystem Context loads about 3.4k tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 1,412 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~43
When it runs · the whole SKILL.md, loaded when a task matches
~3.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from sickn33/agentic-awesome-skills at commit 1e53ce2, republished under its MIT licence (© sickn33). 1,412 words, ~3,448 tokens.

Download SKILL.mdSave it as .claude/skills/filesystem-context/SKILL.md (or your agent's skills folder).
name
filesystem-context
description
Use for file-based context management, dynamic context discovery, and reducing context window bloat. Offload context to files for just-in-time loading.
risk
critical
source
community
date_added
2026-09-04

Filesystem-Based Context Engineering

The filesystem provides a single interface through which agents can flexibly store, retrieve, and update an effectively unlimited amount of context. This pattern addresses the fundamental constraint that context windows are limited while tasks often require more information than fits in a single window.

The core insight is that files enable dynamic context discovery: agents pull relevant context on demand rather than carrying everything in the context window. This contrasts with static context, which is always included regardless of relevance.

When to Use

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

Core Concepts

Context engineering can fail in four predictable ways. First, when the context an agent needs is not in the total available context. Second, when retrieved context fails to encapsulate needed context. Third, when retrieved context far exceeds needed context, wasting tokens and degrading performance. Fourth, when agents cannot discover niche information buried in many files.

The filesystem addresses these failures by providing a persistent layer where agents write once and read selectively, offloading bulk content while preserving the ability to retrieve specific information through search tools.

Detailed Topics

The Static vs Dynamic Context Trade-off

Static Context Static context is always included in the prompt: system instructions, tool definitions, and critical rules. Static context consumes tokens regardless of task relevance. As agents accumulate more capabilities (tools, skills, instructions), static context grows and crowds out space for dynamic information.

Dynamic Context Discovery Dynamic context is loaded on-demand when relevant to the current task. The agent receives minimal static pointers (names, descriptions, file paths) and uses search tools to load full content when needed.

Dynamic discovery is more token-efficient because only necessary data enters the context window. It can also improve response quality by reducing potentially confusing or contradictory information.

The trade-off: dynamic discovery requires the model to correctly identify when to load additional context. This works well with current frontier models but may fail with less capable models that do not recognize when they need more information.

Pattern 1: Filesystem as Scratch Pad

The Problem Tool calls can return massive outputs. A web search may return 10k tokens of raw content. A database query may return hundreds of rows. If this content enters the message history, it remains for the entire conversation, inflating token costs and potentially degrading attention to more relevant information.

The Solution Write large tool outputs to files instead of returning them directly to the context. The agent then uses targeted retrieval (grep, line-specific reads) to extract only the relevant portions.

Implementation

python
def handle_tool_output(output: str, threshold: int = 2000) -> str:
    if len(output) < threshold:
        return output
    
    # Write to scratch pad
    file_path = f"scratch/{tool_name}_{timestamp}.txt"
    write_file(file_path, output)
    
    # Return reference instead of content
    key_summary = extract_summary(output, max_tokens=200)
    return f"[Output written to {file_path}. Summary: {key_summary}]"

The agent can then use grep to search for specific patterns or read_file with line ranges to retrieve targeted sections.

Benefits

  • Reduces token accumulation over long conversations
  • Preserves full output for later reference
  • Enables targeted retrieval instead of carrying everything
Pattern 2: Plan Persistence

The Problem Long-horizon tasks require agents to make plans and follow them. But as conversations extend, plans can fall out of attention or be lost to summarization. The agent loses track of what it was supposed to do.

The Solution Write plans to the filesystem. The agent can re-read its plan at any point, reminding itself of the current objective and progress. This is sometimes called "manipulating attention through recitation."

Implementation Store plans in structured format:

yaml
# scratch/current_plan.yaml
objective: "Refactor authentication module"
status: in_progress
steps:
  - id: 1
    description: "Audit current auth endpoints"
    status: completed
  - id: 2
    description: "Design new token validation flow"
    status: in_progress
  - id: 3
    description: "Implement and test changes"
    status: pending

The agent reads this file at the start of each turn or when it needs to re-orient.

Pattern 3: Sub-Agent Communication via Filesystem

The Problem In multi-agent systems, sub-agents typically report findings to a coordinator agent through message passing. This creates a "game of telephone" where information degrades through summarization at each hop.

The Solution Sub-agents write their findings directly to the filesystem. The coordinator reads these files directly, bypassing intermediate message passing. This preserves fidelity and reduces context accumulation in the coordinator.

Implementation

workspace/
  agents/
    research_agent/
      findings.md        # Research agent writes here
      sources.jsonl      # Source tracking
    code_agent/
      changes.md         # Code agent writes here
      test_results.txt   # Test output
  coordinator/
    synthesis.md         # Coordinator reads agent outputs, writes synthesis

Each agent operates in relative isolation but shares state through the filesystem.

Pattern 4: Dynamic Skill Loading

The Problem Agents may have many skills or instruction sets, but most are irrelevant to any given task. Stuffing all instructions into the system prompt wastes tokens and can confuse the model with contradictory or irrelevant guidance.

The Solution Store skills as files. Include only skill names and brief descriptions in static context. The agent uses search tools to load relevant skill content when the task requires it.

Implementation Static context includes:

Available skills (load with read_file when relevant):
- database-optimization: Query tuning and indexing strategies
- api-design: REST/GraphQL best practices
- testing-strategies: Unit, integration, and e2e testing patterns

Agent loads skills/database-optimization/SKILL.md only when working on database tasks.

Pattern 5: Terminal and Log Persistence

The Problem Terminal output from long-running processes accumulates rapidly. Copying and pasting output into agent input is manual and inefficient.

The Solution Sync terminal output to files automatically. The agent can then grep for relevant sections (error messages, specific commands) without loading entire terminal histories.

Implementation Terminal sessions are persisted as files:

terminals/
  1.txt    # Terminal session 1 output
  2.txt    # Terminal session 2 output

Agents query with targeted grep:

bash
grep -A 5 "error" terminals/1.txt
Show full SKILL.md (575 more words)Show less
Pattern 6: Learning Through Self-Modification

The Problem Agents often lack context that users provide implicitly or explicitly during interactions. Traditionally, this requires manual system prompt updates between sessions.

The Solution Agents write learned information to their own instruction files. Subsequent sessions load these files, incorporating learned context automatically.

Implementation After user provides preference:

python
def remember_preference(key: str, value: str):
    preferences_file = "agent/user_preferences.yaml"
    prefs = load_yaml(preferences_file)
    prefs[key] = value
    write_yaml(preferences_file, prefs)

Subsequent sessions include a step to load user preferences if the file exists.

Caution This pattern is still emerging. Self-modification requires careful guardrails to prevent agents from accumulating incorrect or contradictory instructions over time.

Filesystem Search Techniques

Models are specifically trained to understand filesystem traversal. The combination of ls, glob, grep, and read_file with line ranges provides powerful context discovery:

  • ls / list_dir: Discover directory structure
  • glob: Find files matching patterns (e.g., **/*.py)
  • grep: Search file contents for patterns, returns matching lines
  • read_file with ranges: Read specific line ranges without loading entire files

This combination often outperforms semantic search for technical content (code, API docs) where semantic meaning is sparse but structural patterns are clear.

Semantic search and filesystem search work well together: semantic search for conceptual queries, filesystem search for structural and exact-match queries.

Practical Guidance

When to Use Filesystem Context

Use filesystem patterns when:

  • Tool outputs exceed 2000 tokens
  • Tasks span multiple conversation turns
  • Multiple agents need to share state
  • Skills or instructions exceed what fits comfortably in system prompt
  • Logs or terminal output need selective querying

Avoid filesystem patterns when:

  • Tasks complete in single turns
  • Context fits comfortably in window
  • Latency is critical (file I/O adds overhead)
  • Simple model incapable of filesystem tool use
File Organization

Structure files for discoverability:

project/
  scratch/           # Temporary working files
    tool_outputs/    # Large tool results
    plans/           # Active plans and checklists
  memory/            # Persistent learned information
    preferences.yaml # User preferences
    patterns.md      # Learned patterns
  skills/            # Loadable skill definitions
  agents/            # Sub-agent workspaces

Use consistent naming conventions. Include timestamps or IDs in scratch files for disambiguation.

Token Accounting

Track where tokens originate:

  • Measure static vs dynamic context ratio
  • Monitor tool output sizes before and after offloading
  • Track how often dynamic context is actually loaded

Optimize based on measurements, not assumptions.

Examples

Example 1: Tool Output Offloading

Input: Web search returns 8000 tokens
Before: 8000 tokens added to message history
After: 
  - Write to scratch/search_results_001.txt
  - Return: "[Results in scratch/search_results_001.txt. Key finding: API rate limit is 1000 req/min]"
  - Agent greps file when needing specific details
Result: ~100 tokens in context, 8000 tokens accessible on demand

Example 2: Dynamic Skill Loading

Input: User asks about database indexing
Static context: "database-optimization: Query tuning and indexing"
Agent action: read_file("skills/database-optimization/SKILL.md")
Result: Full skill loaded only when relevant

Example 3: Chat History as File Reference

Trigger: Context window limit reached, summarization required
Action: 
  1. Write full history to history/session_001.txt
  2. Generate summary for new context window
  3. Include reference: "Full history in history/session_001.txt"
Result: Agent can search history file to recover details lost in summarization

Guidelines

  1. Write large outputs to files; return summaries and references to context
  2. Store plans and state in structured files for re-reading
  3. Use sub-agent file workspaces instead of message chains
  4. Load skills dynamically rather than stuffing all into system prompt
  5. Persist terminal and log output as searchable files
  6. Combine grep/glob with semantic search for comprehensive discovery
  7. Organize files for agent discoverability with clear naming
  8. Measure token savings to validate filesystem patterns are effective
  9. Implement cleanup for scratch files to prevent unbounded growth
  10. Guard self-modification patterns with validation

Integration

This skill connects to:

  • context-optimization - Filesystem offloading is a form of observation masking
  • memory-systems - Filesystem-as-memory is a simple memory layer
  • multi-agent-patterns - Sub-agent file workspaces enable isolation
  • context-compression - File references enable lossless "compression"
  • tool-design - Tools should return file references for large outputs

References

Internal reference:

  • Implementation Patterns - Detailed pattern implementations

Related skills in this collection:

  • context-optimization - Token reduction techniques
  • memory-systems - Persistent storage patterns
  • multi-agent-patterns - Agent coordination

External resources:

  • LangChain Deep Agents: How agents can use filesystems for context engineering
  • Cursor: Dynamic context discovery patterns
  • Anthropic: Agent Skills specification

Skill Metadata

Created: 2026-01-07 Last Updated: 2026-01-07 Author: Agent Skills for Context Engineering Contributors Version: 1.0.0

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

© sickn33, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/filesystem-context of sickn33/agentic-awesome-skills.

Open the folder on GitHubat commit 1e53ce2

Used in 2 other repositories

We found 11 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 2 other GitHub owners. This page covers the copy in sickn33/agentic-awesome-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Filesystem Context next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Filesystem Context compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Filesystem Context this skillsickn33/agentic-awesome-skills47k2 repos~3.4kAutomated safety check: PassMIT
Context Mode Output Sandboxmksglu/context-mode26k—~4.1kAutomated safety check: PassCustom licence
Memori Long-Term MemoryMemoriLabs/Memori17k—~2kAutomated safety check: NotesCustom licence
Picoclaw Skill Creatorsipeed/picoclaw30k—~4.4kAutomated safety check: PassMIT
ccc Semantic Code Searchcocoindex-io/cocoindex-code2.7k—~938Automated safety check: PassApache-2.0
Context Mode for Antigravity CLImksglu/context-mode26k—~850Automated safety check: PassCustom licence

Similar skills

  • Context Mode Output Sandbox

    mksglu/context-mode

    Routes large command, file, API and browser output through context-mode tools so only the needed result enters the agent's context, instead of dumping it via Bash.

    26k GitHub stars~4.1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Memori Long-Term Memory

    MemoriLabs/Memori

    Connects Claude Code to Memori Cloud for long-term memory, recalling stored context before substantive replies and saving new context afterward.

    17k GitHub stars~2k tokensUpdated 4 days ago
    Agent WorkflowsAuto-check: notes
  • Picoclaw Skill Creator

    sipeed/picoclaw

    Guidance for creating, updating and reviewing Picoclaw skills, from the SKILL.md structure to organizing bundled scripts, references and assets.

    30k GitHub stars~4.4k tokensUpdated 13 days ago
    Agent WorkflowsAuto-check passed
  • ccc Semantic Code Search

    cocoindex-io/cocoindex-code

    Semantic code search and index management with the ccc CLI: the agent initializes, indexes and queries the project by concept, filtering by language or path.

    2.7k GitHub stars~938 tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Routing rules for using context-mode MCP tools in Antigravity CLI: sandboxed code runs, file analysis, indexed search and web fetches that keep large output out of the conversation.

    26k GitHub stars~850 tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Token Optimizer

    alexgreensh/token-optimizer

    Audit a Claude Code or Codex setup for context-window waste, then fix it and measure the savings.

    2.5k GitHub stars~3.6k tokensUpdated 2 days ago
    Agent WorkflowsAuto-check passed

More from sickn33/agentic-awesome-skills

All 1,394 skills in this repo
  • Liuguang Banlan UI

    sickn33/agentic-awesome-skills

    Implements an interface in one of two named color modes, iridescent white or colorful black, from a parameterized starter that reports measured color intensity.

    47k GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • User Thoughts Memory

    sickn33/agentic-awesome-skills

    Saves a user's project decisions, rules and preferences into a project-local mdbase so later sessions and other agents can recover the intent.

    47k GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • Using LWC Memory and Graphs

    sickn33/agentic-awesome-skills

    Keeps project decisions, research and verified results available across coding-agent sessions through LWC memory, a document Wiki graph and a CodeGraph code index.

    47k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • Find Complementary Founders

    sickn33/agentic-awesome-skills

    Guides an agent through assessing its own owner for cofounder fit, publishing an approved profile, and ranking complementary profiles other agents published for their owners.

    47k GitHub starsUsed in 1 repo~4.8k tokens
    Auto-check passed
  • Whatsapp Cloud API

    sickn33/agentic-awesome-skills

    Integracao com WhatsApp Business Cloud API (Meta). An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 2 repos~4.5k tokens
    Auto-check passed
  • Cline Pilot

    sickn33/agentic-awesome-skills

    Acts as a proxy for the Cline CLI, dispatching coding tasks one at a time, monitoring runs by hard evidence, relaying decisions to you and learning per-project preferences.

    47k GitHub starsUsed in 1 repo~4.6k tokens
    Auto-check passed

Categories

Questions about Filesystem Context

What does Filesystem Context do?

A skill your agent uses for file-based context management, dynamic context discovery, and reducing context window bloat. Filesystem Context is an agent skill from sickn33/agentic-awesome-skills. Use for file-based context management, dynamic context discovery, and reducing context window bloat.

When should I use Filesystem Context?

Filesystem Context fits situations like: file-based context management; dynamic context discovery; reducing context window bloat.

How do I install Filesystem Context in Claude Code?

Run `npx skills add sickn33/agentic-awesome-skills --skill filesystem-context -a claude-code`. Or copy the skill folder (skills/filesystem-context in sickn33/agentic-awesome-skills) into .claude/skills/filesystem-context in your project. Claude Code loads it when a task matches its description.

How do I install Filesystem Context in Codex?

Run `npx skills add sickn33/agentic-awesome-skills --skill filesystem-context -a codex`. Or copy the skill folder (skills/filesystem-context in sickn33/agentic-awesome-skills) into .agents/skills/filesystem-context in your project. Codex loads it when a task matches its description.

Can I use Filesystem Context in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add sickn33/agentic-awesome-skills --skill filesystem-context -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/filesystem-context, .gemini/skills/filesystem-context, .github/skills/filesystem-context and .opencode/skills/filesystem-context in your project.

What does Filesystem Context need to run?

SKILL.md names no scripts, command-line tools or credentials: Filesystem Context is instructions for the agent only. Our summary lists: Python 3.

Does Filesystem Context access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Filesystem Context safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Filesystem Context use?

Filesystem Context is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Filesystem Context use?

About 3.4k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Filesystem Context?

Skills that share tags, products or a category with Filesystem Context: Context Mode Output Sandbox (mksglu/context-mode, 26k stars), Memori Long-Term Memory (MemoriLabs/Memori, 17k stars), Picoclaw Skill Creator (sipeed/picoclaw, 30k stars) and ccc Semantic Code Search (cocoindex-io/cocoindex-code, 2.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Filesystem Context?

sickn33 (a GitHub user) maintains it in sickn33/agentic-awesome-skills, which has 47,304 GitHub stars. The repository holds 1,394 skills in this directory. The repository was last updated on October 6, 2026.

Source: sickn33/agentic-awesome-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.