# Lock Text/Code (don't touch my code)

**URL:** <https://forum.cursor.com/t/lock-text-code-dont-touch-my-code/23586>\
**Category:** Feature Requests\
**Created:** [October 18, 2024, 2:42pm UTC](https://forum.cursor.com/t/lock-text-code-dont-touch-my-code/23586 "2024-10-18T14:42:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shaneteks](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/shaneteks/32/4149_2.png) [@shaneteks](https://forum.cursor.com/u/shaneteks)\
**Post date:** [October 18, 2024, 2:42pm UTC](https://forum.cursor.com/t/lock-text-code-dont-touch-my-code/23586/1 "2024-10-18T14:42:20Z")

</div>

Just reading through the forums can be fun and informative.

Anyways, a feature where you can highlight text/code to lock it, so it can’t be edited/removed by composer or apply from chat and if the locked code is required to change put the change below the locked code and inform the user.

I think many people have experienced Cursor removing their code (not intentionally I hope). This feature could maybe help with that.

Maybe color code it (color can be seen on the tab) so the user can see which files have locked code.

---

<div class="post-metadata">

**Author:** ![yquemener](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/yquemener/32/6040_2.png) [@yquemener](https://forum.cursor.com/u/yquemener)\
**Post date:** [October 20, 2024, 12:55pm UTC](https://forum.cursor.com/t/lock-text-code-dont-touch-my-code/23586/2 "2024-10-20T12:55:26Z")

</div>

One thing I do that limits this kind of regression is that I force Cursor to maintain a comment at the beginning of the file that lists the functionalities and constraints as we add them. I put this in the instructions for the model, and it has greatly reduced accidental deletions by Cursor.

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/127254_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [June 18, 2026, 10:18am UTC](https://forum.cursor.com/t/lock-text-code-dont-touch-my-code/23586/3 "2026-06-18T10:18:14Z")

</div>

Closed on June 18, 2026, 10:18am UTC


