[BUG] Long pause then "interrupted by user" for grep and git commands

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

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

View original on GitHub ↗

5 Comments

andrewreece · 1 year ago

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 grep and git—others, like aws 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.

vrogojin · 1 year ago

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)

wolffiex collaborator · 1 year ago

We have a new shell implementation rolling today that may fix this. Stay tuned.

wolffiex collaborator · 1 year ago

Ok v0.2.69. Can you please retest? I'm sure the new shell implementation has different bugs but hopefully this one is fixed.

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.