claude-code - 💡(How to fix) Fix [BUG] Auto-updater silently fails on Windows when VS Code extension is active (regression since 2.1.147)

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…

Error Message

Until ~May 13, 2026 the Claude Code CLI auto-updater worked daily without intervention on my Windows + VS Code setup. Since then, it silently stopped advancing past 2.1.145, skipping 2.1.146, 2.1.147, 2.1.148, 2.1.149 over multiple days. No prompt, no notification, no visible error — the CLI just stayed pinned to 2.1.145 while npm had newer versions available. Suspected cause: the 2.1.147 changelog states "Improved auto-updater: retries transient network failures, reports specific error categories and OS error codes on failure, and shows the current version when an update fails". The pre-2.1.147 auto-updater apparently used a binary-replacement strategy (rename + replace, or detached spawn) that bypassed the Windows file lock held by the VS Code extension. The new updater in 2.1.147+ no longer bypasses this lock, so on Windows + VS Code extension active the update fails silently and the user stays on the old version indefinitely with no signal. This is consistent with existing issue #13085 ("Another process is currently updating Claude"), but with a critical difference: there is no user-visible prompt or error — the auto-updater fails silently.

Error Messages/Logs

npm error code EBUSY npm error syscall copyfile npm error path C:\Users<user>\AppData\Roaming\npm\node_modules@anthropic-ai\claude-code\node_modules@anthropic-ai\claude-code-win32-x64\claude.exe npm error dest C:\Users<user>\AppData\Roaming\npm\[email protected]\node_modules@anthropic-ai\claude-code-win32-x64\claude.exe npm error errno -4082 npm error EBUSY: resource busy or locked, copyfile '...claude.exe' -> '...claude.exe'

Root Cause

A manual npm install -g @anthropic-ai/claude-code@latest from an external admin cmd succeeds only after closing all VS Code windows. Run from inside VS Code or with the extension still active, it fails with EBUSY because the VS Code extension keeps claude.exe file-locked.

Code Example

npm error code EBUSY
npm error syscall copyfile
npm error path C:\Users\<user>\AppData\Roaming\npm\node_modules\@anthropic-ai\claude-code\node_modules\@anthropic-ai\claude-code-win32-x64\claude.exe
npm error dest C:\Users\<user>\AppData\Roaming\npm\node_modules\@anthropic-ai\.claude-code-RuDGmORB\node_modules\@anthropic-ai\claude-code-win32-x64\claude.exe
npm error errno -4082
npm error EBUSY: resource busy or locked, copyfile '...claude.exe' -> '...claude.exe'

Full log: C:\Users\<user>\AppData\Local\npm-cache\_logs\2026-05-23T07_03_51_287Z-debug-0.log
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?

Until ~May 13, 2026 the Claude Code CLI auto-updater worked daily without intervention on my Windows + VS Code setup. Since then, it silently stopped advancing past 2.1.145, skipping 2.1.146, 2.1.147, 2.1.148, 2.1.149 over multiple days. No prompt, no notification, no visible error — the CLI just stayed pinned to 2.1.145 while npm had newer versions available.

A manual npm install -g @anthropic-ai/claude-code@latest from an external admin cmd succeeds only after closing all VS Code windows. Run from inside VS Code or with the extension still active, it fails with EBUSY because the VS Code extension keeps claude.exe file-locked.

Suspected cause: the 2.1.147 changelog states "Improved auto-updater: retries transient network failures, reports specific error categories and OS error codes on failure, and shows the current version when an update fails". The pre-2.1.147 auto-updater apparently used a binary-replacement strategy (rename + replace, or detached spawn) that bypassed the Windows file lock held by the VS Code extension. The new updater in 2.1.147+ no longer bypasses this lock, so on Windows + VS Code extension active the update fails silently and the user stays on the old version indefinitely with no signal.

This is consistent with existing issue #13085 ("Another process is currently updating Claude"), but with a critical difference: there is no user-visible prompt or error — the auto-updater fails silently.

What Should Happen?

Either: (a) The CLI updates successfully via the same out-of-process / rename-replace strategy used pre-2.1.147, OR (b) The CLI surfaces a clear, persistent notification that the auto-update has failed and manual intervention is needed (citing the EBUSY/lock cause and suggesting "close VS Code and run npm install -g @anthropic-ai/claude-code@latest").

Error Messages/Logs

npm error code EBUSY
npm error syscall copyfile
npm error path C:\Users\<user>\AppData\Roaming\npm\node_modules\@anthropic-ai\claude-code\node_modules\@anthropic-ai\claude-code-win32-x64\claude.exe
npm error dest C:\Users\<user>\AppData\Roaming\npm\node_modules\@anthropic-ai\.claude-code-RuDGmORB\node_modules\@anthropic-ai\claude-code-win32-x64\claude.exe
npm error errno -4082
npm error EBUSY: resource busy or locked, copyfile '...claude.exe' -> '...claude.exe'

Full log: C:\Users\<user>\AppData\Local\npm-cache\_logs\2026-05-23T07_03_51_287Z-debug-0.log

Steps to Reproduce

  1. Install Claude Code CLI globally via npm on Windows: npm install -g @anthropic-ai/claude-code
  2. Install the anthropic.claude-code VS Code extension and keep VS Code open.
  3. Use Claude Code daily for ~1 week across multiple npm releases.
  4. Observe: claude --version stays pinned to the version installed at step 1; the CLI never updates despite newer versions being available on npm.
  5. Attempt manual npm install -g @anthropic-ai/claude-code@latest from within VS Code's integrated terminal or while VS Code is open → fails with EBUSY.
  6. Close all VS Code windows, run the same command from external admin cmd → succeeds.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.145

Claude Code Version

2.1.150 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

Related issues:

  • #13085 (lock during external claude update)
  • #6484 / #6555 (infinite update prompt loop — same root cause, different surface symptom)
  • #53969 (auto-update behavior issues on VS Code extension)

The 2.1.148 release already contains a fix for another regression introduced by 2.1.147 ("Fixed the Bash tool returning exit code 127 on every command for some users, a regression introduced in 2.1.147"), suggesting the 2.1.147 release introduced multiple regressions. This auto-updater issue may be another one in the same cluster.

Setup details:

  • Claude Code CLI: was 2.1.145, manually upgraded to 2.1.150 today
  • Claude Code VS Code extension: 2.1.145 (anthropic.claude-code), auto-update enabled, marketplace currently shows no newer version available
  • OS: Windows 11 Pro 10.0.26200
  • npm global install path: C:\Users<user>\AppData\Roaming\npm\

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] Auto-updater silently fails on Windows when VS Code extension is active (regression since 2.1.147)