How Claude Code actually uses CLAUDE.md files
Discovered that CLAUDE.md files get passed to Claude with a disclaimer that they might not be relevant - explains why project instructions sometimes get ignored
Claude Code’s CLAUDE.md Implementation Detail
The prompt used in Claude Code to load CLAUDE.md files is:
”…IMPORTANT: this context may or may not be relevant to your tasks. You should not respond to this context or otherwise consider it in your response unless it is highly relevant to your task. Most of the time, it is not relevant.”
Ahh, so this is why CLAUDE.md files feel so inconsistent. Turns out Claude has full discretion to completely ignore them.
Amazing that Claude Code works so well given the context loading is essentially “hey if this is useful, great, but feel free to completely ignore it”
Interesting follow up in the replies about how @alwaysallison found this out by setting ANTHROPIC_BASE_URL
to a proxy and sniffing out what Claude Code actually does via tool calls.
A good lesson for deeper undestannding of the tools is to always peel back the layers in order to show me the f*#!^ing prompt