Rename `Bash` tool — it actually runs the user's login shell (zsh on macOS), not bash

Resolved 💬 1 comment Opened Apr 23, 2026 by kevin-jacobson-at-wistia Closed May 28, 2026

Summary

The Bash tool in Claude Code is named after bash but in practice launches commands in the user's configured login shell — on macOS, that's zsh by default. The tool's own description acknowledges this (\"The shell environment is initialized from the user's profile (bash or zsh)\"), but the identifier itself is never updated, which is misleading for new users and surprises experienced ones who configure hooks or permissions.

Reproduction

On a default macOS install:

# From within Claude Code's Bash tool:
echo \"ZSH_VERSION=\$ZSH_VERSION  BASH_VERSION=\$BASH_VERSION  shell=\$SHELL  ps=\$(ps -p \$\$ -o comm=)\"

Output:

ZSH_VERSION=5.9  BASH_VERSION=  shell=/bin/zsh  ps=/bin/zsh

No bash in the pipeline — it's zsh the whole way down, including .zshrc sourcing, aliases, functions, asdf/nvm, etc.

Why it matters

  • Misleading to new users. \"Bash\" implies a specific shell; the tool actually honors whatever's in $SHELL.
  • Documentation drift. Teaching materials, blog posts, and this very repo's examples all reference \"Bash commands,\" but the commands are running in zsh for most macOS users.
  • Config surface references the name. .claude/settings.json uses Bash(git *) style allow/deny rules; hooks reference it by name. Renaming is breaking, which is likely why it's stuck.

Proposal

Two options, pick one or do both:

  1. Add an alias. Register the tool under a more accurate name (Shell, Execute, or similar) while keeping Bash as a deprecated alias for backward compatibility in settings/hooks. Announce a long deprecation window.
  2. Update the description and docs to be more prominent about the behavior. At minimum, surface \"runs under your login shell (bash or zsh)\" earlier/bolder in the tool description that Claude sees, and mention it in the permissions and hooks docs.

Option 1 is the right long-term fix; option 2 is the cheap immediate improvement.

Environment

  • Claude Code 2.1.118
  • macOS 25.4.0 (Tahoe)
  • Default shell: zsh 5.9

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗