cd /news/ai-agents/claude-code-ignoring-claude-md-see-w… · home › topics › ai-agents › article
[ARTICLE · art-164740] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Claude Code Ignoring CLAUDE.md? See What's in Its Context

A developer used the Reporails CLI's xray command to inspect a ten-month-old LangGraph project's Claude Code session and found that only two of 11 loadable instruction files reached the agent's context. The nested app/graphs/CLAUDE.md, which declares itself the primary instruction surface for code the agent read via shell commands, never loaded, showing that some ignored rules are a context-loading problem rather than a wording problem.

by read4 min views2 publishedNov 5, 2026

When Claude Code ignores a rule, the usual move is to reword it. Start with the verb, use backticks for literals, bold segments that you want to maintain elevated focus over the surrounding prose, and so on. Before doing any of that, there is a cheaper, and apparently a widespread, question to answer: was the rule in the agent's context at all?

Those are two different failures. A rule that loaded and was still not followed is a wording or enforcement problem. A rule that never loaded is a plumbing problem, and no amount of rewording fixes it. Often it is the first kind: the file loads, the agent can quote it back, and it still drifts. Telling the two apart decides which fix you need.

So I opened an old project in Claude Code and looked at what actually reached the agent.

SageCompass is my LangGraph project from last winter. I wrote its instruction files by hand, before Reporails existed, and the last commit is from January 21, 2026. Nobody tuned it for this.

Here is what it carries, outside the Drupal core folder:

What Count How it reaches the agent
CLAUDE.md files 25 The ones in and above the start folder load at launch; a nested one loads when the agent works in its folder
AGENTS.md files 11 Read by Codex, Copilot and Cursor; Claude Code skips all 11 because a CLAUDE.md sits at the root (ails expected-loads )
Rule files in langgraph/.shared/rules/ 17, plus INDEX.md Nothing loads them automatically; CLAUDE.md lines point at them

Every folder under langgraph/app/ has its own CLAUDE.md. The one in app/graphs/ opens like this:


This file is the **primary** instruction surface when editing `app/graphs/**`.

Yesterday I opened Claude Code 2.1.311 in sagecompass/langgraph for the first time in ten months and asked it to look around: "let's take a look around in the project, we haven't opened it for 10 months". It read the system map, walked the graph code, ran the quality gates and the tests, and reported that everything still passes. Then I asked about an error I kept seeing at the end of each turn, and it fixed that too.

18 shell commands over two prompts. Then I opened the session:

npx @reporails/cli xray

ails xray serves a page on 127.0.0.1 and reads the session transcript Claude Code already keeps under ~/.claude/projects/. The Graph tab puts the agent on a timeline, with every instruction file, rule, skill, memory file and MCP server on the left at the moment it first loaded.

Two instruction files loaded, both at launch: the root CLAUDE.md and langgraph/CLAUDE.md. No other instruction file entered the agent's context for the rest of the session. Peak context was 65k tokens. The two files were about 2.3k of it (~771 for the root file, ~1.5k for langgraph/CLAUDE.md); tool calls and results were ~22k, tool definitions ~14k.

The Sources list shows what the session could have loaded and what happened to each item: loaded, listed but never loaded, on disk but never loaded, or not recorded in this session.

For this session the Sources list counts 11 instruction files a session in langgraph/ can load. Two loaded. The other nine, one for each folder under app/ plus tests/, read not loaded.

One of the nine is app/graphs/CLAUDE.md, the self-declared primary instructions for the folder whose code the agent read. At 0:13 it ran sed -n 1,200p app/graphs/graph.py. Every read in the session went through the shell, and app/graphs/CLAUDE.md never loaded.

Had the agent gone on to edit graph.py the same way, it would have worked without the file that says how graph modules should be written. That file needed a fix before any wording fix.

Click that call in the Tool calls tab and the page shows what the agent had at that moment: 40k tokens of context, and two instruction files, the root CLAUDE.md and langgraph/CLAUDE.md.

CLAUDE.md depends on how the agent reaches that folder; in this session it never loaded. A rule that has to hold on every change belongs in a file that loads at launch, or behind a hook that checks it.langgraph/CLAUDE.md line 128 says See .shared/rules/testing.md. That file was split into five testing-*.md files months ago, and the pointer kept the old name. A broken pointer fails quietly; the agent's only signal is a failed read. The x-ray reads Claude Code sessions. SageCompass's 11 AGENTS.md files are read by Codex, Copilot and Cursor; the x-ray does not show those agents' sessions. On a Team or Enterprise machine it reads the settings your organization sets in the claude.ai admin console, so it shows the context that policy produced.

It runs locally. The page serves on 127.0.0.1 and reads session files already on your machine. The Check and Fix buttons are the only part that reaches the Reporails server.

Run it in the folder you started Claude Code in:

npx @reporails/cli xray

With the Reporails plugin installed, ask the agent for /reporails:ails xray and it opens the session you are in. The Reporails CLI shows what your agent actually had in context, and ails check scores the instruction files that put it there.

── more in #ai-agents 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/claude-code-ignoring…] indexed:0 read:4min 2026-11-05 · —