Integrations
Hash works with your existing tools. Here's how to set up popular shell integrations.
Zoxide (smart cd)
Zoxide learns which directories you visit and lets you jump to them with z. Setting it up in Hash requires two pieces: loading the z command and adding a hook so zoxide learns your directory changes.
Shortcut: run the setup-zoxide builtin inside Hash and it does all of this for you — adds the init line and alias cd="z" to ~/.hashrc, disables the built-in cd, and configures the chpwd hook. The manual steps below show what it sets up.
1. Install zoxide
2. Load the z command
Add to ~/.hashrc:
This defines the z and zi shell functions. Hash's panic recovery handles any unsupported syntax in zoxide's init script gracefully — the functions are loaded even if some statements are skipped.
3. Add the chpwd hook
Zoxide needs to know when you change directories so it can track frecency. In bash, it uses PROMPT_COMMAND, which Hash doesn't implement. Instead, Hash provides a chpwd hook that runs after every directory change:
chpwd = ["zoxide add -- \"$PWD\""]
4. Optional: alias cd to z
You do not need this for z/zi. Only do this if you prefer typing cd and want it to jump via zoxide.
disable_builtins = ["cd"]
Hash's built-in cd takes precedence, so disabling it is required for thealias cd="z" behavior to work.
5. Use it
cd ~/Documents # zoxide learns this
z my-app # jumps to ~/projects/my-app
direnv
direnv loads and unloads environment variables based on .envrc files when you change directories.
Add to ~/.hashrc:
Then add a chpwd hook to trigger direnv on directory changes:
chpwd = ["eval \"$(direnv export bash)\""]
fzf
fzf is a fuzzy finder. Hash has built-in fuzzy completion, but you can still use fzf for custom workflows.
Add to ~/.hashrc:
This sets up Ctrl+T (file finder) and Alt+C (directory jumper) keybindings. Note that Ctrl+R is handled by Hash's own history search UI, which you may prefer.
Starship
Starship is a cross-shell prompt. Hash has built-in Starship support — no eval needed.
If Starship is installed and in your PATH, Hash uses it automatically. To customize:
mode = "starship" # Default — uses starship if found
starship_path = "/opt/homebrew/bin/starship" # Explicit path (optional)
Hash also extracts your Starship color theme and uses it for the completion menu, agent UI, and other interface elements.
Combining hooks
If you use multiple tools that need directory change notifications, list them all:
chpwd = [
"zoxide add -- \"$PWD\"",
"eval \"$(direnv export bash)\"",
]
Each command runs in order after every directory change. See the Configuration Reference for full documentation on the [shell.hooks] section.