Documentation about CLAUDE.md locations, seems not quite accurate
Resolved 💬 4 comments Opened Jun 18, 2025 by Keno Closed Jun 20, 2025
The memory documentation states
Claude Code reads memories recursively: starting in the cwd, Claude Code recurses up to / and reads any CLAUDE.md or CLAUDE.local.md files it finds. This is especially convenient when working in large repositories where you run Claude Code in foo/bar/, and have memories in both foo/CLAUDE.md and foo/bar/CLAUDE.md
I took this to mean that I could put /CLAUDE.md into my container image and have it read. However, claude didn't seem to read it unless explicitly prompted. An strace showed that claude read the following:
access("/etc/claude-code/CLAUDE.md", F_OK) = -1 ENOENT (No such file or directory)
access("/root/.claude/CLAUDE.md", F_OK) = -1 ENOENT (No such file or directory)
access("/workspace/CLAUDE.md", F_OK) = -1 ENOENT (No such file or directory)
access("/workspace/CLAUDE.local.md", F_OK) = -1 ENOENT (No such file or directory)
I don't know whether it was supposed to read /CLAUDE.md or not, but it not, it would be good to adjust the docs to what the actual rules are. Also /etc/claude-code is not mentioned in the docs but should be (since it seems to be the proper place to put system instructions).
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗