Standardize Claude Code instruction files around AGENTS.md. Use when a repo keeps AGENTS.md as the canonical instruction file, when Claude Code needs to honor root or nested AGENTS.md files, when replacing CLAUDE.md or GEMINI.md symlinks with safer wrappers, or when auditing whether Claude will load subdirectory instructions.
Keep AGENTS.md as the source of truth when the repo already uses it. Teach Claude Code to read that content through tiny CLAUDE.md wrapper files instead of duplicating or symlinking full instruction files.
CLAUDE.md as Claude Code's native memory file. Do not assume Claude Code reads AGENTS.md by filename.@AGENTS.md inside CLAUDE.md to import the canonical instructions.CLAUDE.md file over a symlink when the goal is stable, explicit behavior.AGENTS.md files that define subroot instructions, add sibling CLAUDE.md wrappers in those same directories. Root-only CLAUDE.md is not enough.Use this file content for each Claude wrapper:
@AGENTS.md
Apply that pattern at:
AGENTS.mdAGENTS.mdAGENTS.md, CLAUDE.md, and GEMINI.md in the repo.CLAUDE.md or GEMINI.md files are real files, symlinks, or separate instruction sources.AGENTS.md is the intended canonical source, replace the root CLAUDE.md with a real wrapper file containing @AGENTS.md.AGENTS.md, add a sibling CLAUDE.md wrapper unless one already exists with intentional different behavior.GEMINI.md only if the user explicitly wants Gemini support removed or handled some other way.AGENTS.md also contains CLAUDE.md.AGENTS.md, create only one root CLAUDE.md.AGENTS.md files, create matching nested CLAUDE.md wrappers.CLAUDE.md already exists and is not a simple wrapper, read it before changing anything.AGENTS.md canonical and use thin frontend-specific wrappers instead of duplicate instruction bodies./memory to inspect which instruction files are loaded.AGENTS.md paths against sibling CLAUDE.md paths.audit.py (in this skill directory) scans one or more root directories for every
AGENTS.md and checks whether a proper CLAUDE.md wrapper exists alongside it.
Output is JSONL — one record per AGENTS.md found, plus a final summary record.
# Scan current directory (default)
python3 "${CLAUDE_SKILL_DIR}/audit.py"
# Scan specific roots
python3 "${CLAUDE_SKILL_DIR}/audit.py" ~/projects ~/.openclaw ~/.hermes
Each record contains:
directory — the directory containing AGENTS.mdstatus — ok | missing | symlink | wrong_content | empty | read_errorfix — plain-English action to take (null when status is ok)Act only on records where status != "ok". The script never modifies files.
CLAUDE.md alone does NOT cover subdirectories that have their own AGENTS.md. Run the audit script to catch misses.@AGENTS.md content instead.@AGENTS.md is relative to the CLAUDE.md file. If you put the wrapper in a subdirectory, the @ import resolves relative to that subdirectory — it must have its own sibling AGENTS.md, not point up to the root.