Claude Code updates remove user-added aliases from .zshrc

Resolved 💬 7 comments Opened Aug 26, 2025 by MikeyZhang75 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 ↗

This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗