Claude Code for Zoxide — Workflow Guide

Written by Michael Lip · Solo founder of Zovo · $400K+ on Upwork · 100% JSS Join 50+ builders · More at zovo.one

The Setup

You are using Zoxide, the smarter cd command that learns your directory habits and lets you jump to frequently visited directories with partial matches. When working with Claude Code across multiple projects, Zoxide eliminates the need to type full paths. Claude Code can leverage Zoxide, but it defaults to cd with full paths.

What Claude Code Gets Wrong By Default

  1. Uses full cd /path/to/project commands. Claude writes complete directory paths. With Zoxide, z project jumps to the most frequently visited directory matching “project” — no full path needed.

  2. Creates aliases for common directories. Claude adds alias proj="cd ~/projects/my-project" to shell config. Zoxide learns your navigation patterns automatically — aliases are redundant when z proj already works.

  3. Uses find to locate directories. Claude runs find ~ -type d -name "project" to locate directories. Zoxide maintains its own database of visited directories and ranks them by frecency (frequency + recency).

  4. Does not set up the shell integration. Claude installs Zoxide but forgets eval "$(zoxide init zsh)" in .zshrc. Without shell integration, the z command is not available and Zoxide does not track directory visits.

The CLAUDE.md Configuration

# Zoxide Directory Navigation

## Navigation
- Tool: Zoxide (smart cd replacement)
- Command: z <partial-match> to jump to directories
- Query: zi for interactive fuzzy selection
- Shell: eval "$(zoxide init zsh)" in .zshrc

## Zoxide Rules
- Use z instead of cd for known directories
- z project → jumps to most visited dir matching "project"
- z foo bar → matches directories containing both "foo" and "bar"
- zi → interactive mode with fzf-like selection
- zoxide query --list → shows the database of tracked dirs
- Full cd still works for exact paths and new directories
- Zoxide database at ~/.local/share/zoxide/db.zo

## Conventions
- First visit to a new dir: use full cd /path/to/dir
- Subsequent visits: use z partial-name
- Multiple matches: z ranks by frecency (frequency + recency)
- Interactive disambiguation: zi when multiple matches possible
- Exclude directories: _ZO_EXCLUDE_DIRS in env
- Never delete the zoxide database without reason

Workflow Example

You want to efficiently navigate between projects during a Claude Code session. Prompt Claude Code:

“I need to check the API routes in the backend project, then update the shared types in the common package, then check the frontend. Use Zoxide for navigation between these directories.”

Claude Code should use z backend to jump to the backend project, examine the API routes, then z common to jump to the shared package, make type changes, then z frontend to navigate to the frontend — all without typing full paths, leveraging Zoxide’s frecency matching.

Common Pitfalls

  1. Zoxide not tracking directories. Claude uses z before ever visiting a directory with cd. Zoxide only tracks directories you have actually visited — the first visit must use cd /full/path or another navigation command. After that, z partial works.

  2. Shell integration order. Claude adds eval "$(zoxide init zsh)" before compinit in .zshrc. Zoxide’s shell integration should be added near the end of the shell config file, after all other PATH modifications and completions are loaded.

  3. Ambiguous partial matches. Claude uses z s which could match src/, scripts/, server/, or staging/. Use more specific fragments or multiple keywords: z src server to narrow the match. Use zi for interactive selection when unsure.