# Cursor agent broke my project structure while pushing to Git

**URL:** <https://forum.cursor.com/t/cursor-agent-broke-my-project-structure-while-pushing-to-git/158357>\
**Category:** Bug Reports\
**Tags:** terminal, anthropic\
**Created:** [April 18, 2026, 6:36am UTC](https://forum.cursor.com/t/cursor-agent-broke-my-project-structure-while-pushing-to-git/158357 "2026-04-18T06:36:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zoom\_Tech](https://avatars.discourse-cdn.com/v4/letter/z/7cd45c/32.png) [@Zoom\_Tech](https://forum.cursor.com/u/Zoom_Tech)\
**Post date:** [April 18, 2026, 6:36am UTC](https://forum.cursor.com/t/cursor-agent-broke-my-project-structure-while-pushing-to-git/158357/1 "2026-04-18T06:36:47Z")

</div>

### 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

 ![Screenshot 2026-04-16 160247.png](https://us1.discourse-cdn.com/cursor1/original/3X/b/5/b5309c0a986832c1b2c6d7a2b572e698910a5ae1.png)

### 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

---

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [April 18, 2026, 9:12am UTC](https://forum.cursor.com/t/cursor-agent-broke-my-project-structure-while-pushing-to-git/158357/5 "2026-04-18T09:12:55Z")

</div>

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](https://cursor.com/docs/configuration/worktrees). 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.

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [May 10, 2026, 9:13am UTC](https://forum.cursor.com/t/cursor-agent-broke-my-project-structure-while-pushing-to-git/158357/6 "2026-05-10T09:13:51Z")

</div>

Closed on May 10, 2026, 9:13am UTC

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