# Apply Changes - Wrong File

**URL:** <https://forum.cursor.com/t/apply-changes-wrong-file/16731>\
**Category:** Bug Reports\
**Created:** [September 14, 2024, 3:50pm UTC](https://forum.cursor.com/t/apply-changes-wrong-file/16731 "2024-09-14T15:50:32Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![seanfdc](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@seanfdc](https://forum.cursor.com/u/seanfdc)\
**Post date:** [September 14, 2024, 3:50pm UTC](https://forum.cursor.com/t/apply-changes-wrong-file/16731/1 "2024-09-14T15:50:32Z")

</div>

When using the apply changes feature, Cursor suggests the wrong file to apply changes to.

For example:  
I have a file: test.js  
I have a seperate file test.js-meta.xml

When attempting to make changes to test.js, cursor will apply the changes to test.js-meta.xml

---

<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:** [September 14, 2024, 3:54pm UTC](https://forum.cursor.com/t/apply-changes-wrong-file/16731/2 "2024-09-14T15:54:13Z")

</div>

Hi @seanfdc

Thank you for sharing the information. We’ll try to figure this out.

---

<div class="post-metadata">

**Author:** ![subzero06](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/subzero06/32/9991_2.png) [@subzero06](https://forum.cursor.com/u/subzero06)\
**Post date:** [September 14, 2024, 6:43pm UTC](https://forum.cursor.com/t/apply-changes-wrong-file/16731/3 "2024-09-14T18:43:39Z")

</div>

meanwhile you can also specify to use exact file name in your prompt.

---

<div class="post-metadata">

**Author:** ![IliasChair](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/iliaschair/32/19245_2.png) [@IliasChair](https://forum.cursor.com/u/IliasChair)\
**Post date:** [February 11, 2025, 6:12pm UTC](https://forum.cursor.com/t/apply-changes-wrong-file/16731/4 "2025-02-11T18:12:06Z")

</div>

I am dealing with the same problem and think I can add some information.

For me, this problem allways occurs when I open files that dont belong to the current workspace.

In that case. Composer and Chat provide two options, both with the same path E.g. `/path/to/foreign/file`. However one will grab the correct (global) path, and the other will simply create a new file in the opened workspace. E.g. `workspace/path/to/foreign/file`

This is really annoying since this can not be undone! If I reject the file and re-apply the changes, it will still apply them to the wrong directory, with no option to change the directory. The only way to bypass this is to generate new changes through prompting, and then hoping cursor grabs the correct path that time.

---

<div class="post-metadata">

**Author:** ![danperks](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/danperks/32/19087_2.png) [@danperks](https://forum.cursor.com/u/danperks)\
**Post date:** [February 19, 2025, 11:54pm UTC](https://forum.cursor.com/t/apply-changes-wrong-file/16731/5 "2025-02-19T23:54:01Z")

</div>

Workspace support is not yet available in Cursor, as our codebase indexing relies heavily on everything being in the same folder, but I’m hoping we can add workspace support in a future release so this kind of workflow works!

---

<div class="post-metadata">

**Author:** ![wilkice](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/wilkice/32/27854_2.png) [@wilkice](https://forum.cursor.com/u/wilkice)\
**Post date:** [February 20, 2025, 3:50pm UTC](https://forum.cursor.com/t/apply-changes-wrong-file/16731/6 "2025-02-20T15:50:01Z")

</div>

Still apply to wrong file.

 ![SCR-20250220-uoff](https://us1.discourse-cdn.com/cursor1/original/3X/2/3/230370ad4e63f15f9ac0460438251e064e6809d9.png)

It want to apply change to index.html, but can only apply to main.go.

---

<div class="post-metadata">

**Author:** ![vcuken](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/vcuken/32/32847_2.png) [@vcuken](https://forum.cursor.com/u/vcuken)\
**Post date:** [March 4, 2025, 7:08pm UTC](https://forum.cursor.com/t/apply-changes-wrong-file/16731/7 "2025-03-04T19:08:55Z")

</div>

Still a problem:

 ![Screenshot 2025-03-04 at 1.59.10 PM](https://us1.discourse-cdn.com/cursor1/original/3X/e/4/e4341628ccb5002da0f4b3f237a424b6c798d8d2.png)

i.e. I have files A.txt, B.txt, C.txt in the weird box that I can not remove files from. File D.txt is added to context. In file E.txt I select code and press CMD+I, I see E.txt(50-60) added to context. I ask to change a line of code expecting it to change file E.txt. Cursor completes the request and suggest a change in B.txt. Hheee?

---

<div class="post-metadata">

**Author:** ![favourz1](https://avatars.discourse-cdn.com/v4/letter/f/df705f/32.png) [@favourz1](https://forum.cursor.com/u/favourz1)\
**Post date:** [May 7, 2025, 2:21pm UTC](https://forum.cursor.com/t/apply-changes-wrong-file/16731/8 "2025-05-07T14:21:11Z")

</div>

This is still an issue and it’s really frustrating

In my case, I have the original file in src/components/file.jsx

It applies changes to a new directory entirely like  
path=src/components/file.jsx

and I have to manually copy these changes into the right file and its not a full rewrite of the code so I have to find particular lines affected which is not a good user experience.

Please look into this with urgency!  
cc: @deanrie @danperks

---

<div class="post-metadata">

**Author:** ![JulianKingman](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/juliankingman/32/21534_2.png) [@JulianKingman](https://forum.cursor.com/u/JulianKingman)\
**Post date:** [May 7, 2025, 8:47pm UTC](https://forum.cursor.com/t/apply-changes-wrong-file/16731/9 "2025-05-07T20:47:36Z")

</div>

Still a problem.

For some context, it started when I rejected some changes, I also might have been editing it while it was editing or something. Ever since then, that file appears in the “Review next file” flow, without any changes, and I can’t reject nor accept the file, and if I try to get the agent to change the file, it chooses the wrong file. Deleting and building the index fixed that issue, but then caused the chat to get… funky. Like reporting it did things when it didn’t, making changes I didn’t ask for, the kind of stuff you get at the end of the context window.

---

<div class="post-metadata">

**Author:** ![tidharm](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/tidharm/32/49713_2.png) [@tidharm](https://forum.cursor.com/u/tidharm)\
**Post date:** [July 1, 2025, 7:06am UTC](https://forum.cursor.com/t/apply-changes-wrong-file/16731/10 "2025-07-01T07:06:54Z")

</div>

Might be related to [File Operations Misrouted to a Directory Other than Specified Context - #2 by tidharm](https://forum.cursor.com/t/file-operations-misrouted-to-a-directory-other-than-specified-context/103149/2)

---

<div class="post-metadata">

**Author:** ![flamerged](https://avatars.discourse-cdn.com/v4/letter/f/ea666f/32.png) [@flamerged](https://forum.cursor.com/u/flamerged)\
**Post date:** [July 16, 2025, 1:09pm UTC](https://forum.cursor.com/t/apply-changes-wrong-file/16731/11 "2025-07-16T13:09:01Z")

</div>

I have exactly the same problem as in your thread that got closed(could not reply there) and i am losing my ■■■■■■■■ mind!! Did you find any solution to this problem? i simply cannot apply any changes at the moment it just does not work!!
