[BUG] Skills don't receive IDE selection context (<ide_selection>) when invoked via slash command
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?
When invoking a custom skill via slash command in the VS Code extension, the skill does not receive the <ide_selection> context even when the user has code selected in their editor. The skill responds as if no selection exists and asks the user to specify a target manually.
The same <ide_selection> context IS visible in normal conversation turns — it's only missing when a skill is invoked.
What Should Happen?
Skills invoked via slash command should receive the same <ide_selection> and <ide_opened_file> context that's available in normal conversation. The skill prompt should be additive to the turn context, not replace it.
Error Messages/Logs
Steps to Reproduce
- Open a file in VS Code and select some lines of code
- In the Claude Code panel, type /skill-name (any custom skill that references IDE selection)
- The skill executes but does not see the selected code
- In contrast: type a normal message (not a slash command) with the same selection active — <ide_selection> is present in the context
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.31
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
I'm using the VSCode Claude extension v2.1.49. This issue has been opened and (wrongfully) auto-closed by the GH actions bot already: https://github.com/anthropics/claude-code/issues/6906
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗