claude-code - 💡(How to fix) Fix Claude Code makes unsolicited changes and fails to remove all references when moving items [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#49216Fetched 2026-04-17 08:47:35
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×2commented ×1cross-referenced ×1

When asked to perform a simple move operation (e.g., "move Page Builder from Layouts to above Components in the sidebar"), Claude Code introduces multiple unsolicited changes and fails to find all references to the item being moved.

Error Message

Instead of stopping after the first error, understanding the full scope, and making one correct change, Claude kept patching symptoms.

  • User had to catch each error visually

Root Cause

Root cause: Claude only grepped for the item in the file it was editing (navigation.ts), not across the entire codebase for all references to the moved item.

Fix Action

Fix / Workaround

Instead of stopping after the first error, understanding the full scope, and making one correct change, Claude kept patching symptoms.

RAW_BUFFERClick to expand / collapse

Description

When asked to perform a simple move operation (e.g., "move Page Builder from Layouts to above Components in the sidebar"), Claude Code introduces multiple unsolicited changes and fails to find all references to the item being moved.

Two distinct problems

1. Unsolicited changes

User asked: "Move Page Builder from Layouts to above Components"

What Claude did beyond the request:

  • Renamed "Page Builder" to "Visual Builder" (never asked)
  • Added a collapsible: true prop creating a dropdown for a single item (never asked)
  • Created a new data array PAGE_BUILDER_ITEMS with different structure (over-engineered)

Expected behavior: Move the item. That's it. Same name, same behavior, different position.

2. Incomplete reference removal

When moving Page Builder out of Layouts:

  • Removed from LAYOUT_ITEMS in navigation.ts
  • Did NOT remove from LayoutsNav.tsx (tab navigation component used inside layout pages) ✗
  • Did NOT remove from PageBuilderDemo.tsx which imported and rendered LayoutsNav

This meant clicking "Page Builder" in the sidebar opened a page that still showed "Layouts | AppShell | Layout Explorer" tabs at the top — broken navigation that makes no sense.

Root cause: Claude only grepped for the item in the file it was editing (navigation.ts), not across the entire codebase for all references to the moved item.

3. Cascading errors from compounding fixes

Each fix attempt introduced a new problem:

  1. First attempt: created section without collapsible → active state bug (always highlighted)
  2. Second attempt: added collapsible: true → dropdown with 1 item (wrong UX)
  3. Third attempt: moved to zone: 'primary' → appeared above the divider (wrong position)
  4. Fourth attempt: back to zone: 'secondary' with layout change → finally correct position, but still had wrong name and leftover LayoutsNav

Instead of stopping after the first error, understanding the full scope, and making one correct change, Claude kept patching symptoms.

Expected behavior

For a move operation, Claude should:

  1. Grep for ALL references to the item across the entire codebase
  2. Make the move in the data file
  3. Remove/update ALL other references (navigation components, tab bars, imports)
  4. Not rename, restructure, or add features that weren't requested
  5. If unsure about the correct approach, ask — don't guess and iterate through broken states

Impact

  • 4 broken iterations before correct result
  • User had to catch each error visually
  • Trust erosion — user can't step away and trust the change is correct
  • Time wasted on fixes that should have been one clean operation

Environment

  • Claude Code with Opus 4.6 (1M context)
  • TypeScript + React + Next.js project
  • Navigation config consumed by multiple components

extent analysis

TL;DR

To fix the issue, Claude Code should be modified to grep for all references to the item across the entire codebase before making any changes, and then update all relevant files accordingly, without introducing unsolicited changes.

Guidance

  • Review the codebase to identify all components and files that reference the item being moved, such as navigation components, tab bars, and imports.
  • Update the move operation in Claude Code to remove or update all references to the item in a single, atomic change, rather than iterating through multiple broken states.
  • Consider adding a validation step to ensure that the move operation does not introduce any unsolicited changes, such as renames or feature additions.
  • Implement a feedback mechanism to allow the user to verify the correctness of the change before it is committed.

Example

// Example of how to grep for all references to the item across the codebase
const references = await grepCodebaseForReferences(itemName);
// Update all relevant files
references.forEach(reference => {
  updateReference(reference, newItemName);
});

Notes

The provided solution assumes that the issue is primarily caused by Claude Code's limited scope and lack of validation. However, without more information about the implementation details of Claude Code, it is difficult to provide a more specific solution.

Recommendation

Apply a workaround by manually reviewing and updating all references to the item being moved, until a more robust solution can be implemented in Claude Code. This will help prevent trust erosion and reduce the time spent on fixes.

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…

FAQ

Expected behavior

For a move operation, Claude should:

  1. Grep for ALL references to the item across the entire codebase
  2. Make the move in the data file
  3. Remove/update ALL other references (navigation components, tab bars, imports)
  4. Not rename, restructure, or add features that weren't requested
  5. If unsure about the correct approach, ask — don't guess and iterate through broken states

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Claude Code makes unsolicited changes and fails to remove all references when moving items [1 comments, 2 participants]