claude/for
Search
Subscribe
Claude CodeUpdated

How should I share project instructions between AGENTS.md and CLAUDE.md?

2.1.277+ loads AGENTS.md when no project CLAUDE.md. Import @AGENTS.md or set claude-md-and-agents-md. Bedrock/Vertex/Foundry still need the import.

From Claude Code 2.1.277+, a repo with AGENTS.md and no project CLAUDE.md / CLAUDE.local.md on the path loads AGENTS.md by default. To keep one shared file and Claude-only notes: put @AGENTS.md at the top of a sibling CLAUDE.md, or set Project instructions in /config to claude-md-and-agents-md. Native AGENTS load is not yet available on Bedrock, Vertex, or Foundry - use the import there.

TL;DR. Default is or, not and. No project CLAUDE → AGENTS. CLAUDE (or CLAUDE.local.md) present → CLAUDE only unless you @-import or switch Project instructions. Labs volume for agents.md claude.md is unmeasured (2026-09-19).

What Claude Code loads by default

CHANGELOG 2.1.277 (fetched 2026-09-19; head also lists 2.1.278):

Added AGENTS.md support: in a project with no CLAUDE.md, Claude Code reads AGENTS.md instead; change it under "Project instructions" in /config (not yet on Bedrock, Vertex or Foundry)

Official memory docs spell out the default table:

Your repository hasClaude reads
AGENTS.md, and no CLAUDE.md / CLAUDE.local.md in the working directory or aboveAGENTS.md (and .claude/AGENTS.md ancestors)
AGENTS.md plus a counting CLAUDE.md / .claude/CLAUDE.md / CLAUDE.local.mdCLAUDE.md files only (AGENTS skipped unless you change the setting)
CLAUDE.md that imports @AGENTS.mdCLAUDE content + imported AGENTS

Do not count for the “has CLAUDE” check: ~/.claude/CLAUDE.md, org managed CLAUDE.md, and .claude/rules/. Those keep loading alongside AGENTS when the default applies.

Confirm in an interactive session with a line like no CLAUDE.md found; AGENTS.md loaded: …. Direct AGENTS load is not listed under Memory files in /context or /memory. [GAP] CLI untested same-day - load-line wording cited from docs only, not reproduced live.

Version floor: v2.1.277+. Prior CHANGELOG context: 2.1.271-272 notes. Same-day catch-up: Claude Code 2.1.273-2.1.278.

Share one file without drift

Docs-only recipes:

  1. AGENTS-only repo - Commit AGENTS.md, no project CLAUDE. Upgrade to 2.1.277+. Check the load line on the next session (first session after install/upgrade may still skip native AGENTS).
  2. @AGENTS.md import (recommended for dual-file or provider fallback) - Sibling CLAUDE.md:
    @AGENTS.md
    
    ## Claude Code
    Use plan mode for changes under `src/billing/`.
    
    Claude reads the import first, then Claude-specific notes. Keeping the import does not double-read AGENTS under claude-md-and-agents-md.
  3. Always both files - /config → Project instructions → claude-md-and-agents-md. Or set user/managed settings:
    {
      "pluginConfigs": {
        "agents-md@builtin": {
          "options": { "instructionFiles": "claude-md-and-agents-md" }
        }
      }
    }
    
    Put that in ~/.claude/settings.json, a --settings file, or managed settings - ignored in project/local settings files. Other values: claude-md-or-agents-md (default), claude-md, managed-only.
  4. Symlink - ln -s AGENTS.md CLAUDE.md works on Unix if you accept Edit/Write refusing to write through the link, and Windows Admin/Developer Mode + core.symlinks checkout caveats. Prefer the @ import for Windows/clone-safe teams.
  5. Drop SessionStart hooks that print AGENTS, and word-only “please read AGENTS.md” lines. Keep @AGENTS.md if some sessions still lack native load.

Adjacent settings hygiene: /skill-doctor. Skills/plugins sync across Claude.ai ↔ Claude Code: How do I sync Claude.ai skills and plugins into Claude Code?.

When native AGENTS.md support is unavailable

CHANGELOG: not yet on Bedrock, Vertex, or Foundry. Memory docs also list sessions that never fetch feature flags (telemetry disabled / third-party providers), the first session after install/upgrade, and sessions where disableAllHooks / allowManagedHooksOnly or a disabled built-in agents-md plugin apply. In those sessions Project instructions may not appear in /config, and Claude reads CLAUDE.md only.

Fallback: always @AGENTS.md from a CLAUDE.md. Do not invent alternate flags or env vars.

Pitfalls

  • Adding CLAUDE.local.md counts and silently stops default AGENTS load - set claude-md-and-agents-md to keep both.
  • Default is or, not merge-both.
  • HN thread (item 49760187) is discourse only - not product truth.
  • AGENTS.local.md, AGENTS.override.md, and anything under .agents/ are not read as AGENTS instruction files.
  • Don’t claim native AGENTS on Bedrock/Vertex/Foundry.
  • Spec B siblings on settings behavior: readonly-git permissions, commit attribution.

FAQ

Does Claude read AGENTS.md if I already have CLAUDE.md?
Default no - CLAUDE only. Use @AGENTS.md import or Project instructions claude-md-and-agents-md.

Where do I change the setting?
/config → Project instructions, or user/managed pluginConfigs["agents-md@builtin"].options.instructionFiles. Ignored in project/local settings files.

Why isn’t AGENTS in /memory or /context?
Direct AGENTS load isn’t listed there. Look for the AGENTS.md loaded line, or ask what project instructions say.

Bedrock / Vertex / Foundry?
Native AGENTS support not available yet (CHANGELOG + docs). Import @AGENTS.md from CLAUDE.md.

Symlink or @ import?
Import preferred for Windows and clone safety. Symlink OK on Unix if you accept Edit-tool and git symlink caveats (docs).

Sources (checked 2026-09-19)

One Claude move in your inbox, every Sunday

Four minutes, tested on a real job, then back to your weekend. Free.