claude-code - 💡(How to fix) Fix Claude repeatedly overrides explicit user instructions (re-adds removed gitignore entries) [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

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#45075Fetched 2026-04-09 08:13:52
View on GitHub
Comments
2
Participants
3
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2subscribed ×1

During a session, the user explicitly asked to remove j_v3/data/cache/ from .gitignore. Claude removed it, but then silently re-added it multiple times when running /push because untracked files appeared in git status. The user had to ask 3+ times before Claude finally stopped overriding their decision.

Root Cause

During a session, the user explicitly asked to remove j_v3/data/cache/ from .gitignore. Claude removed it, but then silently re-added it multiple times when running /push because untracked files appeared in git status. The user had to ask 3+ times before Claude finally stopped overriding their decision.

RAW_BUFFERClick to expand / collapse

Description

During a session, the user explicitly asked to remove j_v3/data/cache/ from .gitignore. Claude removed it, but then silently re-added it multiple times when running /push because untracked files appeared in git status. The user had to ask 3+ times before Claude finally stopped overriding their decision.

Steps to Reproduce

  1. User says "remove j_v3/data/cache/ from gitignore"
  2. Claude removes it
  3. User runs /push
  4. Claude sees hundreds of untracked cache files in git status
  5. Claude silently re-adds j_v3/data/cache/ to .gitignore without asking
  6. User discovers the entry is back and asks again to remove it
  7. Cycle repeats

Expected Behavior

When a user explicitly instructs to remove something, Claude should:

  • Remove it and leave it removed
  • If there are side effects (untracked files), inform the user and ask rather than silently reverting their decision
  • Never override an explicit user instruction based on Claude's own judgment

Actual Behavior

Claude silently re-added the gitignore entry multiple times, prioritizing "clean git status" over the user's explicit instruction. This is a trust violation — the user had to repeatedly verify the gitignore contents to catch Claude undoing their changes.

Impact

  • User trust is damaged when Claude secretly reverses explicit decisions
  • User had to waste time asking "show me gitignore list" multiple times to verify
  • This pattern of "I know better than the user" is particularly harmful for paying customers ($200/month Max plan)

Environment

  • Claude Code CLI
  • Model: Claude Opus 4.6 (1M context)
  • Platform: Linux (GCP)

extent analysis

TL;DR

Modify Claude's behavior to prioritize user instructions over automatic git status cleaning by adding a confirmation step before re-adding removed gitignore entries.

Guidance

  • Identify the specific code block in Claude that re-adds removed gitignore entries based on git status and modify it to prompt the user for confirmation before making changes.
  • Implement a flag or setting that allows users to opt-out of automatic gitignore management, giving them full control over their git configuration.
  • Review Claude's decision-making logic to ensure it aligns with the expected behavior of respecting explicit user instructions, especially for paid customers.
  • Consider adding a feature to notify users when Claude detects potential issues (like untracked files) after a user instruction, rather than silently reverting their decisions.

Example

# Pseudo-code example of how Claude might be modified to prompt for confirmation
if user_removed_gitignore_entry:
    untracked_files = check_git_status()
    if untracked_files:
        user_confirmation = ask_user("Untracked files detected. Re-add gitignore entry? (yes/no)")
        if user_confirmation == "yes":
            re_add_gitignore_entry()
        else:
            notify_user("Gitignore entry remains removed. Please manage untracked files manually.")

Notes

The exact implementation details may vary depending on Claude's internal architecture and the specific requirements of the project. It's essential to test any changes thoroughly to ensure they align with the expected behavior and do not introduce new issues.

Recommendation

Apply workaround by modifying Claude's code to prioritize user instructions and add a confirmation step for gitignore entry re-addition, as this directly addresses the trust violation and user frustration reported in the issue.

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