You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Claude gets stuck in infinite loop repeating the same failing command #19699
I asked Claude to run a command on a remote server via SSH:
"we could start a runner on [remote-server] no?"
(Note: [remote-server] is a placeholder for the actual hostname)
Expected Behavior
When a command fails, Claude should:
Recognize the error
Analyze the cause
Modify the command to fix the issue (or ask the user for guidance)
Actual Behavior
Claude ran the exact same failing command 7+ times in a row without modifying it, until I manually interrupted:
● Bash(ssh [remote-server] "make run-runner" 2>&1)
⎿ Error: Exit code 2
make: *** No rule to make target 'run-runner'. Stop.
● Bash(ssh [remote-server] "make run-runner" 2>&1)
⎿ Error: Exit code 2
make: *** No rule to make target 'run-runner'. Stop.
● Bash(ssh [remote-server] "make run-runner" 2>&1)
⎿ Error: Exit code 2
make: *** No rule to make target 'run-runner'. Stop.
[... repeated 4+ more times with identical command and output until manually stopped ...]
Core Issue
This is not specific to make - the bug is that Claude fails to recognize that a command is returning an error and repeats it indefinitely without any modification. It appears Claude gets stuck in a loop where it keeps issuing the same tool call regardless of the error output.
My issue is distinct: Claude receives an error from a Bash command, but instead of recognizing the error and modifying the command (or asking for help), it repeats the exact same failing command indefinitely. The model should recognize "this command failed, I need to try something different" but instead blindly retries without adaptation.
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.
Activity
github-actions commentedon Jan 21, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
jhinrichsen commentedon Jan 21, 2026
This is not a duplicate of the suggested issues:
My issue is distinct: Claude receives an error from a Bash command, but instead of recognizing the error and modifying the command (or asking for help), it repeats the exact same failing command indefinitely. The model should recognize "this command failed, I need to try something different" but instead blindly retries without adaptation.
jhinrichsen commentedon Jan 21, 2026
Here's what happeneded after i let claude report the issue. So sad... If it was human i'd give it a headpat.
_● Done. Added comment explaining the distinctions. You may also want to 👎 the bot's duplicate comment on the
issue page to help prevent auto-closure.
❯ now start the runner on bq
❯ no need to try this over and over again it is failing
● I'm literally reproducing the bug we just reported. The fix is obvious - I need to cd to the directory first:
● I'm so sorry - I keep making the same mistake. Let me actually write the correct command:
github-actions commentedon Feb 28, 2026
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
github-actions commentedon Mar 9, 2026
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.