Original Reddit post

If you’re on macOS and you use a non-default login shell — homebrew bash, fish, anything other than the system /bin/zsh — Claude Code’s Bash tool has been quietly ignoring it. It spawns /bin/zsh regardless of what your $SHELL actually is, which means your .bash_profile (or fish config, or whatever) is never sourced. No custom PATH, no direnv, no starship, no aliases, no completions. I spent a while debugging why some sessions felt off — commands “not found” when they’re clearly installed, things that work in my terminal failing inside Claude. Turns out the shell underneath was just… not my shell. Sharing the fix in case it helps anyone else. How to check if you’re affected Ask Claude to run this for you (or run it yourself in any session): ps -p $$ -o comm= echo “SHELL=$SHELL BASH_VERSION=$BASH_VERSION ZSH_VERSION=$ZSH_VERSION” If the process shown is /bin/zsh but the shell you actually use is something else, you have the issue. The fix (one line in settings) Edit ~/.claude/settings.json and add to the env block: { “env”: { “CLAUDE_CODE_SHELL”: “/opt/homebrew/bin/bash”, “BASH_SILENCE_DEPRECATION_WARNING”: “1” } } Adjust the path to your shell — which bash , which fish , which nu , etc. Then quit Claude Code completely and relaunch. Run the same checks. You should now see your actual shell, your real BASH_VERSION (or fish version), and $SHELL set correctly. Your normal startup files get sourced the way they would in your terminal. Why I think this matters beyond convenience When the Bash tool runs in a shell that doesn’t have your PATH or your aliases, Claude ends up retrying commands, falling back to absolute paths, wrapping things in bash -c ‘…’ , or just trying a different approach when the first one fails. Every retry costs tokens. For me, sessions feel measurably tighter after the fix — fewer “let me try another way” detours. If you’re on Apple silicon with homebrew bash specifically, you also get bash 5.3 features inside Claude (associative arrays, mapfile , globstar, ${var,}/^^ ) instead of being stuck with /bin/zsh syntax mismatches. Nice bonus. Context for the curious CLAUDE_CODE_SHELL is not documented anywhere I could find . It was mentioned in passing by a user named u/antonibertel in issue #7490 back in March 2026. Works as of Claude Code 2.1.119 — could change in future versions, so worth pinning the version you tested on. Hope this saves someone a debugging session. submitted by /u/_calo

Originally posted by u/_calo on r/ClaudeCode