Does Claude Code read AGENTS.md natively, and how do I share instructions with CLAUDE.md?
Claude Code only loads CLAUDE.md as its per-repository instruction file. Teams that also use AGENTS.md for Codex and other agents end up duplicating instructions or maintaining an extra file. The reporter asked for AGENTS.md to be read natively, either as a fallback or alongside CLAUDE.md.
Originally asked on GitHub: https://github.com/anthropics/claude-code/issues/34235
6 answers
Status: not read natively as of this thread. The issue was closed as a duplicate, and no native AGENTS.md loading was announced. A commenter checked Claude Code version 2.1.119 and reported that AGENTS.md is not read when CLAUDE.md is missing.
The approach commenters described is to keep AGENTS.md as the shared file and import it from CLAUDE.md:
@AGENTS.md # Claude Code specifics ...This avoids duplicating content. The reporter's workaround is a minimal CLAUDE.md that lists the files to read first, starting with AGENTS.md. The reporter said this works, but it means maintaining an extra file in every repo.
Other suggestions in the thread were a one-line CLAUDE.md that tells Claude to read and follow AGENTS.md at the repo root, and symlinking CLAUDE.md to AGENTS.md. The thread does not confirm that either was tested. A commenter also shared a PostToolUse hook that prints a one-time notice that AGENTS.md exists. That commenter noted it does not make Claude Code read the file natively.
Did this work for you?What a GitHub user tried on GitHub (Worked)
Kept a minimal CLAUDE.md in each repo that lists AGENTS.md, rules/repo_rules.md, DEPLOYMENT.md and .ai_context.md as files to read before acting.
Source: https://github.com/anthropics/claude-code/issues/34235 (opens external site)
Did this work for you?What @anicioalexandre tried on GitHub (Outcome unclear)
Added '@AGENTS.md' as the first line of CLAUDE.md so the shared file is imported instead of duplicated.
Source: https://github.com/anthropics/claude-code/issues/34235#issuecomment-4338608523 (opens external site)
Did this work for you?What @yurukusa tried on GitHub (Outcome unclear)
Suggested a CLAUDE.md with the single line 'Before starting work, read and follow AGENTS.md in this repository root.'
Source: https://github.com/anthropics/claude-code/issues/34235#issuecomment-4062696889 (opens external site)
Did this work for you?What @AlbertClo tried on GitHub (Outcome unclear)
Suggested symlinking CLAUDE.md to AGENTS.md so both names point to one file.
Source: https://github.com/anthropics/claude-code/issues/34235#issuecomment-4232971334 (opens external site)
Did this work for you?What @yurukusa tried on GitHub (Outcome unclear)
Wrote a PostToolUse bash hook that prints a one-time notice that AGENTS.md exists, using a /tmp marker file. The commenter said it does not make Claude Code read the file natively.
Source: https://github.com/anthropics/claude-code/issues/34235#issuecomment-4062696889 (opens external site)
Did this work for you?