Copy pasted code in chat not always taken into literal context

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When copy pasting a selected code region into chat. It automatically gets added to the context. However, I often see (using gpt-5-mini) that if I don’t actually write out the method name or specify the lines that were in that copy pasted code segment, the model has no idea what I am referring to.

Steps to Reproduce

Copy method or some lines of code into Chat. Make a request about those lines.

Expected Behavior

It should know you are referring to the copy pasted code without saying the method name or the specific lines.

Normal copy/paste, and if I submit request as is, the model responds with confusion: “where do you want the comments?”

Normal copy/paste, but then I manually specify the lines or method that I copied. The model starts working right away.

Suggestion

When pasting into chat just add the filename and line numbers in chat, in addition to adding it to the context at the top. Sometimes I would prefer it to just paste the copied code directly into chat because it would be more clear what I am asking, but I don’t think that is necessary if you can have these little meta tags with the filename and line numbers, which keeps things clean.
By having the filename and lines as literal text in the request, the model can hopefully take this information literally and refer to the related context easily. Like how it works when you drag an open file/tab into the chat. This also would make it easy to paste multiple segments of code and in chat form a request tying them all together.

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.5.7 (user setup)
VSCode Version: 1.99.3
Commit: 6aa7b3af0d578b9a3aa3ab443571e1a51ebb4e80
Date: 2025-08-27T22:43:32.248Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.19045

Does this stop you from using Cursor

No - Cursor works, but with this issue

Thanks for the report here!

I’ve passed this to the team for feedback, as this is likely a prompting issue that is often model specific :folded_hands:

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