Claude Code|卸载并安装旧版本

了解如何管理 Claude Code 的可执行文件路径,掌握使用 bun、npm 或 volta 安装与卸载的命令方式。

Claude Code|卸载并安装旧版本

查看可执行文件路径

使用 /doctor 命令可以安装可执行文件的路径:

卸载

使用 bun 安装了 Claude Code,卸载:

bun remove -g @anthropic-ai/claude-code

使用 npm 安装,则:

npm uninstall -g @anthropic-ai/claude-cli

使用 volta 删除,

volta uninstall @anthropic-ai/claude-code
volta list all

安装

建议使用 bun 来安装:

bun install -g @anthropic-ai/claude-code@1.0.38

卸载并重装之后,session 信息不会退出。

claude opus 4.1

低版本默认使用 opus 4.0,我们可以手动设置模型:

/model claude-opus-4-1-20250805