[BUG] Wrong VS Code row number for the selected line reported

Resolved 💬 2 comments Opened Apr 3, 2026 by shillem Closed Apr 3, 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?

When asked about what is the line number for the text selected in the VS Code editor, Claude reports the wrong line number, it's off by 1. See video.

https://github.com/user-attachments/assets/1bbffcc5-2e93-42c7-9121-ef8a2f981f69

What Should Happen?

The right line number should be reported. This impacts LSP capabilities as Claude code is running queries with the wrong line number.

Error Messages/Logs

Steps to Reproduce

  1. Connect Claude Code to VS Code
  2. Open any file and select a specific line
  3. Ask Claude Code to report what is the row number for the selected line

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.91

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

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