Unresponsive hang with 120% CPU usage
Recent versions of claude-code, specifically v1.0.89 will hang and become unresponsive when doing searches. Earlier versions from a few days ago did not exhibit this behavior.
The last thing printed before the hang always has the form
● Search(pattern: "addEventListener.*update", path:
"/home/foobar/examples/visualizer", glob: "*.js",
output_mode: "content")
The hang is independent of the search pattern; another example is
● Search(pattern: "\.(find|filter|some|every|includes|indexOf)\s*\(", path:
"/home/foobar/examples/visualizer", glob: "*.js",
output_mode: "content")
The hang manifests by having the operation timer stop updating; (That is, the status line where claude is thinking; it has a operation clock that usually updates every second. It usually looks like this:
✽ Puttering… (20s · ↑ 170 tokens · esc to interrupt)
The above snapshot is not from a hang; I think it always shows crossed hammers when it hangs ??? Not sure about that...
Another symptom of the hang is that top shows 120% CPU usage by claude; that is, 1.2 cores of a multi-core machine are being used. so there are multiple threads that get stuck in some infinite loop.
Claude is unresponsive to kill -HUP but goes down for kill -9 Restarting with claude --continue results in it hanging again within 10-30 seconds. Restarts with the --continue flag always hang, every time.
This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗