Claude Codeは頻繁にアップデートされ、新機能やバグ修正が追加されています。この記事では、Claude Codeを最新版に更新する方法を詳しく解説します。
現在のバージョンを確認する
更新前に、まず現在のバージョンを確認しましょう。
claude --version
updateコマンドによる更新
Claude Code内蔵のupdateコマンドで簡単に更新できます。
基本的な更新方法
Claude Codeを起動して:
claude
その後、以下のコマンドを入力:
/update
または、ターミナルから直接:
claude update
インストール方法別の更新手順
npmでインストールした場合
npm update -g @anthropic-ai/claude-code
claude --version
特定のバージョンにアップデート:
npm install -g @anthropic-ai/claude-code@1.0.95
Homebrewでインストールした場合(macOS)
brew update
brew upgrade claude-code
npxで使用している場合
キャッシュが古い場合は強制的に最新版を取得:
npx @anthropic-ai/claude-code@latest
自動更新の設定
~/.claude/settings.jsonを編集:
{
"autoUpdate": true
}
無効化する場合はfalseに設定。
トラブルシューティング
権限エラー
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
ネットワークエラー
npm config set registry https://registry.npmjs.org/
更新後に動作しない
npm cache clean --force
npm uninstall -g @anthropic-ai/claude-code
npm install -g @anthropic-ai/claude-code
バージョンが変わらない
hash -r # bashの場合
rehash # zshの場合
特定バージョンへのダウングレード
npm view @anthropic-ai/claude-code versions
npm install -g @anthropic-ai/claude-code@1.0.90
まとめ
方法 | コマンド |
|---|---|
組み込みコマンド |
|
npm |
|
Homebrew |
|
npx |
|
最新版には新機能やセキュリティ修正が含まれるため、定期的な更新をお勧めします。