[BUG] cannot run cd commands with zoxide installed

Resolved 💬 4 comments Opened Jun 8, 2025 by saravanabalagi 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

  1. install zoxide
  2. start zoxide using eval "$(zoxide init --cmd cd zsh)" in .zshrc
  3. run claude and make it run any cd command

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' or uv run --directory somedir which succeeds

View original on GitHub ↗

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