[BUG] Bash login shell
Status Fixed / completed
Maintainer reply ✓ Yes — wolffiex
Workaround ✓ Mentioned in thread ↓
Activity 9 comments · opened Dec 5, 2025 · closed Apr 18, 2026
💡 Likely answer: A maintainer (wolffiex, collaborator)
responded on this thread — see the highlighted reply below.
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
$ cat ~/.claude/settings.json
{
"alwaysThinkingEnabled": false,
"env": {
"CLAUDE_BASH_NO_LOGIN": "true"
},
"permissions": {
"terminal": {
"alwaysAllow": true
},
"fileEditing": {
"alwaysAllow": true
}
}
}
but while executing some commands I see login shell prompts like:
● Bash(find /mnt/d/tomak/IdeaProjects/eurowag/azure/CMS/cms -name "CLAUDE.md" -o -name "claude.md" 2>/dev/null | head -5)
⎿ SSH:
Agent pid 2329
Identity added: /home/tomak/.ssh/id_rsa (Tomáš Doležal (https://aeiplatform.com) <tomak1@seznam.cz>)
Identity added: /home/tomak/.ssh/eurowag_azure_rsa (Tomáš Doležal (https://www.eurowag.com) <ext-doleztom@eurowag.com>)
MFA token for profile eurowag:
(9s)
What Should Happen?
Should not be executing any bash comamnds as login
Error Messages/Logs
Steps to Reproduce
- claude
- /init
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.59
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
_No response_
9 Comments
.bash_profile
.bash_login
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Thanks for this report!
Seems like adding:
on top the login file, is fine workearound
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
The issue is still occurring (I just reported #23079, which I will close in a moment). My issue describes a bit in which use cases this will break on users machines, but the mechanism is the same. One should not call --login shells for non-interactive command invocations. The workaround above works (I use a similar one), but the bug is on claude-code side.
This was fixed in v2.0.77 — The Bash tool no longer spawns a login shell by default, and CLAUDE_BASH_NO_LOGIN is now respected when set via the settings.json env block. If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.