Check and Update Claude Code on Startup
Instruct Claude Code to compare its installed version with the latest version listed at a supplied URL and run an update command only when the versions differ
Prompt template
- Format
- Text Parameterized
- Inputs
- latest_version_url (text) · Required update_command (text) · Required
- Outputs
- version_check_and_update (text)
Check the installed Claude Code version by running `claude --version`.
Retrieve the latest available version number from ${latest-version-url} and compare it with the installed version. If the versions do not match, update Claude Code by running ${update-command}.
Replace the ${…} placeholders with your values
before using this prompt. See parameters
and defaults below
Parameters
Replace each placeholder with your own value, or use its default when one is provided
${latest-version-url}
latest-version-url
Required
${update-command}
update-command
Required
What you'll create
This prompt checks the installed Claude Code version using `claude --version` and compares it with the latest version number retrieved from a URL. If the versions do not match, it runs the supplied update command.
Usage instructions
Frequently asked questions
When does the update command run?
It runs only when the installed and latest version numbers do not match
Comments
Tried this prompt? Share what you made, compare results, or ask a question