Skip to content
BENIBIX Learn

CLAUDE_CODE_SHELL

AI⌨️ Claude CodeConfiguration

Also known as CLAUDE_CODE_SHELL=/bin/zsh

It picks bash or zsh to run Claude Code's commands.

Think of it like

It is like you pick which pen you write with. The words stay the same.

Example

Jack's Mac ships an old bash, and one script needs a newer one. He points this at the newer bash.

Why it matters

A command can act one way in bash and another in zsh. This makes the choice on purpose.

Definition

CLAUDE_CODE_SHELL picks the shell that runs Bash tool commands. It takes the path to a bash or zsh program. Other shells, such as fish, do not work. If the path is wrong, Claude Code picks one itself. It tries your own shell first, then zsh, then bash.

Example code

bash
export CLAUDE_CODE_SHELL=/opt/homebrew/bin/bash
claude
Use a newer bash than the Mac's own.
This picks the middle box.

Common mistake

Pointing it at fish. Only bash and zsh work, so Claude Code falls back to its own pick.

Key takeaways

  1. 1
    bash or zsh. A path to one.
  2. 2
    No fish. Not supported.
  3. 3
    Bad path. Picks one itself.

Compare