Why is Claude 4 on Cursor suddenly creating new files for EVERYTHING

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I ask it to do something - it creates a Python file that does it.
I ask it to update documentation - it creates a Python file to do it
I ask it to change direction - it creates a new file that does this

My entire codebase is littered with files that I am constantly having to clean up.
I have repeatedly prompted it to not do this and to instead focus on the files that exist but it just continually litters files everywhere :frowning:

Steps to Reproduce

Ask it to do anything - at least in my envionment

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.5.8 (Universal)
VSCode Version: 1.99.3
Commit: d1893fd7f5de2b705e0c040fb710b08f6afd4230
Date: 2025-08-29T17:46:18.584Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hi @the1dv is this something that occurs also on new chats?

On longer chats or in chats with a lot of conflicting context there may be hallucinations (valid looking but logically invalid responses). This happens on all models but chance increases with longer chats or a lot of context.

Could you post a Request ID with privacy disabled so we can look into the details? Cursor – Getting a Request ID

Please let us know more what is happening and under which circumstances, so we can assist you!

I assume you mean Sonnet 4 when you reference Claude 4 (Opus and Sonnet).

I’ve been trying claude code and claude code does this. My guess is it’s a model problem. It’s annoying af

1 Like

Yeah it is - I think if people are seeing this on Claude Code to its likely a model problem rather than a cursor issue but I have had to try and prompt around this and it still wants to create a new file for every iteration

Claude always does this; you need to tell it not to do it, make a rules file, or just start a new session. It seems to get into loops doing it, but if you tell it to stop , it will. (it seems to get triggered if it repeatedly fails to use one of the tools, at least in my cases)

1 Like

I can not directly reproduce it with all Sonnet 4 models and modes I tried. Its not unlikely a model issue and/or depending on context.

If you could share a non-privacy Request ID it would help.

try having it create a website that is made using typescript. I have playwright scripts I use to test it and claude code was just littering my dev environment with temporary scripts.

Yeah I am using Playwright MCP too - I wonder if that is a cause? Not really sure why it would be.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.