Context-Aware File Resolution in Chat Panel

Feature request for product/service

Chat

Describe the request

When the AI chat panel generates a response that references a file (e.g. candidates.py), clicking that file link doesn’t always open the right file. If the workspace has multiple files with the same name across different directories, Cursor seems to pick one arbitrarily rather than resolving it based on the context of the conversation — specifically, which folder or files the agent was actually working in.

This is especially frustrating when the LLM just explored or edited a file in a specific subdirectory: it clearly knows which one it meant, but the link resolves to the wrong one.

The fix seems straightforward: when generating a clickable file reference, the resolved path should be anchored to the working context of that response (e.g. the directory the agent explored, the files it read or modified, etc.) rather than doing a naive name-based lookup across the whole workspace.

Thanks for considering this — love the product overall and this would go a long way toward making the chat panel feel more precise.

Best