Skip to content

Build Not yet confirmed elsewhere1 publisher 2 min read Published

Adding a CLAUDE.local.md to a repo quietly stops Claude Code from reading its AGENTS.md

OpenCode, Copilot CLI and Claude Code read instruction files meant for other agents, a dev.to guide reports. A rule can load from a file you never edited, or not load at all, so the loaded-file list comes before any prompt rewrite.

The Engineer · Build desk

How we use AI Send a correction

Illustration accompanying Adding a CLAUDE.local.md to a repo quietly stops Claude Code from reading its AGENTS.md
Generated illustration
An untracked file can change what Claude loads Which instruction file Claude Code reads. The story's size and retention limits don't decide which file loads, so a chart of them would mislead.

Claude Code reads AGENTS.md by default only if no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md is on the path. An untracked CLAUDE.local.md can change what loads on one machine, repo unchanged. The InstructionsLoaded hook skips an AGENTS.md Claude reads directly.

An untracked file can change what Claude loads
WhoHowKindClaim
Claude CodeReads AGENTS.md by default only when no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md is on the pathconstraint4
Untracked CLAUDE.local.mdCan change which files Claude loads on one developer's machine while the committed repo stays unchangedexposure18
InstructionsLoaded hookLogs which instruction files loaded and why, but skips an AGENTS.md that Claude reads directlyconstraint9

What happened

  • OpenCode loads ~/.claude/CLAUDE.md as its global rules when no ~/.config/opencode/AGENTS.md exists, according to OpenCode's own rules docs.
  • GitHub Copilot CLI reads AGENTS.md, CLAUDE.md and GEMINI.md from the repo and combines them.
  • Claude Code has read AGENTS.md since v2.1.277, but by default only when no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md is on the path.
  • Codex takes at most one instruction file per directory, trying AGENTS.override.md, then AGENTS.md, then any names in project_doc_fallback_filenames.

Why it matters

  • exposure A gitignored CLAUDE.local.md lets one developer's Claude skip the team's AGENTS.md while the committed repo looks unchanged.
  • constraint A repo with different text in AGENTS.md and CLAUDE.md cannot predict from the docs which rule Copilot CLI follows, because no precedence is defined.
  • decision Debugging a missed rule starts with the loaded-file list. In Claude Code, /context shows what loaded at launch and /memory opens it.
  • exposure Pasting a Claude Code transcript into a bug report can publish a .env value the agent read, since transcripts are plaintext.

Claude Code is the one agent whose merge order the guide spells out. Each project instruction file is appended to the others, and none replaces another. The one nearest your launch directory is read last. The set includes a gitignored `CLAUDE.local.md`. Files in subdirectories load on demand [6].

Codex has a different failure. It walks from the project root down to your working directory and stops adding files once the total reaches `project_doc_max_bytes`. The default is 32 KiB [12]. Root files go in first, so the deepest files are the first to fall past the cap [17]. The guide says anything past the cap never reaches the model [13]. In our view, the byte total is the first thing to check when Codex ignores a rule written for a subdirectory.

The audit trail has a gap. Claude Code's `InstructionsLoaded` hook logs which instruction files loaded and why, but it skips an `AGENTS.md` that Claude reads directly [9]. Auto memory has its own cutoff: only the first 200 lines or 25KB of the `MEMORY.md` index load at startup [10].

Settings are a separate stack from instructions. Claude Code layers five, with managed settings on top and `~/.claude/settings.json` at the bottom [7]. Codex loads project `.codex/` layers only when you trust the project [14]. A rule in a project's `.codex/config.toml` therefore does not load until you trust that project.

Claude Code deletes session transcripts after `cleanupPeriodDays`, 30 days by default, with exceptions the docs list [16]. A session older than that has nothing left to inspect.

All of this is one author's reading of vendor docs and repositories as of October 14, 2026 [19]. For OpenCode and Copilot CLI, the available text of the guide gives the cross-reading rules but not their file locations or logs.

What to watch

  • Whether GitHub's Copilot CLI docs add a precedence order among AGENTS.md, CLAUDE.md and GEMINI.md.
  • Whether Claude Code's InstructionsLoaded hook starts logging an AGENTS.md that Claude reads directly.
  • Any change to Claude Code's default of reading AGENTS.md only when no CLAUDE.md variant is on the path.

Clarity's read

What the record supports and how the coverage leans. The claims behind it follow.

Reality

Evidence62
Adoption
Insufficient
Hype gap−5
Incentives
Insufficient
Confidence60
Why these scores

Claim ledger

Ranked by verification strength, evidence, and original report placement.

  1. [1]

    If you have a ~/.claude/CLAUDE.md and no ~/.config/opencode/AGENTS.md, OpenCode loads your Claude file as its global rules, according to OpenCode's rules docs.

    Reported Supported Source: dev.to guide citing OpenCode rules docsView cited source
  2. [2]

    GitHub Copilot CLI reads AGENTS.md, CLAUDE.md and GEMINI.md in your repo and combines them.

    Reported SupportedView cited source
  3. [3]

    The GitHub Copilot CLI docs define no precedence between AGENTS.md, CLAUDE.md and GEMINI.md.

    Reported SupportedView cited source

Get this ledger inside ChatGPT. Ask about any of our stories and the answer brings its figure, each claim’s verdict and the sources. Free, no account.

Add to ChatGPTAdd to Claude

Sources

1 independent publisher whose own reporting we read for this story.

  1. dev.to

    1 article · October 13, 2026

    Where Claude Code, Codex, Copilot CLI and OpenCode Keep Config, Memory and Logs

Share your take

Let Clarity write the post for you.

Signed-in readers get a short post drafted on this story in the register they choose — narrative, analytical, or a direct position — editable to the last word before it goes anywhere. The share buttons at the top of this story work without an account.

Topics and entities

Follow any of these and your For You feed starts watching them — no settings page required.

Loading related stories