[BUG] ide_selection not passed from Extension to CLI in Windsurf on macOS
Resolved 💬 5 comments Opened Jan 12, 2026 by 0xhardman Closed Feb 28, 2026
Preflight Checklist
- [x] I have searched for similar issues and this is not a duplicate
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
Environment
- OS: macOS 15.7.2 (arm64)
- Claude Code CLI: 2.1.5
- IDE: Windsurf
- Extension version: 2.1.5
Bug Description
IDE connection works (lock files are created), but ide_selection context is not passed from Extension to CLI.
Key finding: The Extension GUI can correctly read and display the selected lines, but the CLI TUI cannot receive them. This suggests the issue is in the WebSocket communication between Extension and CLI, not in the Extension's selection capture logic.
Expected Behavior
When selecting code in Windsurf:
- Claude Code CLI should show "Selected: X lines from file.py"
- Claude should be able to reference the selected code without copy/paste
Actual Behavior
- IDE connection: ✅ (lock file exists,
/ideshows connected) - Extension GUI selection: ✅ (can read selected lines)
- CLI TUI selection: ❌ (no indication of selected code,
ide_selectionmissing)
Steps to Reproduce
- Open a project in Windsurf on macOS
- Start Claude Code CLI in the same directory
- Verify IDE connection with
/idecommand - Select some code in Windsurf
- Extension GUI correctly shows the selection
- CLI TUI does not receive the selection
What I've Tried
- [x] Deleted all lock files in
~/.claude/ide/ - [x] Closed all IDEs and opened only one Windsurf window
- [x] Reinstalled Windsurf extension (temporarily fixed, but issue returned)
- [x] Removed duplicate Claude Code installations (npm, brew)
- [x] Using single Claude Code installation (
~/.claude/local/claude)
Additional Context
- Issue appeared after upgrading to Claude Code 2.0+
- Reinstalling the extension temporarily fixed it, but the problem returned after some time
- The fact that Extension GUI works but CLI doesn't suggests the bug is in:
- WebSocket not sending selection events to CLI, or
- CLI not correctly subscribing to selection events, or
- Protocol mismatch between Extension and CLI versions
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗