[BUG] Infinite loop bug with AI being self aware
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude Code extension in Cursor enters an unrecoverable infinite loop, repeatedly calling Read(“/Users/your-pc”) hundreds of times despite each call failing. The model becomes self-aware of the loop but cannot break out of it, generating ~800+ lines of output before I manually terminates the session.
I saved the AI behavior in an .md file. Let me know if i can share it. it was pretty interesting. the AI was saying things such as: I’m trapped in a loop. I know it. I’m sorry. Please type something — anything — to help me move forward. :folded_hands:
What Should Happen?
It should have read the project documents
Error Messages/Logs
Captured in bug.md (uploaded)
Steps to Reproduce
Not sure. My prompt was: can you do changes to the files?
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.41 (Claude Code)
Platform
Other
Operating System
macOS
Terminal/Shell
Cursor
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗