[MODEL] In vscode files opened in previous sessions carried over to new sessions

Resolved 💬 2 comments Opened Apr 10, 2026 by sanjuktar Closed May 22, 2026

Preflight Checklist

  • [x] I have searched existing issues for similar behavior reports
  • [x] This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Claude modified files I didn't ask it to modify

What You Asked Claude to Do

This was in a brand new session. I asked why .gitignore was showing in the dialog.

<img width="1027" height="370" alt="Image" src="https://github.com/user-attachments/assets/4b8bf23c-53dc-45d2-8894-27172bf76a43" />

In this case it doesn't make much of a difference but I can see cases where it might.

What Claude Actually Did

THis was claude code's response:

Here's what's actually happening:

Was it included in every message? No — it appeared once when you opened the file. The extension sent a one-time "ide_opened_file" event. It's not re-attached to every subsequent message.

Can you turn it off? There's no setting to disable the opened-file event specifically. But you can remove the chip from the input box before sending if you don't want it included in a particular message.

Should you? Generally, leave it on. It's useful context that lets you ask questions about whatever you're working on without manually attaching the file. It only fires when you actually open something — it's not silently bloating every message.

When I said that I did not want it pulled into sessions where it was not in context, the response was ( and so I'm filing an issue):

The research didn't produce a definitive answer. My best guess: when I edited the file, VS Code registered it as recently opened/modified, which is why the extension keeps surfacing it.

The honest answer is I'm not sure if this is a bug or by design. The only reliable workaround right now is clicking the × on the chip when it appears in conversations where it's irrelevant.

If it's consistently annoying, it's worth filing a bug at github.com/anthropics/claude-code/issues — the behavior of persisting across unrelated conversations does sound unintentional.

Expected Behavior

The file is refered to only in the session it was used in or if the file is open.

Files Affected

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Yes, every time with the same prompt

Steps to Reproduce

_No response_

Claude Model

Sonnet

Relevant Conversation

Impact

Critical - Data loss or corrupted project

Claude Code Version

2.1.96

Platform

Anthropic API

Additional Context

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗