New versions of the three assistants come out often. They bring fixes, new commands and support for new models. This guide shows how to check which version you have and how to update each tool.
Type every command in this guide in the terminal (Terminal on a Mac, PowerShell on Windows), not inside a chat with the assistant. You need the assistant installed already. If it is not, read Install Claude Code, Install Codex CLI or Install Gemini CLI first.
The right update command depends on how you installed the tool. If you do not remember, look at the install guide you used and pick the same method below.
1. Check which version you have
Claude Code:
claude --versionCodex CLI:
codex --versionGemini CLI (gemini -v also works):
gemini --versionEach command prints a version number. Write it down, so you can compare it after the update.
2. Update Claude Code
Official installer (the native install): Claude Code updates itself. It checks for updates when it starts and while it runs, and downloads them in the background. A new version takes effect the next time you start Claude Code. To update straight away, run:
claude updateIt reports Successfully updated from <old version> to version <new version>. If you already have the newest version, it reports Claude Code is up to date (<version>).
Homebrew on a Mac: Homebrew installs do not update themselves. Run:
brew upgrade claude-codeIf you installed the claude-code@latest cask, run this instead:
brew upgrade claude-code@latestThe claude-code cask follows the stable channel, which is usually about a week behind. The claude-code@latest cask gets new versions as soon as they come out.
WinGet on Windows: WinGet installs do not update themselves either. Run:
winget upgrade Anthropic.ClaudeCodeTo see the result of the last automatic update, run:
claude doctorclaude doctor checks your install and settings and prints any warnings with suggested fixes. It does not start a session.
3. Update Codex CLI
Codex has its own update command. It works when the version you installed supports self-update:
codex updateIf it does not, run the update command for your install method. OpenAI lists these on the Codex CLI page.
Mac or Linux, standalone installer: the update command is the same as the install command:
curl -fsSL https://chatgpt.com/codex/install.sh | shWindows, standalone installer: open a new PowerShell window and run:
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"npm: the update command is the same as the install command:
npm install -g @openai/codexHomebrew:
brew upgrade --cask codex4. Update Gemini CLI
Gemini CLI has an update command:
gemini updateIf you installed with npm, you can also ask npm for the latest version:
npm install -g @google/gemini-cli@latestExtensions (add-ons for Gemini CLI) update separately. To update all of them:
gemini extensions update --all5. Restart and check
Close the assistant if it is running. Open a new terminal window and run the version command from step 1 again. You see the new number.
If you see an error
- Claude Code says
Claude is up to date!: this message comes from installs made with Homebrew, WinGet or apk (a Linux package manager). These installs do not update themselves. Use the Homebrew or WinGet command in step 2, or your Linux package manager. - Claude Code says
Claude Code is up to date (<version>), but you expected a newer version: your update channel may bestable, which gets new versions later thanlatest. Type/configin a Claude Code session and look at Auto-update channel. - Claude Code does not update after you replaced
~/.local/bin/claudewith your own link or script:claude doctorreports this custom launcher. Remove that file and runclaude update. Claude Code then manages the launcher again. - An npm install of Claude Code cannot update itself: the npm folder is not writable. Claude Code shows a one-time notice when it starts, and
claude doctorlists the fixes. codex updatedoes not update your copy: not every Codex install supports self-update. Use the command for your install method in step 3.- The version number did not change: close every terminal window and open a new one. An old window can still use the old copy.
Sources
- code.claude.com/docs/en/setup
- learn.chatgpt.com/docs/codex/cli
- learn.chatgpt.com/docs/developer-commands?surface=cli
- github.com/openai/codex/blob/main/codex-rs/cli/src/main.rs
- github.com/google-gemini/gemini-cli/blob/main/docs/cli/cli-reference.md
- github.com/google-gemini/gemini-cli/blob/main/README.md