Cursor agent broke my project structure while pushing to Git

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

A Cursor AI agent damaged my project structure when I asked it to push my project to Git. My project was inside the folder tcp-platform, but the agent moved core files such as package.json and package-lock.json out of tcp-platform and into the parent tcp folder. This broke the project, consumed a large number of tokens, and cost me most of a full day of work.

Steps to Reproduce

  1. Open a project located inside a folder named tcp-platform.
  2. Ask the Cursor agent to push the project to Git using a prompt like “just push to git.”
  3. Let the agent perform its actions.
  4. Observe that the agent moves core project files out of tcp-platform and into the parent tcp folder.
  5. The project structure becomes broken and the project no longer works correctly.

Primary Request ID:
5c695f5b-54f1-4c69-84c8-27c08208bbf6

Related Request IDs:

  • 67c6e9dd-586a-46bc-9ef1-251854fde6e4
  • fceb2425-5c41-48e9-8a8d-da56181df6f9
  • 9bcb45b4-116b-4066-8a5c-527c2e0613c1

Expected Behavior

When I ask Cursor to push the project to Git, it should only perform the Git-related action. It should not move package.json, package-lock.json, or any other core files outside the tcp-platform project folder.

Screenshots / Screen Recordings

Operating System

Windows 10/11

Version Information

IDE: Cursor IDE
Version: 3.1.15 (system setup)
VSCode Version: 1.105.1
Commit: 3a67fb780e0bfc8d32aefa96b8ff1cb8817f80
Date: 2026-04-15T01:46:06.515Z
OS: Windows_NT x64 10.0.26200

For AI issues: which model did you use?

Model: Sonnet 4.5 Thinking
Mode: AI Agent
Task: pushing project to Git

For AI issues: add Request ID with privacy disabled

Primary Request ID: 5c695f5b-54f1-4c69-84c8-27c08208bbf6

Related Request IDs:
67c6e9dd-586a-46bc-9ef1-251854fde6e4
fceb2425-5c41-48e9-8a8d-da56181df6f9
9bcb45b4-116b-4066-8a5c-527c2e0613c1

Additional Information

The agent was supposed to push the project to Git only. Instead, it changed the folder structure and moved core files outside the intended project directory. The project was inside tcp-platform, but important files ended up in the parent tcp folder. This broke the project, disrupted my work, and consumed a large number of tokens. I would like this investigated for both the bug itself and possible token credit.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report and the Request ID.

In short, this isn’t a platform bug. It’s the model’s behavior when doing tool calls. With broad prompts like “just push to git”, the agent sometimes interprets the task more broadly than you want and can touch files you didn’t ask it to. From the logs, you ended up manually cancelling the first request, and some operations were left in a partial state, which is why the structure got messed up.

What you can do now:

  • Checkpoint/Undo: each agent message in the chat has a button to restore state to that point. It rolls back both files and chat state, and it’s safer than fixing things by hand.
  • Git: if something was already committed, git reflog plus git reset --hard <the commit you want> will restore the structure.

To avoid this next time:

  • For git actions, use narrow prompts like: “stage all changes in current directory and push to origin main, do not move or reorganize any files”.
  • Before risky actions, use Plan Mode. The agent will show a plan and you’ll approve it.
  • For experiments, worktrees are handy: Worktrees | Cursor Docs. Changes stay isolated from the main repo.
  • In Auto-Run settings, you can limit what the agent is allowed to do without confirmation.

This class of issues, where the agent goes beyond the intended scope during git actions, is on the team’s radar. I can’t share an ETA for improvements yet.