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

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.
- constraint Claude Code Reads AGENTS.md by default only when no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md is on the path, claim 4
- exposure Untracked CLAUDE.local.md Can change which files Claude loads on one developer's machine while the committed repo stays unchanged, claim 18
- constraint InstructionsLoaded hook Logs which instruction files loaded and why, but skips an AGENTS.md that Claude reads directly, claim 9
| Who | How | Kind | Claim |
|---|---|---|---|
| Claude Code | Reads AGENTS.md by default only when no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md is on the path | constraint | 4 |
| Untracked CLAUDE.local.md | Can change which files Claude loads on one developer's machine while the committed repo stays unchanged | exposure | 18 |
| InstructionsLoaded hook | Logs which instruction files loaded and why, but skips an AGENTS.md that Claude reads directly | constraint | 9 |
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
Claim ledger
Ranked by verification strength, evidence, and original report placement.
- [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.
- [2]
GitHub Copilot CLI reads AGENTS.md, CLAUDE.md and GEMINI.md in your repo and combines them.
- [3]
The GitHub Copilot CLI docs define no precedence between AGENTS.md, CLAUDE.md and GEMINI.md.
- [4]
Claude Code reads AGENTS.md since v2.1.277, but by default only when there is no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md on the path.
- [5]
Adding a CLAUDE.local.md to a repo that only had an AGENTS.md quietly stops Claude from reading the AGENTS.md.
- [6]
Claude Code's project instruction files are concatenated, not overridden, and the file closest to where you launched is read last. The set includes a gitignored CLAUDE.local.md. Files in subdirectories load on demand.
- [7]
Claude Code settings stack in five layers, highest first: managed settings, claude --settings, .claude/settings.local.json, .claude/settings.json, then ~/.claude/settings.json.
- [8]
Inside a Claude Code session, /context lists the memory files that loaded at launch and /memory opens them.
- [9]
The InstructionsLoaded hook logs which instruction files loaded and why in Claude Code, but it skips an AGENTS.md that Claude reads directly.
- [10]
Claude Code's auto memory sits in ~/.claude/projects/<project>/memory/ with a MEMORY.md index, and only its first 200 lines or 25KB load at startup.
- [11]
Codex takes at most one instruction file per directory: AGENTS.override.md, then AGENTS.md, then any names in project_doc_fallback_filenames.
- [12]
Codex walks from the project root down to the working directory and stops adding instruction files once the total reaches project_doc_max_bytes, 32 KiB by default.
- [13]
Anything past the project_doc_max_bytes cap never reaches the Codex model.
- [14]
Codex project .codex/ layers load only when you trust the project.
- [15]
Claude Code's docs say transcripts are plaintext and not encrypted, and if a tool reads a .env file, that value is now in the .jsonl transcript file.
- [16]
Claude Code deletes transcript files after cleanupPeriodDays, 30 days by default, with exceptions the docs list, such as sessions continued in Claude Desktop.
- [17]
Because Codex adds instruction files from the project root down and stops at the 32 KiB cap, the deepest files are added last and are the first to fall past the cap.
- [18]
One developer's untracked CLAUDE.local.md can change which instruction files Claude loads on that machine while the committed repo stays unchanged.
- [19]
Every path in the guide is from the vendor's own docs or repository as of October 14, 2026.
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.
Sources
1 independent publisher whose own reporting we read for this story.
- dev.toWhere Claude Code, Codex, Copilot CLI and OpenCode Keep Config, Memory and Logs
1 article · October 13, 2026
Topics and entities
Follow any of these and your For You feed starts watching them — no settings page required.
Topics
- Agent configurationFollow
- AI Coding AgentsFollow
- Developer tooling securityFollow