[BUG] 0.2.39 broke bash commands

Status Fixed / completed
Maintainer reply ✓ Yes — wolffiex
Activity 15 comments · opened Mar 13, 2025 · closed Mar 14, 2025
💡 Likely answer: A maintainer (wolffiex, collaborator) responded on this thread — see the highlighted reply below.

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 0.2.39 (Claude Code)
  • Operating System: macOS 15.3.1
  • Terminal: iterm2

Bug Description

The 0.2.39 broke bash command running, it waits forever before running the commands.

Bash(pnpm typecheck)…

✽ Doing… (65s · esc to interrupt)

Steps to Reproduce

  1. Ask to run some harmless bash command like pnpm typecheck in my case.

Expected Behavior

Ask and run

Actual Behavior

Not asking and stalling

The only current way to fix it is to disable autoupdate and revert to 0.2.38

claude config set -g autoUpdaterStatus disabled
npm -g install @anthropic-ai/claude-code@0.2.38

View original on GitHub ↗

15 Comments

mavient · 1 year ago

I've noticed that it no longer seems to source ~/.bashrc

hyperknot · 1 year ago

@mavient the only workaround for me:

claude config set -g autoUpdaterStatus disabled
npm -g install @anthropic-ai/claude-code@0.2.38
wolffiex collaborator · 1 year ago

sorry to break this. we optimized the startup path but that caused problems for some rc files. we'll an attempt to get the best of both worlds in tomorrows release

mavient · 1 year ago

So I realized now that my issue is slightly different, I'm trying to use rbenv within the bash tool and it looks like the PATH is being manipulated such that the ~/.rbenv/shims/ directory is no longer high enough in the list to be used. @wolffiex can you share more about how this could work?

wolffiex collaborator · 1 year ago

@mavient this was working and it broke, or it never worked?
if your .zshrc/.bashrc exists we try and source it
yesterday I pushed an optimization that was obviously no good, it may be that sourcing your profile is now exiting because it is, say, hanging waiting for user input

mavient · 1 year ago

I thought it was due to this bug as I only tried this yesterday. However
using 0.2.38 didn't fix it so now I don't think it ever worked.

I run fish and have a very simple .bashrc with just the rbenv init command
in it but the path still seems incorrect inside the tool. Anything else to
try?

On Thu, Mar 13, 2025 at 3:17 PM Adam Wolff @.***> wrote:

@mavient <https://github.com/mavient> this was working and it broke, or it never worked? if your .zshrc/.bashrc exists we try and source it yesterday I pushed an optimization that was obviously no good, it may be that sourcing your profile is now exiting because it is, say, hanging waiting for user input — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/466#issuecomment-2722806249>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAVEG5N36BWZEM7RKY2HAD2UH7YFAVCNFSM6AAAAABY6HNSX2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRSHAYDMMRUHE> . You are receiving this because you were mentioned.Message ID: @.***> [image: wolffiex]wolffiex left a comment (anthropics/claude-code#466) <https://github.com/anthropics/claude-code/issues/466#issuecomment-2722806249> @mavient <https://github.com/mavient> this was working and it broke, or it never worked? if your .zshrc/.bashrc exists we try and source it yesterday I pushed an optimization that was obviously no good, it may be that sourcing your profile is now exiting because it is, say, hanging waiting for user input — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/466#issuecomment-2722806249>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAVEG5N36BWZEM7RKY2HAD2UH7YFAVCNFSM6AAAAABY6HNSX2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRSHAYDMMRUHE> . You are receiving this because you were mentioned.Message ID: @.***>
wolffiex collaborator · 1 year ago

are you able to set the path with !
claude prefers zsh, check which shell it is actually using (it'll set $SHELL) and make sure you are editing the right rc file

hyperknot · 1 year ago

@wolffiex I have everything important in .bash_profile, my .bashrc is this, but I don't see the echo lines.

echo '.bashrc start'

if [ -f $HOME/.bash_profile ]; then
    source $HOME/.bash_profile
fi

echo '.bashrc end'

But why does it need to source those? Isn't it just a subprocess under the current shell?

wolffiex collaborator · 1 year ago

you wouldn't see the echo, that is ignored. this shouldn't be necessary as we start a login shell. did you have claude check which $SHELL it is using?

hyperknot · 1 year ago
you wouldn't see the echo, that is ignored. this shouldn't be necessary as we start a login shell. did you have claude check which $SHELL it is using?

By asking it in English, or how?

wolffiex collaborator · 1 year ago

yeah, "hey claude what shell are you running?"

wolffiex collaborator · 1 year ago

@hyperknot we have a fix for some shell issues in v0.2.41
can you please let me know if this fixes your issue?

mavient · 1 year ago
are you able to set the path with ! claude prefers zsh, check which shell it is actually using (it'll set $SHELL) and make sure you are editing the right rc file

This fixed it, thanks! So it turns out it's running zsh, so tried editing the .zshrc to include:

export PATH="$HOME/.rbenv/shims:${PATH}"

Would be good to note that .zshenv isn't used as that was my first attempt. Also would be good to describe exactly how $PATH is constructed as my rbenv shim path was in there but the order was all weird such that the system paths would override it.

hyperknot · 1 year ago
@hyperknot we have a fix for some shell issues in v0.2.41 can you please let me know if this fixes your issue?

@wolffiex it is still broken.

When I ask it to tell me what shell I'm using, it's asking for permission to run Bash(echo $SHELL), but then it doesn't do anything, keeps waiting infinitely.

I still have to downgrade to 0.2.38 to make it work.

github-actions[bot] · 1 year ago

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.