VS Code extension: line selection metadata is off by one
Resolved 💬 4 comments Opened Apr 2, 2026 by brohirrim Closed May 14, 2026
Description
When selecting a line in VS Code, the Claude Code extension reports the line number in the system-reminder metadata as one less than the actual line. It appears to be sending 0-based line numbers instead of 1-based.
Steps to Reproduce
- Open a file in VS Code with the Claude Code extension enabled
- Select/highlight a specific line (e.g., line 137)
- Send a message to Claude Code referencing the selection
- Observe the
system-remindersays "The user selected the lines 136 to 136"
Expected Behavior
The reported line number should match the 1-based line number shown in the editor. Selecting line 137 should report line 137.
Actual Behavior
The reported line number is consistently off by one (0-based). Selecting line 137 reports line 136. Verified across multiple selections in the same file — always exactly -1.
Environment
- Platform: Linux
- VS Code with Claude Code extension by Anthropic
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗