claude-code - 💡(How to fix) Fix Claude Code struggles with multi-file frontend refactoring (Mega Menu implementation) [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#46930Fetched 2026-04-12 13:29:25
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
labeled ×2commented ×1

I switched from Cursor to Claude Code expecting stronger performance. However, a relatively simple task — adding a Mega Menu dropdown to a static HTML website's navbar — required 3+ failed attempts and complete reverts before I had to fall back to Cursor to fix it.

Root Cause

I switched from Cursor to Claude Code expecting stronger performance. However, a relatively simple task — adding a Mega Menu dropdown to a static HTML website's navbar — required 3+ failed attempts and complete reverts before I had to fall back to Cursor to fix it.

RAW_BUFFERClick to expand / collapse

Summary

I switched from Cursor to Claude Code expecting stronger performance. However, a relatively simple task — adding a Mega Menu dropdown to a static HTML website's navbar — required 3+ failed attempts and complete reverts before I had to fall back to Cursor to fix it.

What went wrong

Task: Add a "Products" Mega Menu to a static HTML website navbar, consolidating 3 existing nav items (美妝PIF, AI Brand Shield, GEO) into a dropdown panel with title + description per item, plus a 4th new item.

Claude Code's failures (repeated 3 times):

  1. Modified 12 HTML files unnecessarily instead of following the existing data-driven JS pattern already in the codebase
  2. Used display:none/block which blocks CSS transitions — no smooth animation possible
  3. CSS selector bug: used .nav ul instead of .nav > ul, causing styles to cascade into nested elements and flattening dropdown items into the main navbar

Each failure required a full revert.

What Cursor did differently (solved in one attempt)

  • Kept all 12 HTML files untouched
  • Centralized data in site-config.js as a productMenu object
  • Built all dropdown DOM dynamically in main.js
  • Used opacity/visibility/transform for smooth CSS animation
  • Fixed .nav ul.nav > ul correctly

Impact

Significant developer time wasted. I originally switched from Cursor to Claude Code expecting better results, but this experience damaged my confidence in the tool.

Suggestion

Claude Code should read and understand existing code architecture before making changes, rather than jumping to direct HTML/file modifications. It should recognize data-driven patterns and follow them.

extent analysis

TL;DR

Claude Code needs to improve its ability to read and understand existing code architecture before making changes to avoid unnecessary modifications and bugs.

Guidance

  • Review Claude Code's approach to handling existing code patterns, specifically data-driven JavaScript patterns, to prevent unnecessary HTML file modifications.
  • Ensure Claude Code uses the correct CSS selectors to avoid styling issues, such as using .nav > ul instead of .nav ul.
  • Consider implementing a more robust CSS animation approach, like using opacity/visibility/transform, to enable smooth transitions.
  • Evaluate Claude Code's ability to recognize and follow existing code architecture, such as centralized data storage in files like site-config.js.

Example

No specific code example is provided due to the lack of explicit code snippets in the issue.

Notes

The provided information suggests that Claude Code's issues stem from its inability to understand and adapt to the existing codebase, leading to repeated failures and wasted developer time.

Recommendation

Apply a workaround by manually reviewing and correcting Claude Code's changes to ensure they align with the existing code architecture, until Claude Code improves its ability to read and understand the codebase. This approach allows for continued use of Claude Code while mitigating its current limitations.

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