ai newsFr., 6. Nov.
EilmeldungOpenAI is stepping back from NDAs for data center projects

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

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 answ

dev.toDonnerstag 18:44 · 05.11.4 Min. Lesezeit
Bild: dev.to

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:

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

# Local scope: app/graphs This file is the **primary** instruction surface when editing `app/graphs/**`. Enter fullscreen mode Exit fullscreen mode The session 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 Enter fullscreen mode Exit fullscreen mode 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 loading 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.

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 Enter fullscreen mode Exit fullscreen mode 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.

Quelle: dev.to (dev.to). Original öffnen