Agent is writing python scripts to modify code rather than modifying the code itself

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Auto agent is sometimes writing scripts to modify code files and then deleting the scripts after it’s done. Guys, what happened to auto agent? It was working okay for a few days but now performance is degraded again. It’s doing dumb stuff and messing up my codebase. I keep having to tag Opus in to fix auto agent’s mistakes, but this isn’t sustainable since I will eventually run out of Opus tokens. If this isn’t fixed, it’s going to force me to look at Cursor alternatives. Please…improve auto agent performance (reasoning, code quality, critical thinking).

Steps to Reproduce

Seems random

Expected Behavior

It should edit the code itself

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.3.8 (system setup)
VSCode Version: 1.105.1
Commit: 28e7b8993fa2568fb3cb377e67615eb068b893e0
Date: 2025-12-27T18:19:45.425Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26200

For AI issues: which model did you use?

Auto

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey, thanks for the report. That does sound odd. The agent shouldn’t need to create temporary scripts to modify code.

The team is working on improving agent performance and reliability. To help us investigate this specific case, could you share:

  1. The Request ID from the session where the agent used scripts (chat context menu > Copy Request ID)
  2. A concrete example of the prompt or task that triggered this behavior
  3. A screenshot or a quick description of what you’re seeing (which files get created, and what the agent does)

This will help the team understand why the agent is choosing this approach instead of editing files directly.

Request ID: 8bcc55a3-a2a8-4e7b-bb1a-56b18ea6c309

It was just supposed to edit a few fields for a Pydantic model and it created fix_defaults.py to do that rather that just editing the file. Then it deleted fix_defaults.py.

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