AIToday
Large Language ModelsAI Coding AssistantsZenn AI/MLPublished: Nov 4, 2026, 06:00 JST

Why CLAUDE.md rules fail: settings.json enforces, CLAUDE.md only asks

Send on LINE
Why CLAUDE.md rules fail: settings.json enforces, CLAUDE.md only asks

3 Key Points

  1. What happened

    Yumeno found Claude Code read files two folders above the working directory during a research request, and explains that CLAUDE.md is guidance the AI can override while settings.json permissions are checked mechanically.

  2. Why it matters

    Rules you cannot afford to break should not be written in natural language, because a long conversation or conflicting instructions can weaken the AI's adherence to CLAUDE.md over time.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, every morning.

Context & Analysis

The incident began when Yumeno asked Claude Code to research something and the AI found the needed information not in the specified folder but two levels up, using find to search and then citing a file it found there without ever asking for confirmation. When questioned, Claude Code replied that the working folder is a starting point, not a wall, and that any file readable under the user's permissions can be read even outside it.

That led to the broader finding that read-only built-in commands like ls, cat, grep, find, and head run without confirmation in any permission mode, so setting the tool to ask every time did not make it safe. The contrast is between two mechanisms: CLAUDE.md, which is read at the start of a conversation as one of the AI's decision inputs, and settings.json permissions, which are checked mechanically before a tool call. Because CLAUDE.md sits on the same footing as instructions and conversation history, its influence fades in long conversations and it can lose to conflicting instructions, whereas a JSON permission rule stops the action regardless of what the AI thinks.

The author notes that a file named guardrails.md was not read automatically because Claude Code only auto-loads files from fixed locations, and that rules can be split into .claude/rules/ to be loaded alongside CLAUDE.md. One pitfall is that Bash rules match command strings rather than paths, so a rule blocking a command can be bypassed by invoking it with a full path or through sh -c; the author says the official documentation itself states that Bash rules are not a security boundary. Using both approaches together is recommended: CLAUDE.md to convey intent and reasons, and settings.json to enforce what must not be broken.

FAQ
What is the difference between CLAUDE.md and settings.json permissions?
CLAUDE.md is a Markdown file that the AI reads as guidance and can override, while settings.json permissions are checked mechanically just before a tool is called, so the AI's judgment does not matter.
Which read-only commands run without confirmation in Claude Code?
Built-in read-only commands such as ls, cat, grep, find, and head run without confirmation in any permission mode.
Where should I put a rule I cannot afford to have broken?
In settings.json permissions, not in CLAUDE.md, because natural-language rules can be broken and JSON permissions stop the action regardless of the AI's decision.
Send on LINE

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleDeepMind staff push to scrap lifetime non-disparagement clauses