[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:

  1. Claude Code CLI should show "Selected: X lines from file.py"
  2. Claude should be able to reference the selected code without copy/paste

Actual Behavior

  • IDE connection: ✅ (lock file exists, /ide shows connected)
  • Extension GUI selection: ✅ (can read selected lines)
  • CLI TUI selection: ❌ (no indication of selected code, ide_selection missing)

Steps to Reproduce

  1. Open a project in Windsurf on macOS
  2. Start Claude Code CLI in the same directory
  3. Verify IDE connection with /ide command
  4. Select some code in Windsurf
  5. Extension GUI correctly shows the selection
  6. 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:
  1. WebSocket not sending selection events to CLI, or
  2. CLI not correctly subscribing to selection events, or
  3. Protocol mismatch between Extension and CLI versions

View original on GitHub ↗

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