[BUG] Update notification appears before brew cask is updated, causing "latest version already installed" error
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude Code shows an update notification prompting users to run brew upgrade claude-code, but the Homebrew cask hasn't been updated yet. When users run the suggested command, they get:
Warning: Not upgrading claude-code, the latest version is already installed
This happens because Homebrew casks are automatically updated every 3 hours, but Claude Code's update notification appears immediately when a new version is released on npm. This creates a window (up to ~3 hours or more on weekends) where users are told to upgrade but can't.
Reference: https://github.com/Homebrew/homebrew-cask/pull/243791
What Should Happen?
For Homebrew installations, the update notification should not appear until the new version is actually available in the Homebrew cask.
Error Messages/Logs
$ brew upgrade claude-code && claude --version
Warning: Not upgrading claude-code, the latest version is already installed
2.1.1 (Claude Code)
Steps to Reproduce
- Install Claude Code via Homebrew (
brew install claude-code) - Wait for a new Claude Code version to be released
- Within ~3 hours of release, Claude will show "Update available! Run: brew upgrade claude-code"
- Run
brew upgrade claude-code - See the warning that the latest version is already installed
Claude Model
Not applicable (this is about the CLI update notification, not model behavior)
Is this a regression?
No
Claude Code Version
2.1.1 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
This issue affects all users who installed via Homebrew. The Homebrew maintainers confirmed they check for updates every 3 hours automatically, so the fix should be on Claude Code's side to account for this delay when detecting the installation method and displaying update notifications.
Possible solutions:
- Detect if Claude was installed via Homebrew and delay the update notification by ~4 hours (I noticed that even though the cask was updated on Brew, there was still at least a 30 minutes delay before I could upgrade).
- Query the Homebrew API to check if the new version is available before showing the notification, cache the result and retry every ~15 minutes to avoid excessive API calls.
- Change the notification text for Homebrew users to mention the potential delay
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗