Preflight Checklist
Problem Statement
Claude Code's Bash tool currently uses the system's default shell rather than respecting the shell environment it was launched from.
On macOS, it uses zsh even when explicitly launched with fish, for example, losing access to PATHs, aliases, etc. It's impractical to maintain two shell environments (e.g., ensuring PATHs and ENV are identical) when one is never used interactively.
I use fish for development work in iterm but cannot change the system default via chsh because macOS system updates can fail when anything but zsh is set as the default shell (reported it to Apple years ago, no fix).
Proposed Solution
Claude Code should respect the shell environment it was launched from at the very least. When I run SHELL=/opt/homebrew/bin/fish claude, the Bash tool should use fish shell, not the system default.
Ideally, users could configure their preferred shell via a slash command. The interface could show which shell is actually being used, and commands should execute in that shell environment.
Alternative Solutions
I've tried every workaround I can think of other than chsh because it's not an option. I spent $20 on a claude code session trying to find workarounds, nothing worked.
Priority
Medium - Would be very helpful
Feature Category
Configuration and settings
Use Case Example
This came up today:
- MCP server failing, wanted to delete it, /mcp didn't give me a way
- I asked Claude to do it for me
- The bash tool could not find
claude because it was not in the PATH
- I told it to use
fish -c which worked, but it's dangerous because the root command is fish and not the actual command like rm -f
It would have "just worked" the first time with the right shell.
Additional Context
Example (launched in fish shell in iterm2):
SHELL=/opt/homebrew/bin/fish claude
╭───────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code! │
│ │
│ /help for help, /status for your current setup │
│ │
│ cwd: /Users/jspiro/Downloads │
╰───────────────────────────────────────────────────╯
> which shell
⏺ Bash(echo $SHELL)
⎿ /bin/zsh
⏺ /bin/zsh```
Preflight Checklist
Problem Statement
Claude Code's Bash tool currently uses the system's default shell rather than respecting the shell environment it was launched from.
On macOS, it uses zsh even when explicitly launched with fish, for example, losing access to PATHs, aliases, etc. It's impractical to maintain two shell environments (e.g., ensuring PATHs and ENV are identical) when one is never used interactively.
I use fish for development work in iterm but cannot change the system default via chsh because macOS system updates can fail when anything but zsh is set as the default shell (reported it to Apple years ago, no fix).
Proposed Solution
Claude Code should respect the shell environment it was launched from at the very least. When I run
SHELL=/opt/homebrew/bin/fish claude, the Bash tool should use fish shell, not the system default.Ideally, users could configure their preferred shell via a slash command. The interface could show which shell is actually being used, and commands should execute in that shell environment.
Alternative Solutions
I've tried every workaround I can think of other than
chshbecause it's not an option. I spent $20 on a claude code session trying to find workarounds, nothing worked.Priority
Medium - Would be very helpful
Feature Category
Configuration and settings
Use Case Example
This came up today:
claudebecause it was not in the PATHfish -cwhich worked, but it's dangerous because the root command isfishand not the actual command likerm -fIt would have "just worked" the first time with the right shell.
Additional Context
Example (launched in fish shell in iterm2):