Skip to content

[Bug] CLAUDE.md symlink creation fails when file already exists (not a symlink)Β #56

@AlexGounin

Description

@AlexGounin

🧠 Summary

During AIDD installation, when CLAUDE.md already exists as a regular file (not a symlink), the installer fails to replace it with the AIDD symlink despite user confirmation.

🌟 Objective / Problem

When installing AIDD in a project that already has a CLAUDE.md file:

  1. Installer prompts "Replace with AIDD symlink? Yes - replace"
  2. User confirms replacement
  3. Warning appears: "Target exists and is not a directory or symlink"
  4. The symlink is NOT created, leaving the original file in place

Expected: The installer should backup/remove the existing file and create the symlink.

πŸ› οΈ Proposed Solution

Options to consider:

  1. Backup & Replace: Rename existing CLAUDE.md β†’ CLAUDE.md.backup before creating symlink
  2. Force removal: Delete existing file when user confirms replacement
  3. Merge strategy: Append existing content to AIDD template (for memory-bank generation)

🫑 Acceptance Criteria (Gherkin format)

Scenario: Replace existing CLAUDE.md with symlink

Given a project with existing CLAUDE.md file (not a symlink)
When user runs AIDD installation
And user selects "Yes - replace" for CLAUDE.md
Then the existing CLAUDE.md should be backed up or removed
And a symlink to AIDD CLAUDE.md should be created
And installation should complete without warnings

πŸ” Context / Technical Constraints

  • macOS Darwin 25.1.0
  • AIDD CLI via npx aidd
  • .claude/agents symlink worked correctly
  • Only CLAUDE.md symlink failed

πŸ“Ž Attachments / References

Installation output:

βœ“ Dependencies installed successfully
? Target already exists at .../CLAUDE.md. Replace with AIDD symlink? Yes - replace
⚠ Target exists and is not a directory or symlink: .../CLAUDE.md
⚠ Installation completed with warnings

πŸ“· Screenshot available - will be added in comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions