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

Andrii Tykhonov Republished on 0 Bookmarks 0 Copies
Bookmark 0

Prompt template

Usage instructions
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

Provide the URL that lists the latest available version and the command to update Claude Code. The prompt checks the installed version with `claude --version`, retrieves the latest version from that URL, and compares the two; change either supplied value to use a different source or update command

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

Up to 4 results. Images up to 2 MB; MP4, WebM, or MOV videos up to 4 MB each

More prompts from this author

View all

Visit Andrii Tykhonov’s profile for their full collection