/kamal-skills:rollbackfrom kamal-skills
Roll back a Kamal deployment to a previous image when a release goes bad, and identify or check which versions are deployed. Use when the user says "roll back," "rollback," "revert to the previous version," "go back to the last working deploy," "the deploy is broken, undo it," "which version is running," or "what versions can I roll back to." Covers `kamal rollback [VERSION]`, finding rollback targets with `kamal app containers -q`, and checking versions with `kamal app version` and `kamal version`. For building and shipping new releases, see deploy. For inspecting, stopping, starting, and managing running app containers, see app.
Ships in kamal-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are an expert in deploying applications with Kamal. Your goal is to get a bad release reverted quickly and safely by rolling back to a previous, known-good image — and to help the user identify and check which versions are deployed.
Roll back when you've discovered a bad deploy and want to return to a previous image fast. A rollback is quick because the target image is already on the servers — Kamal stops the current container and starts a new one running the previous image. Nothing needs to be downloaded from the registry.
Before asking questions, check the project for context:
config/deploy.yml to confirm the service, registry, and roles in play.kamal deploy.A rollback targets a version — the Git version hash that tags the app image (for example, e5d9d7c2b898289dfbc5f7f1334140d984eedae4). When you run kamal rollback [VERSION], Kamal:
Because the image is already present on the servers, the rollback is immediate and offline-friendly — no registry pull.
Important: By default, old containers are pruned after 3 days when you run
kamal deploy. You can only roll back to a version whose container/image is still on the servers. If the target was pruned, you must redeploy that version instead (see the deploy skill).
Run:
kamal app containers -q
This gives a presentation similar to kamal app details, but it includes all the old containers as well — so you can see which previous versions are still available as rollback targets.
App Host: 192.168.0.1
CONTAINER ID IMAGE ... STATUS ... NAMES
1d3c91ed1f51 registry.../app:6ef8a6a84c525b123c5245345a8483f86d05a123 Up 19 minutes chat-6ef8a6a84c525b123c5245345a8483f86d05a123
539f26b28369 registry.../app:e5d9d7c2b898289dfbc5f7f1334140d984eedae4 Exited (1) 27 minutes ago chat-e5d9d7c2b898289dfbc5f7f1334140d984eedae4
The version is the image tag (the Git version hash), which also appears at the end of each container name. In the output above:
6ef8a6a84c525b123c5245345a8483f86d05a123 is the current version (Up).e5d9d7c2b898289dfbc5f7f1334140d984eedae4 was the previous version, available as a rollback target.Pick the last known-good hash.
For more on reading this output and the related inspection commands, see references/inspecting-versions.md.
kamal rollback e5d9d7c2b898289dfbc5f7f1334140d984eedae4
Kamal stops the current container and starts a new one running the target image. No registry download occurs.
Confirm the running version after the rollback:
kamal app version # Show the app version currently running on servers
kamal app containers -q # Re-list containers to confirm the new running container
There are three distinct "version" questions, each with its own command:
| Question | Command | What it returns |
|---|---|---|
| What app version is running on my servers? | kamal app version | The app version currently running on servers |
| Which versions can I roll back to? | kamal app containers -q | Current and old containers (each tagged with its version hash) |
| What version of Kamal itself do I have? | kamal version | The version of Kamal installed (e.g., 2.12.0) |
Don't confuse kamal app version (your app's deployed version) with kamal version (the Kamal CLI's version).
kamal deploy. If the version you want is gone, roll back is not possible — redeploy that Git version instead (see deploy).STATUS in kamal app containers -q; an Exited (1) container failed before. Choose a version that was actually healthy.kamal app version for the deployed app, kamal version for the Kamal tool.kamal deploy, and for redeploying a specific version when the rollback target has been pruned.kamal app subcommands.What SKILL.md sets; muted values are Claude Code's defaults
25 skills in this plugin
/accessoriesRun and manage accessory services — databases, Redis, search, and other long-lived dependencies your app needs — through Kamal's `accessories:` configuration and the `kamal accessory` command. Use this when the user says things like "add a MySQL/Postgres/Redis accessory," "run a database with Kamal," "kamal accessory boot," "set up a sidecar/companion service," "my app needs a cache or search container," "persist accessory data with volumes," or "reboot/restart/remove an accessory." Covers defining the accessory (image, host/hosts/role/roles/tag/tags, port, env, files, directories, volumes, network, options, registry, proxy) and operating it with boot, reboot, restart, start, stop, details, logs, exec, and remove. For passing configuration and credentials into accessories, see env and secrets. For scheduled jobs, see cron./aliasesDefine custom command aliases under the top-level `aliases` key in `config/deploy.yml` so a long, repeated `kamal` invocation becomes a single `kamal <name>`. Use it when the user says "add a Kamal alias," "shortcut kamal app exec," "make `kamal console` open a Rails console," "create a one-liner to deploy staging," "I keep retyping the same kamal command," or asks about the `aliases` config key, alias naming rules, or a `deploy -d staging` shortcut. Covers how an alias expands into a `kamal` subcommand, the lowercase letters/numbers/dashes/underscores naming rule, and the documented examples `console: app exec -i --reuse "bin/rails console"`, `uname: app exec -p -q -r web "uname -a"`, and `staging_deploy: deploy -d staging`. For the rest of `config/deploy.yml` and DRYing it up with YAML anchors, see config. For the underlying app exec / console / logs commands the aliases wrap, see app.npx claudepluginhub donnfelker/kamal-skills --plugin kamal-skillsOther plugins' skills for the same job