claude-code - 💡(How to fix) Fix [BUG] @ reference using alt+k hotkey switches claude code conversation tab on visual studio in ubuntu (and adds the reference) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56442Fetched 2026-05-06 06:27:55
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×5closed ×1commented ×1

Pressing Alt+K (default keybinding for claude-vscode.insertAtMention) throws Error: Webview is disposed inside the extension's command handler, and visibly causes VSCode focus to jump to a different editor tab instead of inserting an @-reference into the Claude chat input. The bug only manifests when the Claude chat panel is not the active editor in the rightmost editor group.

Error Message

Error: Webview is disposed at mN.assertNotDisposed (vs/workbench/api/node/extensionHostProcess.js:642:112415) at mN.reveal (vs/workbench/api/node/extensionHostProcess.js:642:112271) at pp.value (anthropic.claude-code-2.1.128-linux-x64/extension.js:805:1721) at T._deliver (extensionHostProcess.js:403:3244) at T._deliverQueue (extensionHostProcess.js:403:3333) at T.fire (extensionHostProcess.js:403:3667) at (anthropic.claude-code-2.1.128-linux-x64/extension.js:873:10672) at Pg._executeContributedCommand (extensionHostProcess.js:503:48683) at Pg.$executeContributedCommand (extensionHostProcess.js:503:49654) at i._doInvokeHandler (extensionHostProcess.js:407:157015) at i._invokeHandler (extensionHostProcess.js:407:156763) at i._receiveRequest (extensionHostProcess.js:407:155545) at i._receiveOneMessage (extensionHostProcess.js:407:154383) ... (MessagePort delivery frames)

Root Cause

Likely root cause

Code Example

[KeybindingService]: | Resolving alt+[KeyK]
[KeybindingService]: \ From 1 keybinding entries, matched claude-vscode.insertAtMention,
                      when: editorTextFocus, source: user extension Anthropic.claude-code.
[KeybindingService]: + Invoking command claude-vscode.insertAtMention.
An unknown error occurred. Please consult the log for more details.

---

Error: Webview is disposed
	at mN.assertNotDisposed (vs/workbench/api/node/extensionHostProcess.js:642:112415)
	at mN.reveal           (vs/workbench/api/node/extensionHostProcess.js:642:112271)
	at pp.value            (anthropic.claude-code-2.1.128-linux-x64/extension.js:805:1721)
	at T._deliver          (extensionHostProcess.js:403:3244)
	at T._deliverQueue     (extensionHostProcess.js:403:3333)
	at T.fire              (extensionHostProcess.js:403:3667)
	at                     (anthropic.claude-code-2.1.128-linux-x64/extension.js:873:10672)
	at Pg._executeContributedCommand (extensionHostProcess.js:503:48683)
	at Pg.$executeContributedCommand (extensionHostProcess.js:503:49654)
	at i._doInvokeHandler            (extensionHostProcess.js:407:157015)
	at i._invokeHandler              (extensionHostProcess.js:407:156763)
	at i._receiveRequest             (extensionHostProcess.js:407:155545)
	at i._receiveOneMessage          (extensionHostProcess.js:407:154383)
	... (MessagePort delivery frames)

---

Error: Webview is disposed
	at mN.assertNotDisposed (vs/workbench/api/node/extensionHostProcess.js:642:112415)
	at mN.reveal           (vs/workbench/api/node/extensionHostProcess.js:642:112271)
	at pp.value            (anthropic.claude-code-2.1.128-linux-x64/extension.js:805:1721)
	at T._deliver          (extensionHostProcess.js:403:3244)
	at T._deliverQueue     (extensionHostProcess.js:403:3333)
	at T.fire              (extensionHostProcess.js:403:3667)
	at                     (anthropic.claude-code-2.1.128-linux-x64/extension.js:873:10672)
	at Pg._executeContributedCommand (extensionHostProcess.js:503:48683)
	at Pg.$executeContributedCommand (extensionHostProcess.js:503:49654)
	at i._doInvokeHandler            (extensionHostProcess.js:407:157015)
	at i._invokeHandler              (extensionHostProcess.js:407:156763)
	at i._receiveRequest             (extensionHostProcess.js:407:155545)
	at i._receiveOneMessage          (extensionHostProcess.js:407:154383)
	... (MessagePort delivery frames)
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

claude-vscode.insertAtMention throws "Webview is disposed" and shifts editor focus when Claude chat panel is not in the rightmost editor group

Summary

Pressing Alt+K (default keybinding for claude-vscode.insertAtMention) throws Error: Webview is disposed inside the extension's command handler, and visibly causes VSCode focus to jump to a different editor tab instead of inserting an @-reference into the Claude chat input. The bug only manifests when the Claude chat panel is not the active editor in the rightmost editor group.

Environment

  • Claude Code extension: anthropic.claude-code 2.1.128 (also reproduced on 2.1.126 — same call sites)
  • VSCode: 1.118.1 (commit 034f571df509819cc10b0c8129f66ef77a542f0e), x64
  • OS: Pop!_OS 22.04 LTS, kernel 6.8.0-76060800daily20240311-generic, GNOME on X11

Steps to reproduce

  1. Open the Claude Code chat as an editor tab in a group that is not the rightmost editor group (e.g. left split of two, or middle group of three).
  2. Click into the chat input so it has focus.
  3. Press Alt+K.

Expected: an @-mention is inserted at the cursor in the chat input.

Actual: editor focus jumps to a different editor tab; the correct chat input does receive the @. Extension Host log records Error: Webview is disposed. With the chat panel in the rightmost group, the same keystroke works correctly, although the focus seems to switch back then forward.

Keybinding troubleshooter (rules out a binding conflict)

[KeybindingService]: | Resolving alt+[KeyK]
[KeybindingService]: \ From 1 keybinding entries, matched claude-vscode.insertAtMention,
                      when: editorTextFocus, source: user extension Anthropic.claude-code.
[KeybindingService]: + Invoking command claude-vscode.insertAtMention.
An unknown error occurred. Please consult the log for more details.

Extension Host stack trace (2.1.128)

Error: Webview is disposed
	at mN.assertNotDisposed (vs/workbench/api/node/extensionHostProcess.js:642:112415)
	at mN.reveal           (vs/workbench/api/node/extensionHostProcess.js:642:112271)
	at pp.value            (anthropic.claude-code-2.1.128-linux-x64/extension.js:805:1721)
	at T._deliver          (extensionHostProcess.js:403:3244)
	at T._deliverQueue     (extensionHostProcess.js:403:3333)
	at T.fire              (extensionHostProcess.js:403:3667)
	at                     (anthropic.claude-code-2.1.128-linux-x64/extension.js:873:10672)
	at Pg._executeContributedCommand (extensionHostProcess.js:503:48683)
	at Pg.$executeContributedCommand (extensionHostProcess.js:503:49654)
	at i._doInvokeHandler            (extensionHostProcess.js:407:157015)
	at i._invokeHandler              (extensionHostProcess.js:407:156763)
	at i._receiveRequest             (extensionHostProcess.js:407:155545)
	at i._receiveOneMessage          (extensionHostProcess.js:407:154383)
	... (MessagePort delivery frames)

Likely root cause

extension.js:805 calls .reveal() on a webview reference that is already disposed. The handler at extension.js:873 (the insertAtMention command path) appears to be holding a stale reference. The "non-rightmost group" precondition suggests the handler is resolving the target webview by editor-group position rather than by id, and picks the wrong (disposed) one when the live chat panel isn't where it expects.

What Should Happen?

the @ should be placed in the window without changing focus

Error Messages/Logs

Error: Webview is disposed
	at mN.assertNotDisposed (vs/workbench/api/node/extensionHostProcess.js:642:112415)
	at mN.reveal           (vs/workbench/api/node/extensionHostProcess.js:642:112271)
	at pp.value            (anthropic.claude-code-2.1.128-linux-x64/extension.js:805:1721)
	at T._deliver          (extensionHostProcess.js:403:3244)
	at T._deliverQueue     (extensionHostProcess.js:403:3333)
	at T.fire              (extensionHostProcess.js:403:3667)
	at                     (anthropic.claude-code-2.1.128-linux-x64/extension.js:873:10672)
	at Pg._executeContributedCommand (extensionHostProcess.js:503:48683)
	at Pg.$executeContributedCommand (extensionHostProcess.js:503:49654)
	at i._doInvokeHandler            (extensionHostProcess.js:407:157015)
	at i._invokeHandler              (extensionHostProcess.js:407:156763)
	at i._receiveRequest             (extensionHostProcess.js:407:155545)
	at i._receiveOneMessage          (extensionHostProcess.js:407:154383)
	... (MessagePort delivery frames)

Steps to Reproduce

Steps to reproduce

  1. Open the Claude Code chat as an editor tab in a group that is not the rightmost editor group (e.g. left split of two, or middle group of three).
  2. Click into the chat input so it has focus.
  3. Press Alt+K.

Expected: an @-mention is inserted at the cursor in the chat input.

Actual: editor focus jumps to a different editor tab; the correct chat input does receive the @. Extension Host log records Error: Webview is disposed. With the chat panel in the rightmost group, the same keystroke works correctly, although the focus seems to switch back then forward.

Claude Model

Other

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.128

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

extent analysis

TL;DR

The issue can be fixed by ensuring the insertAtMention command handler resolves the target webview by id instead of editor-group position to avoid picking a disposed webview reference.

Guidance

  • Verify that the extension.js file at line 805 is calling .reveal() on a webview reference that is already disposed, and that the handler at line 873 is holding a stale reference.
  • Check if the webview reference is being resolved by editor-group position instead of by id, which could be causing the issue when the chat panel is not in the rightmost group.
  • Consider updating the insertAtMention command handler to use a more robust method to resolve the target webview, such as using the webview's id instead of its position.
  • Test the fix by reproducing the issue and verifying that the @-mention is inserted correctly without changing focus.

Example

No code snippet is provided as the issue is related to the internal implementation of the claude-vscode extension.

Notes

The issue seems to be specific to the claude-vscode extension and its interaction with the VSCode editor. The fix may require changes to the extension's code to properly handle webview references and resolve the target webview by id.

Recommendation

Apply a workaround by modifying the insertAtMention command handler to use a more robust method to resolve the target webview, such as using the webview's id instead of its position. This should fix the issue and prevent the "Webview is disposed" error.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] @ reference using alt+k hotkey switches claude code conversation tab on visual studio in ubuntu (and adds the reference) [1 comments, 2 participants]