When I run the claude CLI in an external terminal (Ghostty) with the IDE integration connected, pressing the "Insert @-Mention Reference" keybinding (cmd+opt+k → claude-code.insertAtMentioned) from the editor correctly pushes the current file to my external session — but it also opens/reveals a Claude host in VS Code's integrated terminal every time.
Digging into extension.js, the cause looks like the fallback branch in insertAtMentioned:
nativeAtMentionCallback: (h) => {
if (u.hasVisibleWebview()) return a.fire(h), true;
return false;
}
// command:
if (!nativeAtMentionCallback(a)) r.fire({}) // no visible webview → opens a terminal host
Because I keep no Claude webview open in VS Code (my real session is external), hasVisibleWebview() is false, so it falls through to spinning up an integrated-terminal host — even though an external IDE client is already attached and receiving the mention.
Repro:
- Run claude in an external terminal, connect it to VS Code via the IDE integration.
- Keep no Claude panel/webview open inside VS Code.
- Focus a file in the editor and press cmd+opt+k.
Expected: The @file reference is delivered to the connected external session; nothing else opens.
Actual: The reference reaches the external session, but VS Code also opens a redundant Claude host in the integrated terminal.
Request: When an external IDE client is already connected, skip the integrated-terminal fallback in insertAtMentioned (or add a setting to disable it). There's currently no config key that governs this behavior.
Extension version: anthropic.claude-code 2.1.199 (darwin-arm64)
Environment Info
- Platform: darwin
- Terminal: ghostty
- Version: 2.1.199
- Feedback ID: c7df6ca6-f244-4fbd-921e-8a8956183316
Errors
When I run the claude CLI in an external terminal (Ghostty) with the IDE integration connected, pressing the "Insert @-Mention Reference" keybinding (cmd+opt+k → claude-code.insertAtMentioned) from the editor correctly pushes the current file to my external session — but it also opens/reveals a Claude host in VS Code's integrated terminal every time.
Digging into extension.js, the cause looks like the fallback branch in insertAtMentioned:
Because I keep no Claude webview open in VS Code (my real session is external), hasVisibleWebview() is false, so it falls through to spinning up an integrated-terminal host — even though an external IDE client is already attached and receiving the mention.
Repro:
Expected: The @file reference is delivered to the connected external session; nothing else opens.
Actual: The reference reaches the external session, but VS Code also opens a redundant Claude host in the integrated terminal.
Request: When an external IDE client is already connected, skip the integrated-terminal fallback in insertAtMentioned (or add a setting to disable it). There's currently no config key that governs this behavior.
Extension version: anthropic.claude-code 2.1.199 (darwin-arm64)
Environment Info
Errors