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.
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.
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.
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.