Skip to content
Back to skills

Filesystem Context

ASecurity

Use the filesystem for dynamic context discovery, enabling agents to store and retrieve unlimited context on demand.

  • 7 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 3, 2026
researchpythonapidatabase

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 3, 2026

npx -y skills add mediar-ai/skillhubz --skill filesystem-context --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Filesystem Context?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Filesystem Context
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mediar-ai-filesystem-context/badge)](https://www.skillsdirectory.com/skills/mediar-ai-filesystem-context)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Filesystem-Based Context Engineering

Use the filesystem for dynamic context discovery, enabling agents to store and retrieve unlimited context on demand.

## Prerequisites

- File system access tools (read, write, grep, glob)
- Understanding of context limitations

## Instructions

### Core Insight

Files enable **dynamic context discovery**: agents pull relevant context on demand rather than carrying everything in the context window.

### Pattern 1: Scratch Pad

Write large tool outputs to files instead of returning to context.

```python
def handle_tool_output(output, threshold=2000):
    if len(output) < threshold:
        return output

    file_path = f"scratch/{tool_name}_{timestamp}.txt"
    write_file(file_path, output)

    summary = extract_summary(output, max_tokens=200)
    return f"[Output in {file_path}. Summary: {summary}]"
```

### Pattern 2: Plan Persistence

Store plans in structured format for re-reading:

```yaml
# scratch/current_plan.yaml
objective: "Refactor authentication module"
status: in_progress
steps:
  - id: 1
    description: "Audit current endpoints"
    status: completed
  - id: 2
    description: "Design new flow"
    status: in_progress
```

### Pattern 3: Sub-Agent Communication

Sub-agents write findings directly to filesystem. Coordinator reads files, bypassing message passing.

```
workspace/
  agents/
    research_agent/findings.md
    code_agent/changes.md
  coordinator/synthesis.md
```

### Pattern 4: Dynamic Skill Loading

Store skills as files. Load only when task requires them.

```
Static context: "Available: database-optimization, api-design"
Agent action: read_file("skills/database-optimization/SKILL.md")
```

### Filesystem Search Techniques

- `ls` / `list_dir`: Discover structure
- `glob`: Find files by pattern
- `grep`: Search contents
- `read_file` with ranges: Read specific lines

## Guidelines

1. Write large outputs to files; return summaries to context
2. Store plans in structured files for re-reading
3. Use sub-agent file workspaces instead of message chains
4. Load skills dynamically rather than stuffing all in system prompt
5. Combine grep/glob with semantic search

## Notes

- Models are trained to understand filesystem traversal
- Filesystem search often outperforms semantic search for code
- Implement cleanup for scratch files to prevent unbounded growth

Source: muratcankoylan/Agent-Skills-for-Context-Engineering

Files in this skill

  • manifest.json333 B
  • skill.md2.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in research →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.