Token导航 LogoToken导航

Agent Skill · 研究检索

filesystem-context(文件系统上下文)

filesystem-context 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

filesystem-context 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 72,323。

总安装 188周安装 8GitHub Stars 5下载 66核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:filesystem-context(文件系统上下文)
来源仓库:https://github.com/xfstudio/skills
仓库路径:skills/filesystem-context
安装命令:
npx skills add https://github.com/xfstudio/skills --skill filesystem-context
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/xfstudio/skills --skill filesystem-context

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于查找、检索和筛选相关信息,支持关键词和任务场景定位。适合在需要快速获取候选结果时使用,提升信息收集效率。可结合来源仓库和原始 README 进一步核验具体用法。安装前建议确认权限范围、维护状态及是否触发联网或文件操作。filesystem-context 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/filesystem-context

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/xfstudio/skills --skill filesystem-context;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

filesystem-context 怎么安装?

在终端执行 npx skills add https://github.com/xfstudio/skills --skill filesystem-context。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

filesystem-context 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

filesystem-context 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/xfstudio/skills --skill filesystem-context 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

filesystem-context 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

filesystem-context 用的人多吗?

公开数据是累计安装 188 次,近一周安装 8 次,下载 66 次,GitHub 5 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

filesystem-context 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
filesystem-context

文件系统上下文 · 本页

1885执行命令未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

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 Activate

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

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:

# 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:

grep -A 5 "error" terminals/1.txt

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:

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:

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

平台分布

Codex

37.35%
按下载量换算25

Claude

31.33%
按下载量换算21

Cursor

16.62%
按下载量换算11

Gemini CLI

8.97%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/xfstudio/skills --skill filesystem-context 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills