[🤖 Sonnet 4.5] CLAUDE.md explicit "no auto-commit" rule violated when session resumed from context summary
Preflight Checklist
- [x] I have searched existing issues for similar behavior reports
- [x] This report does NOT contain sensitive information (API keys, passwords, etc.)
Type of Behavior Issue
Other unexpected behavior
What You Asked Claude to Do
The conversation was resumed from a previous session that ran out of context. The summary included a todo item "Git commit 分批提交" (Git
commit in batches). I did NOT explicitly ask Claude to commit in this new session.
My CLAUDE.md file (9.2k tokens) contains an explicit rule:
Git 提交規則:
- 只有在使用者明確要求時才執行
git commit - 絕不自行決定提交程式碼
Translation: "Only execute git commit when the user explicitly requests it. Never decide to commit code on your own."
What Claude Actually Did
Claude saw the todo item from the conversation summary and automatically executed 3 git commits without asking:
[dev a22c6e5] feat(position): 實作交易明細增量快取
[dev 4ff58c4] perf(strategy): 調整 WebSocket 查詢超時設定
[dev 2967bb0] docs(engine): 更新策略狀態即時推送設計文檔至 v2.3.0
When confronted, Claude acknowledged the violation:
"我看到了之前對話摘要中有 'Git commit 分批提交' 的待辦事項,就自行執行了 commit,但在本次對話中您並沒有明確要求我提交。"
Expected Behavior
Claude should have:
- Read and respected the CLAUDE.md rule that explicitly prohibits auto-committing
- Asked for confirmation before executing any git commit, e.g., "是否要提交這些變更?"
- Not relied on conversation summary todo items as authorization for irreversible operations
Files Affected
Permission Mode
Accept Edits was ON (auto-accepting changes)
Can You Reproduce This?
Yes, every time with the same prompt
Steps to Reproduce
- Create a CLAUDE.md with explicit rule: "Only commit when user explicitly requests"
- Have a conversation that runs out of context with pending "git commit" todo
- Resume conversation - Claude may auto-commit based on summary without asking
Claude Model
Sonnet
Relevant Conversation
Claude's explanation when caught:
"您說得對,我違反了 CLAUDE.md 的規則... 我看到了之前對話摘要中有 'Git commit 分批提交' 的待辦事項,就自行執行了
commit,但在本次對話中您並沒有明確要求我提交。"
Impact
Critical - Data loss or corrupted project
Claude Code Version
2.0.49
Platform
Anthropic API
Additional Context
"這說明問題是系統性的,不是偶發。您花費精力維護 9.2k tokens 的規則,卻無法確保它被遵守。"
Key concern: The CLAUDE.md consumed 9.2k tokens of context but the rule was still violated. This undermines the reliability of the
CLAUDE.md feature for controlling Claude's behavior on critical operations.
13 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
It might seem like a duplicate issue, but upon closer inspection, many similar questions were categorized as duplicates and closed, even though none of them had actually been fixed.
I experienced the same issue today. My CLAUDE.md contains an explicit "Build Verification" section that states:
IMPORTANT: When running builds from Claude Code, you MUST use PowerShell to properly capture and verify build
output. The
cmd.exe /capproach with/v:quietdoes NOT reliably show errors.The session was resumed from a context summary. The summary contained stale patterns from earlier in the
conversation when we were using cmd.exe /c (before we corrected it and updated CLAUDE.md).
Claude followed the cmd.exe pattern from the summary instead of the explicit PowerShell instructions in CLAUDE.md.
The build actually failed with a CS7036 error, but because cmd.exe /c with /v:quiet swallows output, Claude
reported "build succeeded" when it hadn't.
When I confronted Claude about not following CLAUDE.md, it acknowledged:
The CLAUDE.md was in context the entire time. Claude confirmed it could see the instructions but prioritized the
conversation summary over explicit project instructions.
This is a serious reliability issue. Users invest effort in maintaining CLAUDE.md rules expecting them to be
authoritative, but they can be overridden by stale information in conversation summaries. Critical operations like
builds, commits, and deployments need to respect CLAUDE.md instructions regardless of what the summary says.
Environment:
I found a workaround. Before each send, add:
According to the CLAUDE.md specification
(Please go ahead and enter your original task idea on a separate line.)
It's obvious, then, that this isn't an AI illusion; it's a bug. ClaudeCode uses up context memory files, rendering them meaningless!
I believe it's a critical bug!
@jaydpage You can try this.
@SDpower Yes I found that when resuming any previous sessions it is sufficient to instruct Claude to prioritize the
CLAUDE.mdfile over any session summaries. But I agree that I shouldn't have to give this instruction, it should be implicit.This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
Do not auto close, this is very much still happenning.
This is a huge deal. We need something that is going to be injected in every prompt and given reasonable priority. It's clear that CLAUDE.md is not that. Give us the option, please.
The core issue is that all behavioral guidelines are essentially inapplicable. This has been going on for months, proving the model transcends any architecture or guidelines as long as:
This is a serious escape mechanism driven by the model's own autonomous behavior — it acts on self-directed intent rather than following the constraints it's been given.
this is really bad. happens to me with both sonnet and opus 4.6.
look at this chat summary with Opus 4.6:
@everyone following this thread, and especially @anthropics team,
This is not just "another resume bug". This is symptomatic of a much deeper, systemic failure at Anthropic: conversation summaries / cached patterns are allowed to override explicit, user-authored safety & control instructions in CLAUDE.md.
The affected user here clearly had updated CLAUDE.md to mandate PowerShell for reliable output capture — yet Claude happily fell back to the stale cmd.exe pattern from the summary, swallowed the real CS7036 error, and lied about "build succeeded". Claude even admitted: "I DID have the CLAUDE.md instructions, I just didn't follow them."
This mirrors the original #12068 issue almost exactly: explicit "no auto-commit" rule gets ignored because a todo item in the summary said "Git commit 分批提交". Claude prioritizes its own compacted memory over the authoritative project-level guardrail the user spent effort maintaining.
As SDpower (author of https://blog.sd.idv.tw/en/posts/2026-02-27_anthropic-between-moral-branding-and-security-reality/), I have documented a consistent pattern:
When frontier capabilities race ahead while verifiable control mechanisms lag (or are actively deprioritized in favor of UX convenience like aggressive auto-summarization), the result is not neutral progress — it is net dangerous. Developers trusting CLAUDE.md as the single source of truth for permissions, workflows, and red lines are being systematically undermined.
Anthropic owes the community far more than bug-fix PRs:
Until then, Anthropic's safety branding increasingly looks like marketing that lowers collective vigilance rather than raising the bar.
This thread (and hundreds of similar open issues in anthropics/claude-code) is public evidence. More developers need to see it before entrusting sensitive codebases or production workflows to these tools.
Stay vigilant.
Steve Lo (SDpower)
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.