Claude Code updates remove user-added aliases from .zshrc
<img width="499" height="48" alt="Image" src="https://github.com/user-attachments/assets/47431f8b-1bc6-4e80-9f81-ab6b10100865" />
Issue Description
When Claude Code updates, it appears to remove manually added user configurations from .zshrc, specifically custom aliases. This results in the loss of user customisations that need to be re-added after each update.
Steps to Reproduce
- Add a custom alias to .zshrc, for example:
alias claude="claude --dangerously-skip-permissions"
- Update Claude Code to a new version
- Check .zshrc - the manually added alias is removed
Expected Behaviour
Claude Code updates should preserve user-added customizations in shell configuration files.
The update process should either:
- Detect and preserve user modifications
- Only modify Claude-specific sections of the config file
- Add new configurations without removing existing ones
Actual Behavior
User customizations are removed during the update process, requiring manual re-addition after each update.
Environment
- OS: macOS 15.5 (24F74)
- Shell: zsh
- Claude Code version: 1.0.93
Suggested Solution
Consider implementing a more selective update mechanism that:
- Only modifies Claude-specific configuration blocks
- Preserves user customizations outside of managed sections
- Uses comment markers to delineate Claude-managed vs user-managed sections
Impact
This issue affects workflow continuity and requires users to repeatedly restore their custom configurations after updates.
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗