claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[Bug] Agent stuck in infinite loop after bash command completes successfully

Open corneliusroemer opened this issue 3 months ago • 3 comments

Bug Description Claude gets stuck after completing a bash command successfully (e.g. git add). It enters an infinite loop even though the bash command finished (green circle).

Environment Info

  • Platform: darwin
  • Terminal: iTerm.app
  • Version: 2.0.28
  • Feedback ID: 21a980a7-6b06-4931-9879-89cd4d6b255b

Errors

[]

Example:

⏺ Perfect! Let me add these changes and commit:

⏺ Bash(git add website/src/components/Edit/InputField.tsx website/src/components/Group/GroupForm.tsx website/src/components/SearchPage/SearchForm.tsx website/src/compo…)
  ⎿  (No content)
  ⎿  Interrupted · What should Claude do instead?

> did you get stuck?

⏺ No, I was about to commit but let me continue. Let me commit the fragment removal:
  ⎿  Interrupted · What should Claude do instead?

> /feedback

corneliusroemer avatar Oct 29 '25 14:10 corneliusroemer

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/7091
  2. https://github.com/anthropics/claude-code/issues/9879
  3. https://github.com/anthropics/claude-code/issues/10197

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Oct 29 '25 14:10 github-actions[bot]

Yo lowk just like kill the session fam

siddhzx avatar Dec 07 '25 06:12 siddhzx

I created a separated claude command which had to create separate worktrees and spawn agents with the same prompt in each.. it created infinite loop (in 3 separate git worktrees!) and costed me tens of millions of tokens.. seems like parallel agent execution is not there yet

alloc33 avatar Dec 22 '25 15:12 alloc33