Claude Code VS Code 扩展在多个聊天标签页时冻结?Windows 解决方法

发布: (2026年3月1日 GMT+8 09:09)
3 分钟阅读
原文: Dev.to

Source: Dev.to

问题

Claude Code VS Code 扩展在打开多个聊天标签页(代理)时可能会冻结或卡住。问题的根源是多个 claude.exe 进程竞争同一个 ~/.claude.json 文件,而没有任何文件锁定机制。

Anthropic 在 2.0.61 版本的更新日志中写道:

由于响应性问题,已撤销对多个终端客户端的 VSCode 支持。

他们先添加了多标签页支持,发现出现问题后又撤回。2.0.61 之前的版本(例如 2.0.60)在多标签页下可以正常工作。

解决办法

1. 安装 2.0.60 版本并关闭自动更新

  1. 从扩展市场下载 2.0.60 的 VSIX 包。
  2. 手动安装(扩展 → 从 VSIX 安装…)。
  3. 关闭该扩展的自动更新,以防止它被升级到 2.0.61 或更高版本。

2. 为 claude.exe 打补丁,使其识别 Opus 4.6

2.0.60 版本硬编码了模型标识符 claude‑opus‑4‑5‑20251101,因此无法识别更新的 Opus 4.6 模型。下面的 PowerShell 脚本会备份原始二进制文件,并将所有旧标识符替换为 claude‑opus‑4‑6

# Back up the original binary
$dir = "$env:USERPROFILE\.vscode\extensions\anthropic.claude-code-2.0.60-win32-x64\resources\native-binary"
Copy-Item "$dir\claude.exe" "$dir\claude.exe.bak"

# Load the binary into memory
$bytes = [System.IO.File]::ReadAllBytes("$dir\claude.exe")
$enc   = [System.Text.Encoding]::GetEncoding("iso-8859-1")
$text  = $enc.GetString($bytes)

# Replace all occurrences
$idx   = 0
$count = 0
while (($idx = $text.IndexOf('"claude-opus-4-5-20251101"', $idx)) -ne -1) {
    $replacement = $enc.GetBytes('"claude-opus-4-6"         ')   # keep same length
    [Array]::Copy($replacement, 0, $bytes, $idx, $replacement.Length)
    $count++
    $idx += 26   # length of the original string
}

# Write the patched binary back to disk
[System.IO.File]::WriteAllBytes("$dir\claude.exe", $bytes)
Write-Host "Patched $count occurrence(s)."

脚本应报告 6 处 已被修补。

修补完成后,重新启动 VS Code。当你询问模型 “What model are you?” 时,它现在应该返回 Opus 4.6

3. 调整 Cursor 的路径(可选)

如果你同时使用 Cursor 扩展,请将其路径更新为指向已修补的 claude.exe(例如 \.cursor\extensions\...)。

4. 恢复原始二进制文件

要恢复未修改的版本:

Copy-Item "$dir\claude.exe.bak" "$dir\claude.exe" -Force

或者手动用备份文件替换 claude.exe

在安装了 2.0.60 版本并对二进制文件打补丁后,Claude Code 扩展在 Windows 上的多个聊天标签页中即可平稳运行。

0 浏览
Back to Blog

相关文章

阅读更多 »

欢迎(回)来到 Macintosh

macOS 可靠性问题 – 摘要 以下描述的所有问题都可以追溯到完全由 Apple 控制的组件。没有任何问题是不可解决的……