Rollback a Deployment
Emergency rollback process when a deploy goes wrong
CLAUDE.md
When rolling back a deployment:
- Confirm the issue is caused by the deployment, not an unrelated outage.
- Execute the rollback: redeploy the previous known-good version or switch traffic back to the old deployment.
- Verify the rollback: check the health endpoint, error rates, and critical user flows.
- If there are database migrations that need reverting, run the down migration carefully.
- Notify the team that a rollback occurred and why.
- Investigate the root cause on the failed deployment branch. Do not re-deploy until the issue is understood and fixed.
Copy this workflow into your CLAUDE.md or agent config file so your agent follows this process automatically.