[BUG] cannot run cd commands with zoxide installed
Status Fixed / completed
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 4 comments · opened Jun 8, 2025 · closed Jul 9, 2025
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [x] Other: <!-- specify --> Claude Max
- Claude CLI version: <!-- output of
claude --version--> 1.0.17 (Claude Code) - Operating System: <!-- e.g. macOS 14.3, Windows 11, Ubuntu 22.04 --> macOS 15.5
- Terminal: <!-- e.g. iTerm2, Terminal App --> Terminal App / vscode
Bug Description
<!-- A clear and concise description of the bug -->
⏺ Bash(cd somedir && uv run -m mymodule)
⎿ Error: cd:1: command not found: __zoxide_z
Steps to Reproduce
- install zoxide
- start zoxide using
eval "$(zoxide init --cmd cd zsh)"in.zshrc - run
claudeand make it run anycdcommand
Expected Behavior
<!-- What you expected to happen -->
cd commands should get executed successfully
Actual Behavior
<!-- What actually happened -->
- cd commands fails with
command not found: __zoxide_z - claude then resorts to using workarounds including
bash -c 'cmd'oruv run --directory somedirwhich succeeds
4 Comments
I'm having the same issue. Added the following workaround for now to my shell config:
I tried it, but that's not helping
Also, I have
zoxide initalready in my .zshrc that would run anyway (outside of if)To summarize, add in .zshrc
and set env var, can be done in
~/.claude/settings.jsonThis 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.