Shell snapshot generation duplicates alias '--' causing 'alias: --: not found' error

Status Closed — duplicate
Maintainer reply None cached
Activity 3 comments · opened Sep 25, 2025 · closed Sep 29, 2025

Bug Report

Description:
Claude Code shell snapshots incorrectly duplicate the '--' delimiter in alias commands, causing bash errors.

Steps to reproduce:

  1. Have an alias in shell config like: alias -- -='cd -'
  2. Run any Claude Code command
  3. Error appears: alias: --: not found

Expected behavior:
Alias should be preserved as: alias -- -='cd -'

Actual behavior:
Claude generates: alias -- -- -='cd -' (note the duplicate --)

Environment:

  • macOS
  • Bash shell
  • Alias defined in ~/.aliases file

Workaround:
Comment out the problematic alias or use alternative syntax.

Files affected:
Shell snapshot files like: /Users/lightwing/.claude/shell-snapshots/snapshot-bash-*.sh

View original on GitHub ↗

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