Skip to content
BENIBIX Learn

CLAUDE_CODE_SHELL vs CLAUDE_CODE_SHELL_PREFIX

People think the prefix picks the shell, since the names are so close. It does not. CLAUDE_CODE_SHELL picks bash or zsh to run each command. The prefix names your own program that wraps that shell, most often to log what runs. You can set one, the other or both.

AI⌨️ Claude Code

CLAUDE_CODE_SHELL

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

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
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.
Full entry
AI⌨️ Claude Code

CLAUDE_CODE_SHELL_PREFIX

It wraps each shell command in a tool of yours, often a log.

CLAUDE_CODE_SHELL_PREFIX names a program that wraps each shell command Claude Code starts. That covers Bash tool calls, hooks, the status line and the start of local MCP servers. The program gets the whole command as one value in $1. It must run it again, for example with exec bash -c "$1". It is mostly used to log or check commands.

Example
Lucy's team must keep a record of each command an AI runs. She points this at a small logger script.
Why it matters
It gives one place to see, log or block each command. The commands stay the same.
Full entry

In one line

CLAUDE_CODE_SHELL
It picks bash or zsh to run Claude Code's commands.
CLAUDE_CODE_SHELL_PREFIX
It wraps each shell command in a tool of yours, often a log.