Skip to content

File Duplication Bug: Claude Code Creates Duplicate Files Causing Build Conflicts #1342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
claudebuildsapps opened this issue May 27, 2025 · 0 comments
Labels
area:core bug Something isn't working has repro platform:macos Issue specifically occurs on macOS

Comments

@claudebuildsapps
Copy link

Bug Type

File Management / Code Generation

Severity

High - Causes build failures

Description

Claude Code appears to create duplicate files with identical names in different directories during code generation/refactoring sessions, causing Xcode build errors.

Evidence

  • Project: Points iOS app
  • Error: Multiple commands produce ModularDataExplorer.stringsdata
  • Claude Code created the same file (ModularDataExplorer.swift) in multiple locations:
    • /Points/ErrorFixes/ModularFix/ModularDataExplorer.swift
    • /Points/ErrorFixes/NuclearFix/DataExplorer/ModularDataExplorer.swift
    • /Points/ErrorFixes/DataExplorerBackup/DataExplorer/ModularDataExplorer.swift

Impact

  • Build system fails with "Multiple commands produce" error
  • Requires manual cleanup of duplicate files
  • Forces users to implement cleanup scripts
  • Breaks development workflow

Reproduction Pattern

Appears to occur during iterative fixes where Claude Code creates multiple attempts at solving the same problem, placing files in different "fix" directories without removing previous attempts.

Expected Behavior

Claude Code should either:

  1. Replace existing files rather than creating duplicates
  2. Check for existing files before creating new ones
  3. Clean up previous attempts when creating new solutions

Workaround Required

Manual cleanup script to find and remove duplicate files, clear derived data.

Environment

  • Platform: macOS
  • Project Type: iOS app (Xcode)
  • Build System: Xcode build system

Generated with Claude Code

@github-actions github-actions bot added bug Something isn't working has repro platform:macos Issue specifically occurs on macOS area:core labels May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core bug Something isn't working has repro platform:macos Issue specifically occurs on macOS
Projects
None yet
Development

No branches or pull requests

1 participant