Recently Viewed Files Injected into Chats

By default, the Cursor IDE injects recently viewed files into chats, even when I start a brand new chat.

I’d like to turn this off. I’m always starting new chats to intentionally double-check planning and work, and having references like fights the double-blind approach.

Is there a way to turn this off? FWIW, the IDE is still very shaky in respecing the Rules I add, plus I’m not sure if my rule would override what the IDE injects.

is the ide telling you to reference recently opened files? if so, what are they?

“Yes, the IDE provides a “recently viewed files” section. It currently lists two files (most recent first):

  1. redacted

  2. redacted

*It also notes that you don’t have any files currently open in the editor. The context includes a caveat that these files “may or may not be relevant to the current conversation.”

Version: 3.0.16 (user setup)
VSCode Version: 1.105.1
Commit: 475871d112608994deb2e3065dfb7c6b0baa0c50
Date: 2026-04-09T05:33:51.767Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.19045

Hey @A_K2!

This is not currently configurable. Note that this only injects file names (paths and line counts), not file content. A rule wouldn’t help here either as the IDE injects this context before rules are evaluated, so a rule can’t prevent it from being sent.

That said, is the concern specifically about file names influencing the model’s responses? If it’s just paths being listed, it may not meaningfully affect a double-blind review. But if you’re finding the model is actually referencing or being biased by those filenames, that’d be useful to know.

I discovered this because I was confused why brand new chats were making the same mistakes as earlier chats, and I traced it to all them using the same file from the recently viewed list.

Yeah, this is a problem. I have a file open from a previous session. I told a new chat session to make an edit to it. It started editing an unrelated readme file. I’m not going to worry about why it missed the open file, but this interaction is very concerning:

why are you touching the readme file instead of the plan that’s open in the editor?

The README.md is the only file shown as recently viewed — there are no other files open in the editor. Could you clarify which file contains the plan you want me to edit? I’ll revert the README changes in the meantime.

There is no path on earth I wanted the agent to work on a file i had closed and was unrelated to the current chat

Thanks @A_K2! Can you share what Model you’re using, and a Request ID from the chat?

Sorry, I can’t. I’ve hard-deleted my chat histories from disk since then. This specific indicdent was either GPT-5.4 medium or Codex 5.3 Medium, with a small chance it was Opus 4.6 medium or Sonnet 4.6 medium. I’ve been using all 4 models and have spent some time asking all of them about their contexts related to this general problem.

When will this be addrssed as a configurable option? Gemini overwrote a file because it assuemd, based on the name, it should replace it. The file was closed. Gemini said it did it because it was in it’s context of previously opened files and assumed based on the name my request was to replace it, not create a new file.

Yeah I agree this is something that should be configurable, it is annoying as sometimes the model then acts in different way than I want. It should be enabled by default, but should be configurable.

If you’re consistently running into this issue, you might want to try adding an always-applied rule like:

Ignore editor-state context (recently viewed files, open files, edit history) unless I explicitly reference them with @.

Rules appear higher in the system prompt than Open and Recently Viewed Files (which is attached to the first user message), so this should help nudge the model to disregard it.

This thread is a great place for other users hitting the same issue to chime in. The more signal we get, the easier it is to prioritize a toggle for this!

The vast majority of times a session finishes and I ask if it follow my IDE rules, the answer is no or partially. IDE rules are not reliable.

This morning I was working on a Git problem. Then two or three sessions later I started on a whole new issue with the same code base. Since the work was based on the current set of staged changes, I asked the agent to confirm what it saw in staged changes.

It gave me a list of files, but then ended its answer with:

I tried to verify live with git status/git diff --cached, but the shell output came back blank even for a simple echo, so I’m relying on the Git snapshot attached to the session.

What snapshot? I didn’t attach one. Explain what snapshot.

The “snapshot” is the automatic context Cursor attached at the start of the chat under git_status. You didn’t manually attach it.

(list of redacted file names)

In git status --short, the first column is staged and the second column is unstaged. So (redacted file names) means that file was staged as added at the time Cursor created the context. The entries with a leading space, like M ... or A ..., mean unstaged changes.

My live shell verification failed because command output was blank even for echo hello, so I should have said: “Cursor’s automatically attached Git context indicates…” rather than implying I independently confirmed it.

One last post just to vent, but obviously the point is made and hopfeully cursor will fix this.

On a mac before (different machine so I don’t have the exact version, but 3.1.x). Started a new chat with gtp 5.5 medium, asked it to vet the v2 version of a doc i had opened, without warning it additionally used v1 of the doc in reviewing v2. I asked why when i only had v2 open. Agent told me it saw I only had v2 open, but v1 was in its previous viewed list and thought it was a good ide to use it in the review.

Again, no point int continuing to post this, this is problematic and we need a way to turn this off.

I guess I’m not over this yet. Is this really only happening to me? I’ve been working on three different machines lately, and now it’s happening on the third.

To paraphrase:

My only open document is “xyz-plan.md”

I start a ne wchat and say “implement this plan”

I then seeing it’s searching another part of the workspace. I stop it and ask, why? Do you not see the plan I have open"

It answers (again, paraphrase) – Yes, but I also see “qrs-plan.md” plan and thougth that was the plan you meant.

qrs-plan.md was closed and part of the previous chat, not this one.

I am running into the same issue. Cursor has an old state of my files, not only the filenames.
It tells me that the file looks completely different than it does, also if I pushed the files before starting a new chat.

@Colin any plans when we can disable this snapshot, as this is quite annoying to work with.

@mohitjain I think this is similar to a different ticket (this) you are supporting. I think the proposed isolated workspaces is not a reasonable approach to fixing this problem, as it makes the whole ux break. Maybe a simple setting to turn this off would be enough, as it seem to cause quite some problems..