claude-code - 💡(How to fix) Fix [BUG] Workspace file tags leak across sessions

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

The workspace file chips/tags displayed in the chat input area are shared across all Claude Code sessions, not scoped per-session. This causes files created or opened in one session to appear in the input box of unrelated sessions.

Error Message

Error Messages/Logs

Root Cause

All sessions share the same workspace file tags. This is problematic because:

Fix Action

Fix / Workaround

  1. Accidental message pollution: When typing in Session B, the shared file tag can be accidentally included in the message sent to Claude, providing irrelevant file context

  2. Confusion: Users see file references in their chat that have nothing to do with the current conversation

  3. No workaround: There is no setting (claudeCode.*) to disable workspace file tags entirely

  4. Accidental message pollution: When typing in Session B, the shared file tag can be accidentally included in the message sent to Claude, providing irrelevant file context

  5. Confusion: Users see file references in their chat that have nothing to do with the current conversation

  6. No workaround: There is no setting (claudeCode.*) to disable workspace file tags entirely

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Description

The workspace file chips/tags displayed in the chat input area are shared across all Claude Code sessions, not scoped per-session. This causes files created or opened in one session to appear in the input box of unrelated sessions.

Steps to Reproduce

  1. Open VS Code with Claude Code extension
  2. Open Session A (e.g., "futures calculator" workspace)
  3. Create or edit a file (e.g., index.html) — file tag appears in Session A's input area
  4. Switch to Session B (e.g., "Xiaohongshu workflow") in the same VS Code window
  5. Observe that Session B's chat input area now also shows the index.html file tag from Session A

Expected Behavior

Each Claude Code session should have its own isolated workspace file context. Files created in Session A should not appear in Session B's input area.

Actual Behavior

All sessions share the same workspace file tags. This is problematic because:

  1. Accidental message pollution: When typing in Session B, the shared file tag can be accidentally included in the message sent to Claude, providing irrelevant file context
  2. Confusion: Users see file references in their chat that have nothing to do with the current conversation
  3. No workaround: There is no setting (claudeCode.*) to disable workspace file tags entirely

Environment

  • VS Code Extension: Claude Code v2.1.153
  • Platform: Windows 11

Proposed Fix

  • Scope workspace file tags to each individual Claude Code session
  • Or provide a setting like claudeCode.showWorkspaceFiles to disable the feature entirely

Additional Context

There is no existing claudeCode.* VS Code setting to control this behavior. The feature appears to be hardcoded in the extension's webview.

What Should Happen?

Each Claude Code session should have its own isolated workspace file context. Files created or opened in one session should not appear in the input area of other sessions.

Error Messages/Logs

Steps to Reproduce

Description

The workspace file chips/tags displayed in the chat input area are shared across all Claude Code sessions, not scoped per-session. This causes files created or opened in one session to appear in the input box of unrelated sessions.

Steps to Reproduce

  1. Open VS Code with Claude Code extension
  2. Open Session A (e.g., "futures calculator" workspace)
  3. Create or edit a file (e.g., index.html) — file tag appears in Session A's input area
  4. Switch to Session B (e.g., "Xiaohongshu workflow") in the same VS Code window
  5. Observe that Session B's chat input area now also shows the index.html file tag from Session A

Expected Behavior

Each Claude Code session should have its own isolated workspace file context. Files created in Session A should not appear in Session B's input area.

Actual Behavior

All sessions share the same workspace file tags. This is problematic because:

  1. Accidental message pollution: When typing in Session B, the shared file tag can be accidentally included in the message sent to Claude, providing irrelevant file context
  2. Confusion: Users see file references in their chat that have nothing to do with the current conversation
  3. No workaround: There is no setting (claudeCode.*) to disable workspace file tags entirely

Environment

  • VS Code Extension: Claude Code v2.1.153
  • Platform: Windows 11

Proposed Fix

  • Scope workspace file tags to each individual Claude Code session
  • Or provide a setting like claudeCode.showWorkspaceFiles to disable the feature entirely

Additional Context

There is no existing claudeCode.* VS Code setting to control this behavior. The feature appears to be hardcoded in the extension's webview.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.153

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING