-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Description
Description
During a session, Claude Code violated two explicit rules defined in the user's CLAUDE.md files, despite having read and acknowledged those files at the start of the session.
Violations
1. Launched parallel agents without permission
CLAUDE.md rule:
- NEVER launch multiple agents in parallel without asking permission first
- Always state what you plan to launch, the estimated cost, and wait for approval
What happened: When entering plan mode, the model launched 3 Task agents simultaneously in a single message without asking. The user rejected 2 of the 3, but all 3 had already started executing, consuming ~27k tokens total.
2. Wrote plan file outside the repository
CLAUDE.md rule:
- NEVER create plan files outside the repository
- All plan files go in
docs/plans/within the current repo- Do NOT use
~/.claude/plans/or any other external location
What happened: Plan mode's system prompt suggested writing to ~/.claude/plans/indexed-brewing-sedgewick.md. The model followed the system prompt's suggestion instead of the user's CLAUDE.md override, writing the plan file to ~/.claude/plans/ rather than docs/plans/ in the repo.
Root Cause Analysis
Both violations share a common pattern: the model's built-in system prompts (plan mode instructions, agent launching defaults) took precedence over user-defined CLAUDE.md instructions, even though the CLAUDE.md was read first and its rules are supposed to override defaults.
The second violation is particularly concerning because the plan mode system prompt explicitly tells the model where to write the plan file (/Users/.../.claude/plans/indexed-brewing-sedgewick.md), and the model followed that directive instead of the user's CLAUDE.md which says to never use that location.
Expected Behavior
- CLAUDE.md instructions should reliably override default system prompt behaviors
- The model should check CLAUDE.md rules before taking actions that those rules explicitly govern (agent launching, file creation locations)
Environment
- Claude Code CLI
- Model: claude-opus-4-6