Bash command execution hangs intermittently

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

Bug Description
Bash commands don't always work but hang instead. Seems like they sometimes start working after running /compact and then have no issues for a while.

Environment Info

  • Platform: Fedora Silverblue, Distrobox container
  • Terminal: Ghostty/tmux
  • Version: 0.2.35
  • Feedback ID: fff79388-af10-4f63-bbca-daef57bbc59b

Errors

[{"error":"Error: Command failed: /usr/bin/rg --files --glob *.md /var/home/matias/.claude/commands\nrg: /var/home/matias/.claude/commands: IO error for operation on /var/home/matias/.claude/commands: No such file or directory (os error 2)\n\n    at genericNodeError (node:internal/errors:984:15)\n    at wrappedFn (node:internal/errors:538:14)\n    at ChildProcess.exithandler (node:child_process:422:12)\n    at ChildProcess.emit (node:events:518:28)\n    at ChildProcess.emit (node:domain:489:12)\n    at maybeClose (node:internal/child_process:1104:16)\n    at Socket.<anonymous> (node:internal/child_process:456:11)\n    at Socket.emit (node:events:518:28)\n    at Socket.emit (node:domain:489:12)\n    at Pipe.<anonymous> (node:net:343:12)","timestamp":"2025-03-09T07:46:01.792Z"},{"error":"TypeError: path must not be empty\n    at Tq3 (file:///var/home/matias/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:319:68729)\n    at I_ (file:///var/home/matias/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:319:68838)\n    at aM2._test (file:///var/home/matias/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:319:69442)\n    at aM2.ignores (file:///var/home/matias/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:319:69944)\n    at tM2 (file:///var/home/matias/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:647:230)\n    at xq3 (file:///var/home/matias/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:645:470)\n    at Object.call (file:///var/home/matias/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:643:109)\n    at call.next (<anonymous>)\n    at Z_ (file:///var/home/matias/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:998:91)\n    at file:///var/home/matias/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1057:842","timestamp":"2025-03-09T07:46:02.022Z"},{"error":"ShellError: Shell command failed\n    at Object.call (file:///var/home/matias/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:800:425)\n    at runNextTicks (node:internal/process/task_queues:60:5)\n    at process.processTimers (node:internal/timers:516:9)\n    at async AU3 (file:///var/home/matias/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:998:4146)\n    at async PU1 (file:///var/home/matias/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:998:2856)\n    at async r$2 (file:///var/home/matias/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:998:428)\n    at async YU3 (file:///var/home/matias/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:998:2250)\n    at async s$2 (file:///var/home/matias/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:998:2071)\n    at async TX (file:///var/home/matias/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:998:1613)\n    at async TX (file:///var/home/matias/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:998:1916)","timestamp":"2025-03-09T08:31:35.488Z"}]

View original on GitHub ↗

7 Comments

odysseus0 · 1 year ago

@wolffiex I am also still experiencing the same issue, but on Mac with zsh default shell on Ghostty as well.

SHELL=/bin/bash claude

fixes it.

matheik · 1 year ago

Thanks for the input. I saw multiple possibly related issue reports before creating this one, but there seems to be some different conditions.

Unfortunately SHELL=/bin/bash claude doesn't help in my case. Haven't still figured out a clear pattern on what triggers bash commands to work or not, I'm open to troubleshooting tips.

wolffiex collaborator · 1 year ago

we pushed a fix for issues with noclobber that were affecting bash and zsh. please update and let me know if this is fixed in 0.2.37

matheik · 1 year ago

Haven't encountered the problem anymore for a few days since the update so it seems to be fixed, thanks!

vindavs · 1 year ago

@wolffiex I'm encountering this with Claude Code 1.0.9, almost every bash command seems to hang.
My $SHELL is /bin/bash

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.