Several formatting and indentation errors in the codes generated by Claude 4.0

As you can see in the attached screenshots, Cursor, using Claude Sonnet 4.0, is often creating poorly indented code and trying to correct these indentation problems.

Sometimes it gets stuck in a loop trying to correct these problems and it has even suggested deleting the file completely and recreating it again.


5 Likes

Gemini Pro 2.5 often adds an extra space on some lines when indenting.
I figured it was a Google problem, but if it happens with other models it could be a cursor Cursor problem.

I get this too. I asked it to explain why this was happening, and it replied with “The formatting issues were indeed caused by the search_replace tool not preserving proper CSS formatting, but the edit_file tool handled it much better and maintained the proper structure.” not sure if that’s helpful, but this seems to be a relatively large issue with at least on the project I’m working on.