Skip to content

Commit 45bdcf3

Browse files
committed
docs(readme): clarify nested AGENTS.md injection behavior with example
Added directory tree example showing how multiple AGENTS.md files are collected and injected in hierarchical order when reading nested files. 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
1 parent b07dd22 commit 45bdcf3

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,17 @@ I believe in the right tool for the job. For your wallet's sake, use CLIProxyAPI
138138
- **Thinking Disabled Violation**: When thinking blocks exist but thinking is disabled → strips thinking blocks
139139
- **Empty Content Message**: When message has only thinking/meta blocks without actual content → injects "(interrupted)" text via filesystem
140140
- **Comment Checker**: Detects and reports unnecessary comments after code modifications. Smartly ignores valid patterns (BDD, directives, docstrings, shebangs) to keep the codebase clean from AI-generated artifacts.
141-
- **Directory AGENTS.md Injector**: Automatically injects `AGENTS.md` contents when reading files. Searches upward from the file's directory to project root, providing directory-level context to the agent. Inspired by Claude Code's CLAUDE.md feature.
141+
- **Directory AGENTS.md Injector**: Automatically injects `AGENTS.md` contents when reading files. Searches upward from the file's directory to project root, collecting **all** `AGENTS.md` files along the path hierarchy. This enables nested, directory-specific instructions:
142+
```
143+
project/
144+
├── AGENTS.md # Project-wide context
145+
├── src/
146+
│ ├── AGENTS.md # src-specific context
147+
│ └── components/
148+
│ ├── AGENTS.md # Component-specific context
149+
│ └── Button.tsx # Reading this injects ALL 3 AGENTS.md files
150+
```
151+
When reading `Button.tsx`, the hook injects contexts in order: `project/AGENTS.md``src/AGENTS.md``components/AGENTS.md`. Each directory's context is injected only once per session. Inspired by Claude Code's CLAUDE.md feature.
142152

143153
### Agents
144154
- **oracle** (`openai/gpt-5.1`): The architect. Expert in code reviews and strategy. Uses GPT-5.1 for its unmatched logic and reasoning capabilities. Inspired by AmpCode.

0 commit comments

Comments
 (0)