Bash tool uses login shell (-l) causing unwanted output

Resolved 💬 12 comments Opened Nov 18, 2025 by bnordli Closed Jan 27, 2026

Issue

Every bash command is executed as a login shell, sourcing ~/.bash_profile / ~/.profile on each invocation. This pollutes command output with login script messages and adds unnecessary overhead.

Steps to Reproduce

  1. Add any output statement to ~/.bash_profile (e.g., echo "Login shell initialized")
  2. Execute any Bash tool command through Claude Code
  3. Observe the extra output from the login script

Verification

$ shopt login_shell
login_shell     on

Expected

Commands should run in non-login shells. The -l flag should not be used unless specifically needed.

Impact

  • Extraneous output in command results
  • Performance overhead from repeatedly sourcing login scripts
  • Unexpected environment modifications

View original on GitHub ↗

This issue has 12 comments on GitHub. Read the full discussion on GitHub ↗