[BUG] Off-by-one error in adding line numbers in VS Code extension

Status Open
Maintainer reply None cached
Activity 0 comments · opened Jul 20, 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?

"insertAtMention" command includes one line after the highlighted lines, potentially confusing the LLM about what the user is attempting to focus on.

The workaround is to select the line(s), and then back up to before the last line's virtual newline character.

What Should Happen?

Only lines containing highlighted content should be included in the @mention.

Error Messages/Logs

Steps to Reproduce

  1. Go to the start of a line you want to @mention.
  2. Press shift+down arrow to select the line(s).
  3. Press the hotkey to add that to the conversation.

<img width="527" height="110" alt="Image" src="https://github.com/user-attachments/assets/d87882a3-29ea-433d-98a6-491b6a21d642" />

Result: Get the line numbers for the highlighted line(s), PLUS the line the cursor is on, even though nothing on the last line is selected.

<img width="620" height="102" alt="Image" src="https://github.com/user-attachments/assets/e1a1b26a-cf7d-4f92-8c8c-7b654df45558" />

Claude Model

Not sure / Multiple models

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

Not relevant; extension issue, not claude code

Platform

Other

Operating System

macOS

Terminal/Shell

Other

Additional Information

This happens on platforms other than MacOS.

View original on GitHub ↗