Ability to reference specific lines in code changes and agent's text replies

I use extensive set of rules and documents for project’s context. I also tend to write detailed prompts for agents and only use thinking agents like Claude4-t. Sometimes when I see agent’s code changes and its text explanation I want to dive deeper into particular parts of the implementation because it goes even further than I originally expected thanks to my set of rules and documents about the best practices and architectural tips. So I need to understand why the agent implemented additional functionality and what was its reasoning in particular parts of changes. Currently I cannot reference specific lines of codes in agent’s changes or their particular sentences in the next chat to do that. The only option is to copy-paste it and write explanation that the agent made these specific changes in the previous chat due to reasons A,B,C and my suggestions of X, Y, Z. I understand Cursor passes the context within one chat session but it is not perfect and sometimes agent assumes it was I who wrote that code. So I have to provide additional context for agents.
I am not sure it is the best way to pass the context because often it requires quite a bit of time to properly explain and copy-paste multiple fragments from the source files directly. Copy-pasting code from the chat output doesn’t copy information about the file where the lines are. Only if you copy paste it from the file opened in the editor Cursor adds filename.py(100-120) context. As you can imagine that can be quite a bit of work especially if multiple files were edited with multiple edits within different parts of each file. If there was a native way of doing this that would help a lot.

Hi @walric thank you for the feature request!

I think its a good idea, what way do you envision ‘native’ ability to do the same compared to open file in editor?

Hi T1000. Ideally I would be able to select the explanation text in the agent’s output/select lines in the code fragments it outputs, right click selection → add to chat. The selected text/lines of code will be added to the chat with an icon/other indication that it is a reference info. It would make sense to make these blocks of citation read-only with a slightly different background to clearly indicate that it is a citation from the chat. Basically a citation mechanics.