Skip to content

[Bug] IDE integration opens redundant integrated terminal host when inserting @-mention with external session active #73683

Description

@h-jennings

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:

  1. Run claude in an external terminal, connect it to VS Code via the IDE integration.
  2. Keep no Claude panel/webview open inside VS Code.
  3. 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

[]

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:idebugSomething isn't workingplatform:macosIssue specifically occurs on macOSplatform:vscodeIssue specifically occurs in VS Code

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions