[BUG] ide_selection not attached to messages for Python files (Windows)

Resolved 💬 3 comments Opened Feb 4, 2026 by SunwardGrace Closed Feb 4, 2026

Preflight Checklist

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

What's Wrong?

Bug Description

When selecting code in Python (.py) files, the selection is not automatically attached to the message (no ide_selection tag appears). However, the feature works correctly for .sh and .txt files.

Troubleshooting Attempted

  • ✅ Uninstalled Bookmark extension and reloaded VSCode - did not fix
  • ✅ Disabled Gemini CLI extension - did not fix
  • ✅ Disabled Pylance extension - did not fix
  • ✅ Checked settings.json for bookmark remnants - none found
  • ✅ Checked globalStorage for bookmark data - none found
  • ✅ Alt+K (@-Mention Reference) works correctly for Python files
  • ✅ ide_selection works correctly for .sh and .txt files
  • ✅ No relevant errors in logs when selecting Python code

Environment

  • OS: Windows
  • VSCode version: 1.108.2
  • Claude Code extension version: 2.1.31

Only ide_opened_file tag is present. The ide_selection tag is missing for Python files.

From the logs:

"content":[
  {"type":"text","text":"<ide_opened_file>...</ide_opened_file>"},
  {"type":"text","text":"user message here"}
]

What Should Happen?

The selected code should be automatically attached to the message with an ide_selection tag, as it works for .sh and .txt files.

Error Messages/Logs

"content":[
  {"type":"text","text":"<ide_opened_file>...</ide_opened_file>"},
  {"type":"text","text":"user message here"}
]

Steps to Reproduce

  1. Open a .py file in VSCode
  2. Select some code in the editor
  3. Type a message in the Claude Code chat and send it
  4. Observe that the selected code is NOT included in the message

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.14

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

The issue started after installing and then uninstalling the "Bookmarks" extension (by alefragnani)
Uninstalling Bookmark and reloading VSCode did not fix the issue
Disabling Python-related extensions (Pylance, etc.) did not fix the issue
No error messages appear in Claude Code logs (Claude Code: Show Logs)
No errors in VSCode Developer Console related to this feature

<img width="1353" height="358" alt="Image" src="https://github.com/user-attachments/assets/fc6afb38-c25c-4ce4-a317-712e39fd0f9f" />

<img width="1403" height="338" alt="Image" src="https://github.com/user-attachments/assets/c49730bf-0283-4ddb-b6af-fe8d2d2e88de" />

View original on GitHub ↗

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