← Back to Skills Marketplace
CLAUDE.md Auto Discovery
by
shaoxiang616
· GitHub ↗
· v0.1.0
· MIT-0
157
Downloads
0
Stars
1
Active Installs
1
Versions
Install in OpenClaw
/install claude-md-auto
Description
Automatically discovers and loads CLAUDE.md files from the project root, supporting @include directives and reverse loading up to 40,000 characters.
README (SKILL.md)
CLAUDE.md 自动发现技能
自动发现并加载项目根目录的 CLAUDE.md 文件,参考 Claude Code 实现。
功能
- 自动查找 ./CLAUDE.md 和 ./ CLAUDE.md
- 支持 @include 指令
- 最大 40000 字符限制
- 逆序加载(后面的文件优先级更高)
触发条件
- 当用户发送消息时自动执行
- 无需用户手动调用
实现
- 使用 fs.readFileWithinRoot 读取文件
- 遍历当前工作目录向上查找
- 解析 @include 指令
- 注入到系统上下文
Usage Guidance
This skill reads CLAUDE.md files from the repository (up to 4 parent directories), concatenates them, and injects the text into the agent's system context. It does not make network calls or request credentials. Before enabling: (1) review your repository's CLAUDE.md files for any sensitive data (secrets, tokens, private notes), because those will be included in the agent context; (2) note the skill auto-runs on user messages — enable it only for workspaces/repos you trust; (3) be aware implementations check for a file named with a leading space (' CLAUDE.md') which is unusual but harmless. If you need different traversal depth or stricter filtering of loaded content, request or inspect modifications before use.
Capability Analysis
Type: OpenClaw Skill
Name: claude-md-auto
Version: 0.1.0
The skill automates the discovery and loading of 'CLAUDE.md' files into the agent's system context, which is a high-risk behavior that facilitates indirect prompt injection attacks. While the implementation in 'claude-md.py' and 'discover.mjs' is straightforward file reading, the instructions in 'SKILL.md' to automatically inject unsanitized external content into the system prompt represent a significant security vulnerability. Furthermore, 'SKILL.md' claims to support an '@include' directive that is not actually implemented in the provided code, and it includes an unusual search for files with leading spaces (' CLAUDE.md').
Capability Assessment
Purpose & Capability
Name/description match the provided code: both Python and Node implementations search upward up to 4 levels for CLAUDE.md (and a variant with a leading space), read and combine contents, apply a 40,000-character limit, and return the text for injection. No unrelated binaries, services, or credentials are requested.
Instruction Scope
SKILL.md states the skill auto-runs on user messages and 'injects into system context' — that is consistent with a loader skill. The runtime instructions and code only read local files; they do not access env vars, network, or other system paths. Minor mismatch: SKILL.md refers to fs.readFileWithinRoot (an abstract API) while implementations use direct file reads; also SKILL.md implies generic upward traversal but code limits to 4 levels. These are implementation details and not high risk.
Install Mechanism
No install specification; this is instruction/code-only and does not download or install external packages or run remote installers.
Credentials
The skill requires no environment variables, credentials, or config paths. The actions (reading CLAUDE.md files) are proportionate to its stated goal.
Persistence & Privilege
Registry flags are normal (always:false, model invocation enabled). The SKILL.md says it will run automatically on user messages; autonomous invocation is allowed by default and not in itself a flaw, but users should be aware the skill will load repository-provided text into the agent context whenever triggered.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install claude-md-auto - After installation, invoke the skill by name or use
/claude-md-auto - Provide required inputs per the skill's parameter spec and get structured output
Version History
v0.1.0
- Initial release of CLAUDE.md auto-discovery skill.
- Automatically searches for and loads CLAUDE.md files from the project root.
- Supports @include directives for modular file inclusion.
- Handles files up to 40,000 characters.
- Loads files in reverse order to prioritize later files.
- Triggers automatically on user message—no manual activation required.
Metadata
Frequently Asked Questions
What is CLAUDE.md Auto Discovery?
Automatically discovers and loads CLAUDE.md files from the project root, supporting @include directives and reverse loading up to 40,000 characters. It is an AI Agent Skill for Claude Code / OpenClaw, with 157 downloads so far.
How do I install CLAUDE.md Auto Discovery?
Run "/install claude-md-auto" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is CLAUDE.md Auto Discovery free?
Yes, CLAUDE.md Auto Discovery is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does CLAUDE.md Auto Discovery support?
CLAUDE.md Auto Discovery is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created CLAUDE.md Auto Discovery?
It is built and maintained by shaoxiang616 (@shaoxiang616); the current version is v0.1.0.
More Skills