Anthropic retires older models on a schedule and gives notice, usually a couple of months ahead. The deadline is rarely the problem. The problem is that a model name sits in a dozen places, and you remember half of them only after something breaks.
Here is the order of work.
Step 1. Find every reference
Start with a grep over the whole repository, config and infrastructure files included:
grep -rn "claude-" . \
--include="*.ts" --include="*.tsx" --include="*.py" \
--include="*.go" --include="*.yml" --include="*.yaml" \
--include="*.json" --include="*.env*" --include="*.tf"
Code is not the only place. A model name often ends up in a runner config or a Terraform file.
Step 2. Check what grep cannot see
Most forgotten references live in this list:
- environment variables in your hosting panel, on every stage separately
- CI secrets
- dashboards and alerts that filter by model name
- schedulers and background jobs that fire weekly or monthly
- documentation and READMEs, where a new developer will copy a dead ID
- fixtures and seeds in test data
Step 3. Pick the migration target
Usually the swap is a one-string change. Anthropic names a recommended replacement in the notice, and behavior barely shifts.
If you jump straight to the newest model instead of the nearest replacement, set aside time to recheck your prompts. Newer versions tend to differ in answer length and formatting habits.
Step 4. Put the model name in one constant
This settles the problem for good: a single environment variable or a single constant instead of literals scattered across the project.
export const MODEL = process.env.LLM_MODEL ?? 'claude-opus-4-8'
The next migration then comes down to editing one line in one place.
Step 5. Test against the real API, not unit tests
Unit tests usually stub the provider, so a model change slips past them. You need at least one integration run that actually calls the API.
Step 6. Set a reminder
Follow the page that lists retirement dates and set a reminder a month before each one. It costs less than debugging a broken production.
If you run through a gateway
codexkey serves stable model IDs through its own endpoint, so a version change on the provider's side does not break your code. The current model list is always on the pricing page.
The request format stays the same, Anthropic Messages and OpenAI-compatible. Leaving codexkey is as easy as arriving.