claude-code - 💡(How to fix) Fix VSCode Extension: Add setting to disable automatic IDE selection/context injection into conversations [1 participants]

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…
GitHub stats
anthropics/claude-code#45344Fetched 2026-04-09 08:07:31
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×4

Fix Action

Fix / Workaround

Current workarounds (all inadequate)

RAW_BUFFERClick to expand / collapse

Problem

The VSCode extension automatically injects IDE selection context (selected text, open file paths) into new Claude Code conversations. There is no setting to disable this behavior.

This causes cross-contamination between unrelated work sessions. In a multi-ticket workflow where different files from different tickets may be open in the editor, starting a new conversation about Ticket B will silently inject file paths and content from Ticket A if those files happen to be open or selected.

Real-world impact

In our case, the agent picked up a scratch directory path from an unrelated ticket's file that was open in the IDE (c:\repo\temp\tickets\ltcrcm-1317\scratch\investigate-output.txt) and used it as the working directory for a completely different ticket (LTCRCM-1360). This broke ticket isolation and could have caused cross-contamination of investigation artifacts between tickets.

The injected context appears in <ide_selection> tags and is presented as "The user selected the lines X to Y from [path]" — which makes the agent treat it as relevant context even when it has nothing to do with the user's actual request.

Requested behavior

Add a VSCode extension setting (e.g., claude-code.includeIdeSelection: true|false) to completely disable automatic injection of IDE selection context into conversations. Default can remain true for backwards compatibility, but users working across multiple concurrent workstreams need the ability to start clean conversations without IDE bleed-through.

Current workarounds (all inadequate)

  • Eye icon toggle: Must be clicked manually every single conversation — easy to forget
  • Close all other files: Impractical when working across multiple tickets
  • Separate VSCode windows: Heavy-handed; defeats the purpose of a single workspace
  • Use CLI instead: Loses all VSCode integration benefits

Environment

  • Claude Code VSCode Extension
  • Windows 11
  • Multi-ticket development workflow with file-based ticket isolation

extent analysis

TL;DR

Add a VSCode extension setting to disable automatic injection of IDE selection context into conversations.

Guidance

  • Consider adding a claude-code.includeIdeSelection setting to the VSCode extension to allow users to opt-out of automatic IDE selection context injection.
  • Evaluate the impact of setting claude-code.includeIdeSelection to false on the current workflow and identify potential edge cases.
  • Review the current workarounds and assess their feasibility in the short term until a permanent solution is implemented.
  • Investigate the possibility of implementing a "clean conversation" mode or button that resets the conversation context.

Example

No code snippet is provided as the issue does not imply a specific code solution.

Notes

The solution may require changes to the VSCode extension, and it is essential to consider backwards compatibility and potential edge cases.

Recommendation

Apply workaround: Add a claude-code.includeIdeSelection setting to the VSCode extension. This will provide users with the ability to disable automatic IDE selection context injection and start clean conversations without IDE bleed-through.

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