HOW-TO GUIDE
How to check that CLAUDE.md loaded before you rewrite a rule Claude ignored
Based on a guide by PromptMaster on DEV Community · Dec 2, 2026
You'll end with: A check of which CLAUDE.md and rule files Claude Code loaded, a hook that logs each load, and a script that flags rules that never reach Claude.
Why it's worth having: Six documented traps, from a CLAUDE.local.md that hides AGENTS.md to a rule inside an HTML comment, get caught before you reword a rule Claude never saw.
At a glance
WHO IT'S FOR
Software engineers and team leads who set up Claude Code for a repository.
LEVEL
Intermediate
COST
Free to read. Claude Code needs a paid Claude plan; the check script uses only Python.
YOU NEED
Claude Code · jq for the logging hook · Python 3 for the pre-flight script
The method, in short
- 1Run /context all and look under Memory files, then run /memory to see every instruction file location.
- 2Check the six traps: late subfolder loads, a hidden AGENTS.md, a cut-off long file, a bad @ import, an HTML comment, and /compact.
- 3Add an InstructionsLoaded hook that logs each file Claude loads, the reason, and the file that triggered it.
- 4Run the read-only pre-flight script on a repo or in CI to flag files and lines that would never load.
Read the full guide from PromptMaster on DEV Community
The post has the hook script, the settings block, and the full pre-flight script with sample output.
Credit: PromptMaster on DEV Community