npx claudepluginhub hexsprite/claude-agents-mdAutomatically loads AGENTS.md files alongside CLAUDE.md for cross-tool compatibility
Claude Code plugin that loads
AGENTS.mdfiles — no per-project config needed.
Many AI coding tools use AGENTS.md for project-level instructions (Cursor, Codex, Windsurf, Continue.dev, etc.), but Claude Code only reads CLAUDE.md. This plugin bridges the gap so your cross-tool instructions just work.
/plugin marketplace add hexsprite/claude-agents-md
/plugin install agents-md@hexsprite
Then start a Claude Code session in any project with an AGENTS.md file. Done.
Or test locally from a clone:
claude --plugin-dir /path/to/claude-agents-md
[!TIP] Use
/reload-pluginsinside a running session to pick up plugin changes without restarting.
For each AGENTS.md found in your project tree, the plugin:
CLAUDE.md in the same directory containing @AGENTS.md (Claude Code's native import syntax), or prepends @AGENTS.md to an existing CLAUDE.md that doesn't already have itCLAUDE.md files before hooks fire on the first run)This means:
CLAUDE.md files take effect from the next session onward.CLAUDE.md → @AGENTS.md imports. The plugin only injects truly new files.AGENTS.md files (e.g., after a git pull) are detected and injected on your next prompt.If your project has an AGENTS.md but no CLAUDE.md:
CLAUDE.md (created by plugin, contains: @AGENTS.md)
AGENTS.md (your file, untouched)
If a CLAUDE.md already exists, the import is prepended:
@AGENTS.md
---
# Your existing CLAUDE.md content
...
[!NOTE] Generated
CLAUDE.mdfiles are real files you can edit, commit, or gitignore. The@AGENTS.mdimport is the only thing the plugin adds — you can put Claude-specific instructions below it.
| Event | When | Purpose |
|---|---|---|
| SessionStart | Session begins | Initial scan — link and inject all AGENTS.md files |
| UserPromptSubmit | Every prompt | Re-scan for new AGENTS.md files added mid-session |
A temp file tracks which AGENTS.md files have been injected this session to avoid duplicates. The scanner uses fd if available (faster), otherwise falls back to find. Both skip node_modules, .git, vendor, dist, build, .next, .cache, __pycache__, and .venv.
Drop an AGENTS.md file in your project root (or any subdirectory) and start a Claude Code session. That's it.
my-project/
├── AGENTS.md # loaded at session start
├── src/
│ └── AGENTS.md # loaded when Claude works in src/
└── lib/
├── CLAUDE.md # existing file — @AGENTS.md prepended
└── AGENTS.md
Toggle verbose mode (Ctrl+O) to see hook output:
agents-md: injected 2 new AGENTS.md file(s)
Tests drive the real Claude CLI through Bun's native Terminal (PTY) API, spawning interactive sessions and asserting that AGENTS.md content reaches Claude's context.
bun install
bun test
[!IMPORTANT] Tests spawn real Claude sessions and make API calls. Each run takes ~60s and consumes API credits.
Run a specific suite:
bun run test:session # SessionStart hook tests
bun run test:filechange # Mid-session detection tests
AGENTS.md injected at session startAGENTS.md discovered and CLAUDE.md createdCLAUDE.md gets @AGENTS.md prepended (with --- separator)AGENTS.md existsAGENTS.md created mid-session is detected on next promptAGENTS.md created mid-session is detected on next promptclaude-agents-md/
├── .claude-plugin/
│ └── plugin.json # Plugin manifest
├── hooks/
│ ├── hooks.json # SessionStart + UserPromptSubmit config
│ └── scan-agents-md.sh # Find, link, inject, deduplicate
├── tests/
│ ├── helpers.ts # PTY test harness (Bun.Terminal)
│ ├── session-start.test.ts
│ └── file-changed.test.ts
└── package.json