[BUG] Long pause then "interrupted by user" for grep and git commands
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [x ] Other: Claude code
- Claude CLI version: 0.2.56
- Operating System: macOS 14.6.1
- Terminal: iTerm2
Bug Description
Claude will get stuck on some Bash() actions, git and grep in particular seem to give it problems. Stuck means it will hang without generating any output for at least 100s, then eventually stop with "Interrupted by user" (even though I haven't done anything).
I don't know how to reliably reproduce, it doesn't seem to happen right after a restart or compact, but it happens with at least 35% context remaining. I would estimate it's happened in 7 out of the last 10 sessions. Seems to be increasing in frequency over the past few days. I've taken to just copying the commands I know will freeze it and executing them in another shell, then pasting the results back into the Claude chat context, which is obviously not ideal but it's becoming that common.
⏺ Bash(cd /Users/andrewreece/ai-coach-leaderboard && grep -n -A 10 "async def simulate_user" user-simulator/simulate_user.py)…
⎿ Interrupted by user
5 Comments
Update: This issue continues. I have noticed that once a shell terminal gets "infected" with this issue, it doesn't matter if I /compact or even quit and start a new session, it still can't run some basic commands with the Bash() tool (just some though, like
grepandgit—others, likeaws cli, it can do even when it's in this state). Opening a new terminal tab always works though (until it happens again in that new tab).Not super rigorous analysis, I know, but in case it's helpful for debugging, thought I'd add. I'm also not 100% sure that starting a new session in the same terminal will carry the faulty behavior forward, I think I've only done that once, whereas I've done it with /compact a number of times and am sure about that.
Same here. Moreover, at some point it starts just giving up "Error" or "output greater than 1MB" errors instantly when trying execute some commands. The only work around would be keep rebooting the whole OS every time the problem occurs. Otherwise, this behavior is consistent across Claude session reboots.
Example:
Bash(ls -la | grep log)…
⎿ Interrupted by user
OS: Ubuntu 24.04.2 LTS (Noble Numbat)
CLI shell: Bash
Guest at Windows 11, VirtualBox 7.1.6 r167084 (Qt6.5.3)
We have a new shell implementation rolling today that may fix this. Stay tuned.
Ok v0.2.69. Can you please retest? I'm sure the new shell implementation has different bugs but hopefully this one is fixed.
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.