Overview
Keeping Claude Code CLI up to date gives you new features, bug fixes, and performance improvements. Claude Code has a built-in self-update command, so there is no need to worry about package managers.
Core Principles:
- Use
claude updatefor one-click updates - Verify the version number after updating
When to Use
- The user sees a version update prompt or wants to check whether there is a new version
- Encountering feature issues, suspecting they are caused by an old version
- Need to use the latest features (such as new Agents or tools)
When Not to Use
- First-time installation of Claude Code → use the official installation guide
- Configuration issues (unrelated to the version) → check the configuration file
Update Process
Step 1: Check the current version
claude --version
Record the current version number for later comparison.
Step 2: Perform the update
claude update
This is the only update command. Claude Code will automatically detect the installation method and complete the update, with no need to manually select a package manager.
Step 3: Verify the update
claude --version
Confirm that the version number has been updated.
Step 4: Output the changelog (if there is an update)
If the version number has changed,you mustoutput the changelog from the old version to the new version.
Prerequisite: Skip this step if the old and new version numbers are the same.
Changelog Sources:https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md
How to Obtain:
# 方法 1: 使用 gh api(推荐)
gh api repos/anthropics/claude-code/contents/CHANGELOG.md --jq '.content' | base64 -d
# 方法 2: 使用 curl
curl -s https://raw.githubusercontent.com/anthropics/claude-code/main/CHANGELOG.md
Output Requirements:
-
Key Content(by priority):
- 🚀 New Features: newly added commands, APIs, configuration options, platform support, etc.
- ⚠️ Important Changes: breaking changes, removed features, configuration migration requirements
- 🐛 Key Fixes: important bug fixes that affect stability
- ⚡ Performance Improvements: significant performance optimizations
-
Output Format:
## 更新摘要
| 组件 | 旧版本 | 新版本 | 版本跨度 |
|------|--------|--------|----------|
| Claude Code | x.y.z | X.Y.Z | N 个版本 |
---
## Claude Code 更新日志 (vx.y.z → vX.Y.Z)
### vX.Y.Z (日期) 🎉 Latest
**🚀 新功能**
- [功能名]: [描述]
**⚠️ 重要变更**
- [变更描述]
**🐛 关键修复**
- [修复描述]
- Notes:
- Only output the changes between the old version and the new version
- Sort by version number from old to new
- If the version span exceeds 5 versions, only output detailed information for the most recent 5 versions, and briefly cover the rest
- Output in Chinese
- Purely technical refactors or internal improvements can be mentioned briefly or omitted