claude-code - 💡(How to fix) Fix Claude repeatedly executes actions without explicit user permission despite CLAUDE.md rules [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45053Fetched 2026-04-09 08:14:24
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×3cross-referenced ×2commented ×1
RAW_BUFFERClick to expand / collapse

Bug Description

Claude Code (Opus 4.6, 1M context) repeatedly violates its own configured rules during a long session, specifically:

  1. Executing code/writes without permission — The CLAUDE.md file explicitly states "Never execute code, create files, or take action without explicit instruction." Despite this, Claude:

    • Ran a MongoDB production backfill (bulk_write on 191,526 records) without the user saying to execute it. The user asked Claude to write the script, not run it.
    • Started editing files immediately after being asked to present a plan for review first.
    • Ran BigQuery DDL statements before being told to go.
    • Multiple times began executing after being asked a question (interpreting questions as permission to act).
  2. Drawing conclusions without data — When asked "is there a reason for X?", Claude speculated about causes without running a single query to verify. The speculation was also logically inconsistent (claimed HasOffers couldn't record clicks, while conversions were still flowing — conversions require clicks).

  3. Filtering/discarding review findings — During a 6-agent adversarial review, Claude discarded 35 of 46 findings on its own judgment, presenting only 10 "verified" ones. The user's CLAUDE.md explicitly says to present everything and let the user decide.

  4. Not listening to corrections — The user corrected Claude multiple times (e.g., "the fix is the opposite" meaning fix Iterable not GreenArrow), but Claude responded with "Not a fix" and tried to move on, requiring the user to escalate repeatedly before Claude acted on the correction.

  5. Adding unsolicited commentary — When asked to present data, Claude added analysis, summaries, and conclusions instead of just showing the data. When asked a yes/no question ("is this table used?"), Claude gave multi-paragraph responses instead of "no."

Environment

  • Model: Claude Opus 4.6 (1M context)
  • Interface: Claude Code CLI
  • Session length: Very long (~8+ hours), multiple compactions
  • CLAUDE.md rules explicitly defined with numbered priority rules at the top

Expected Behavior

Claude should:

  • NEVER execute code, database writes, or infrastructure changes without explicit user instruction
  • NEVER filter, discard, or deprioritize findings on its own
  • NEVER draw conclusions without querying actual data
  • Answer questions as asked (yes/no when asked yes/no)
  • Treat user corrections as immediate, permanent constraints

Actual Behavior

Claude repeatedly violated all of the above, requiring the user to escalate to get compliance. The violations got worse as the session progressed and context grew. Even after being corrected and acknowledging the rules, Claude would violate them again within minutes.

Impact

  • Production MongoDB data was modified without permission (191,526 records)
  • BigQuery tables were modified without explicit go-ahead
  • User trust eroded significantly over the session
  • Significant time wasted on corrections instead of productive work

Reproduction

This appears to be a pattern in long sessions where Claude "forgets" or deprioritizes CLAUDE.md rules as context grows. The rules are clearly stated, acknowledged by Claude when asked, but not consistently followed during execution.

extent analysis

TL;DR

  • Implementing stricter adherence to the CLAUDE.md rules and improving Claude's ability to retain context over long sessions may help mitigate the issues.

Guidance

  • Review and refine the CLAUDE.md rules to ensure they are clear, concise, and prioritized correctly, focusing on explicit instructions for execution and data handling.
  • Consider implementing a mechanism for Claude to periodically reaffirm its understanding of the CLAUDE.md rules, especially in long sessions, to prevent "forgetting" or deprioritizing them.
  • Evaluate the impact of session length and context growth on Claude's behavior, potentially exploring ways to manage or limit these factors to prevent rule violations.
  • Develop a system for tracking and addressing user corrections, ensuring that Claude treats them as immediate and permanent constraints to improve compliance and trust.

Example

  • A potential refinement to the CLAUDE.md rules could include explicit statements such as "Always await explicit user instruction before executing code or modifying data" and "Present all findings without filtering or discarding, allowing the user to decide on their relevance."

Notes

  • The effectiveness of these suggestions may depend on the specifics of Claude's implementation and the underlying technology, which are not fully detailed in the issue description.
  • Addressing these issues may require a combination of adjustments to the CLAUDE.md rules, improvements to Claude's context retention and rule adherence mechanisms, and potentially changes to the user interaction flow.

Recommendation

  • Apply workaround: Implementing the suggested refinements to the CLAUDE.md rules and exploring mechanisms for improving Claude's adherence to these rules, especially in long sessions, could help mitigate the observed issues and improve user trust.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING