claude-code - 💡(How to fix) Fix [BUG] VS Code extension host hangs on launch (onWillSaveTextDocument timeout) [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#56200Fetched 2026-05-06 06:34:31
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1cross-referenced ×1

Error Message

Error Messages/Logs

[error] Aborted onWillSaveTextDocument-event after 1750ms

Fix Action

Fix / Workaround

Workaround: code --disable-extension Anthropic.claude-code.

Code Example

[info] Extension host (LocalProcess pid: 81636) is unresponsive.
[error] Aborted onWillSaveTextDocument-event after 1750ms
    at vscode-file://vscode-app/.../workbench.desktop.main.js:1039:13000

---

[info] AuthManager initialized
[info] Claude code extension is now active?
[info] MCP Server running on port 63579 (localhost only)
[info] Getting authentication status
[info] OAuth tokens found in secure storage
[info] Received message from webview: {"type":"request","requestId":"...","request":{"type":"init"}}
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?

The Claude Code VS Code extension hangs the extension host ~5–10 seconds after activation, on every launch. The extension itself activates successfully — OAuth token is found, MCP server starts, the webview sends an init message — and then the host becomes unresponsive. The whole window becomes unusable (editor stuck loading, extensions panel spinner, no input response) until I force-quit and relaunch with --disable-extension Anthropic.claude-code.

Tested two versions and both reproduce identically: 2.1.128 (marketplace) and 2.1.119 (nixpkgs).

What Should Happen?

Extension should activate without blocking the extension host. VS Code should remain responsive.

Error Messages/Logs

From ~/Library/Application Support/Code/logs/<timestamp>/:

renderer.log:

[info] Extension host (LocalProcess pid: 81636) is unresponsive.
[error] Aborted onWillSaveTextDocument-event after 1750ms
    at vscode-file://vscode-app/.../workbench.desktop.main.js:1039:13000

window1/exthost/Anthropic.claude-code/Claude VSCode.log:

[info] AuthManager initialized
[info] Claude code extension is now active?
[info] MCP Server running on port 63579 (localhost only)
[info] Getting authentication status
[info] OAuth tokens found in secure storage
[info] Received message from webview: {"type":"request","requestId":"...","request":{"type":"init"}}

Last extension log entry at T+3.7s after activation. Extension host marked unresponsive at T+6.9s. No further log entries from the extension.

Steps to Reproduce

  1. Install the Claude Code VS Code extension
  2. Sign in with OAuth (so credentials are stored)
  3. Launch VS Code

Hangs deterministically every launch. Bouncing the app does not help.

Workaround: code --disable-extension Anthropic.claude-code.

Claude Model

Not relevant — the extension hangs before any model is queried.

Is this a regression?

I don't know.

Last Working Version

Unknown. Both 2.1.119 and 2.1.128 hang. Earlier versions not tested.

Claude Code Version

VS Code extension anthropic.claude-code 2.1.128 (also 2.1.119)

Platform

VS Code extension

Operating System

macOS (Darwin 25.3.0), Apple Silicon, VS Code 1.118.1

Additional Information

The hang only surfaced after I made ~/Library/Application Support/Code/User/settings.json writable. Previously, the file was a read-only symlink (managed via Nix home-manager) and the extension's attempts to persist claudeCode.preferredLocation were failing with EACCES — and the extension host did not hang.

After making the file writable, the extension's first write succeeded (the key "claudeCode.preferredLocation": "panel" appeared in the file), and the host hang began on every subsequent launch.

This strongly suggests a code path that's only entered after a successful settings write — possibly an onWillSaveTextDocument handler in the extension that loops or blocks. The Aborted onWillSaveTextDocument-event after 1750ms line in renderer.log supports this.

Other extensions installed: Copilot, Copilot Chat, LaTeX Workshop, Python, Pylance, Vim (vscodevim), Markdown All-in-One, debugpy. Disabling Claude Code alone resolves the issue.

extent analysis

TL;DR

The issue can likely be fixed by modifying the Claude Code extension to handle the onWillSaveTextDocument event without blocking or looping.

Guidance

  • Investigate the onWillSaveTextDocument event handler in the Claude Code extension to identify potential blocking or looping code.
  • Verify that the extension's settings write operation is not causing a deadlock or infinite loop.
  • Check if the claudeCode.preferredLocation setting is being written correctly and if it's related to the hang issue.
  • Consider adding logging or debugging statements to the extension's code to better understand the execution flow and identify the root cause.

Example

No code snippet is provided as the issue is related to a specific extension and its internal implementation.

Notes

The issue seems to be specific to the Claude Code extension and its interaction with the VS Code settings and events. The fact that disabling the extension resolves the issue suggests that the problem lies within the extension's code.

Recommendation

Apply a workaround by disabling the Claude Code extension until a fixed version is available, as the root cause of the issue is likely related to the extension's internal implementation.

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] VS Code extension host hangs on launch (onWillSaveTextDocument timeout) [1 comments, 2 participants]