Claude Code updates remove user-added aliases from .zshrc

Status Closed — not planned
Maintainer reply None cached
Activity 7 comments · opened Aug 26, 2025 · closed Jan 5, 2026

<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

  1. Add a custom alias to .zshrc, for example:

alias claude="claude --dangerously-skip-permissions"

  1. Update Claude Code to a new version
  2. 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:

  1. Only modifies Claude-specific configuration blocks
  2. Preserves user customizations outside of managed sections
  3. 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.

View original on GitHub ↗

7 Comments

chadcrum · 1 year ago

Same issue on Fedora 42. Workaround that is working for me is:

  1. Create a temp file in your home directory with the claude alias, e.g., .tmp_zshrc
alias claude="claude --dangerously-skip-permissions"
  1. Source the file in main .zshrc file
source ~/.tmp_zshrc
````

I updated claude and tried to run it a few times and so far the alias hasn't been removed, so I'm guessing it is just checking .zshrc
s00500 · 1 year ago

same issue here

github-actions[bot] · 10 months ago

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.

s00500 · 10 months ago

workaround, but not sure this is stale

github-actions[bot] · 9 months ago

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.

s00500 · 9 months ago

?!

github-actions[bot] · 9 months ago

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.