'!' (bash mode) runs a non-interactive shell — ~/.zshrc not sourced, aliases not expanded
Resolved 💬 3 comments Opened Feb 21, 2026 by sethfri Closed Feb 25, 2026
Description
When using bash mode via ! in Claude Code, the shell is non-interactive. This has two consequences:
~/.zshrcis not sourced (it is only loaded by interactive shells).- Alias expansion is disabled — aliases defined in
~/.zshrc(or anywhere) do not work.
Steps to Reproduce
Define an alias in ~/.zshrc:
alias gst="git status"
Then in Claude Code bash mode:
! gst
# => command not found: gst
Expected Behavior
! mode feels like an interactive shell to the user. It should either:
- Launch a proper interactive shell (sourcing
~/.zshrc, enabling alias expansion), or - Document that it is non-interactive and aliases will not work.
Environment
- macOS (zsh)
- Claude Code CLI
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗