Issue:
- In Bash version, new_install_manifest creates file immediately
- save_install_manifest calls remove_old_manifests_for_path
- This deletes ALL manifests for the path, including the new one
- Result: "WARNING: Failed to save installation manifest"
Solution:
- Add current_manifest_file parameter to remove_old_manifests_for_path
- Skip deletion if file matches current manifest
- Pass manifest_file to exclude it from deletion
Note: PowerShell version does not have this issue because it creates
the manifest file AFTER deleting old ones (hashtable → file conversion)
- Add Remove-OldManifestsForPath function to automatically clean old manifests
- Modify Save-InstallManifest to remove old manifests before saving new one
- Update Get-AllInstallManifests to return only latest manifest per installation path
- Apply same strategy to both Install-Claude.ps1 (PowerShell) and Install-Claude.sh (Bash)
Benefits:
- Each installation location registers only once
- Only latest version manifest is retained
- Uninstall UI shows only latest version per location
- Prevents manifest file accumulation
Changes:
- Switch from full directory replacement to incremental merge for all directories (.claude, .codex, .gemini, .qwen)
- Preserve user's custom files and folders during installation
- Add priority backup for critical config files:
- .codex/AGENTS.md
- .gemini/GEMINI.md, CLAUDE.md
- .qwen/QWEN.md
- Only overwrite files present in installation package
- Auto-cleanup empty backup folders
- Update both PowerShell and Bash installers with consistent behavior
Benefits:
- Non-destructive updates that preserve user customizations
- Safer upgrade path with automatic backup
- Better user experience during reinstallation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
**Summary:**
Applied the same selective replacement logic from Install-Claude.ps1 to Install-Claude.sh (Bash version).
**Changes:**
- Added `backup_and_replace_directory` function for folder-level operations
- Modified `install_global` to use selective replacement for .claude, .codex, .gemini, .qwen
- Modified `install_path` to use selective replacement for local folders and config directories
- Maintained `merge_directory_contents` for backward compatibility
**New Installation Flow:**
1. Backup entire existing directory to timestamped backup folder
2. Only remove items in destination that match source item names
3. Copy source items to destination
4. Preserve all other files in destination directory
**Benefits:**
- Protects user-created files and session data
- Only updates files that come from installation source
- Safer incremental updates
- Consistent behavior across PowerShell and Bash versions
**Example:**
Source: .claude/{commands, workflows, scripts}
Destination before: .claude/{commands, workflows, custom.json, .workflow/}
Destination after: .claude/{commands, workflows, scripts, custom.json, .workflow/}
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add explicit write operation protection in intelligent-tools-strategy
- Require MODE=write or MODE=auto for local codebase modifications
- Default all tools to read-only analysis mode
- Convert all Chinese text to English for consistency
- Lower Bash version requirement from 4.0 to 2.0 in Install-Claude.sh
- Align with install-remote.sh requirements
- Improve compatibility with older systems
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add .codex/Agent.md: Codex agent execution protocol
- Add .gemini/CLAUDE.md: Gemini agent execution protocol
- Update Install-Claude.ps1: Install .codex/.gemini to user profile (global) or target dir (path mode)
- Update Install-Claude.sh: Same installation support for bash
- Update intelligent-tools-strategy.md: Add MODE field definitions for Gemini/Qwen/Codex
- Update README.md: Add installation notes and workflow selection guide
- Update README_CN.md: Add Chinese version of installation notes and workflow guide
Installation behavior:
- Global mode: .codex and .gemini install to ~/.codex and ~/.gemini
- Path mode: .codex and .gemini install to <target-dir>/.codex and <target-dir>/.gemini
- Automatic backup of existing files before installation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Redirect menu prompts to stderr to prevent capture by command substitution
- Fixes issue where installation options were not visible to user
- Menu now displays correctly: "Global" and "Path" installation modes
Issue: When get_user_choice output was captured by $(command),
the menu display was suppressed because stdout was being captured.
Solution: Output all user-facing prompts to stderr (&2) while
keeping the selected value on stdout for function return.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>