Shell snapshot doesn't capture zoxide dependency functions, breaking cd alias
Description
When a user has zoxide configured with alias cd="z" in their .zshrc, Claude Code's shell snapshot mechanism captures the
z function but not the underlying __zoxide_* functions it depends on. This causes cd commands to fail with:
z:1: command not found: __zoxide_z
Steps to Reproduce
- Have zoxide installed and configured in .zshrc:
alias cd="z"
eval "$(zoxide init zsh)"
- Start a Claude Code session
- Run any command with cd
Expected Behavior
cd should work normally, either by:
- Capturing all zoxide functions (z, __zoxide_z, __zoxide_cd, __zoxide_pwd, __zoxide_hook) together
- Or falling back to builtin cd if dependencies are missing
Actual Behavior
The shell snapshot captures z but not __zoxide_z, so the alias chain breaks.
Diagnostic Info
$ type z
z is a shell function from /Users/.../shell-snapshots/snapshot-zsh-....sh
$ whence -f z
z () { __zoxide_z "$@" }
$ type __zoxide_z
__zoxide_z not found
Workarounds
- Use builtin cd instead of cd
- Re-initialize zoxide: eval "$(zoxide init zsh)" && cd ...
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗