[BUG] VS Code extension host hangs on launch (onWillSaveTextDocument timeout)
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?
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
- Install the Claude Code VS Code extension
- Sign in with OAuth (so credentials are stored)
- 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.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗