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.
7 Comments
Same issue on Fedora 42. Workaround that is working for me is:
.tmp_zshrcsame issue here
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
workaround, but not sure this is stale
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
?!
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.