Claude Code makes unsolicited changes and fails to remove all references when moving items

Resolved 💬 3 comments Opened Apr 16, 2026 by alanafachini Closed Apr 20, 2026

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

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗