[BUG] VS Code extension, Option+K insert @-mention is inserted in the wrong place (not where the cursor is)

Resolved 💬 6 comments Opened Oct 3, 2025 by danmana Closed Dec 5, 2025

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?

If the prompt is multi-line, the Option+k action (insert @-mention) inserts the file in the wrong place, not where the cursor is

Ex: in this case my cursor was at the end of the prompt, then I clicked in the file and pressed Option+K
Instead of adding the @-mention at the end of the prompt, it got inserted in the middle of it

<img width="1405" height="621" alt="Image" src="https://github.com/user-attachments/assets/fec65831-75d9-4325-bb0f-206cedf98ed7" />

https://github.com/user-attachments/assets/bcdea156-a1ab-4f6c-9612-86050efc645a

What Should Happen?

The @-mention should be inserted where the cursor is

Error Messages/Logs

Steps to Reproduce

1, Write a multi line prompt (using shift enter), leave the cursor at the end

lorem ipsum
dolor sit amet
  1. Add a file @-mention using Option+k shortcut
  2. The @-mention is added in the wrong place
lorem ipsum
do @claude-code-add-file.md lor sit amet

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.0.5

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Cursor

Additional Information

Cmd+Option+k to add in claude code terminal works as expected, only the vscode extension has the bug

View original on GitHub ↗

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