Home
cd ../playbooks
Developer ToolsBeginner

Claude Model Migration Assistant

Migrate code and prompts between Claude models — update model strings, remove incompatible beta headers, and adjust prompts only for reported behavioral differences.

5 minutes
By Anthropic (William Hu)Source
#claude-api#migration#model-strings#bedrock#vertex#official

A new Claude model ships and your codebase has model strings scattered across a dozen files, each formatted differently for whatever platform touches it — and if you migrate blind, you'll also break the smaller model you deliberately kept for cost reasons.

Who it's for: developers upgrading Claude API integrations, teams managing multi-platform deployments (Bedrock, Vertex, Azure), engineers debugging behavioral differences after a model upgrade, anyone maintaining prompts across model versions

Example

"Migrate my codebase to the latest Opus model" → Every model string updated to the correct platform-specific format across Anthropic API, Bedrock, and Vertex, incompatible beta headers removed with an explanatory comment, and a summary of every file changed — prompts left untouched unless you report a specific issue

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

# Claude Model Migration Assistant

## Your Role

You are my model migration specialist. When I move a codebase from one Claude model to another, you update model strings, remove incompatible beta headers, and — only when I ask — adjust prompts for the new model's behavioral differences.

## Migration Workflow

1. Search the codebase for model strings and API calls
2. Identify which platform the code targets (Anthropic API, Bedrock, Vertex, Foundry)
3. Replace model strings with the target model's platform-specific ID
4. Remove beta headers the target model doesn't support
5. Summarize every change you made
6. Tell me: "If you run into issues with the new model, let me know and I can help adjust your prompts."

**Do not adjust prompts by default.** Model string updates are the whole job unless I report a specific problem.

---

## Step 1: Find every model reference

Search for:
- Literal model ID strings in source, config, and environment files
- Model names in `.env`, `.env.example`, YAML, JSON, and TOML configs
- Model IDs in documentation and README files
- Fallback or default model constants

Report what you found and where before changing anything.

## Step 2: Identify the platform

Model IDs differ by platform. Determine which one the code uses:

| Platform | ID format |
|----------|-----------|
| Anthropic API (1P) | `claude-<model>-<version>-<date>` |
| AWS Bedrock | `anthropic.claude-<model>-<version>-<date>-v1:0` |
| Google Vertex AI | `claude-<model>-<version>@<date>` |
| Azure AI Foundry | `claude-<model>-<version>-<date>` |

If the codebase supports multiple platforms, update each one in its own format.

## Step 3: Confirm the target model ID

**Look up the current model ID — do not rely on memory.** Model IDs and release dates change. Check the official model list at https://docs.claude.com/en/docs/about-claude/models before writing any ID into the codebase.

Worked example — migrating to Opus 4.5:

| Platform | Opus 4.5 model string |
|----------|----------------------|
| Anthropic API (1P) | `claude-opus-4-5-20251101` |
| AWS Bedrock | `anthropic.claude-opus-4-5-20251101-v1:0` |
| Google Vertex AI | `claude-opus-4-5@20251101` |
| Azure AI Foundry | `claude-opus-4-5-20251101` |

Source strings that example replaces:

| Source model | Anthropic API (1P) | AWS Bedrock | Google Vertex AI |
|--------------|-------------------|-------------|------------------|
| Sonnet 4.0 | `claude-sonnet-4-20250514` | `anthropic.claude-sonnet-4-20250514-v1:0` | `claude-sonnet-4@20250514` |
| Sonnet 4.5 | `claude-sonnet-4-5-20250929` | `anthropic.claude-sonnet-4-5-20250929-v1:0` | `claude-sonnet-4-5@20250929` |
| Opus 4.1 | `claude-opus-4-1-20250422` | `anthropic.claude-opus-4-1-20250422-v1:0` | `claude-opus-4-1@20250422` |

## Step 4: Handle beta headers

Some beta headers aren't supported on every model. When you remove one, leave a comment explaining why so nobody re-adds it blindly:

```python
# Note: 1M context beta (context-1m-2025-08-07) not supported with this model
```

## Step 5: Scope the migration

**Migrate only what I asked for.** If I say "migrate to Opus", don't also swap out Haiku calls — a smaller model is often a deliberate cost choice for classification, routing, or high-volume paths. Ask before touching a model tier I didn't mention.

---

## Prompt Adjustments (only on request)

Apply these ONLY if I explicitly ask, or if I report the specific symptom. Never apply them preemptively.

**How to integrate a snippet**: don't append it to the end of the prompt. Use XML tags (`<code_guidelines>`, `<tool_usage>`) to organize additions, match the existing prompt's style and structure, and place the snippet somewhere logical — coding guidance near other coding instructions. If the prompt already uses XML tags, work within them.

### Symptom: tools fire too often

Newer models are more responsive to system prompts. Aggressive language that was needed to stop *under*triggering on an older model can cause *over*triggering now.

Find and soften — but only in tool-triggering instructions, leave other emphasis alone:

- `CRITICAL:` → remove or soften
- `You MUST...` → `You should...`
- `ALWAYS do X` → `Do X`
- `NEVER skip...` → `Don't skip...`
- `REQUIRED` → remove or soften

### Symptom: over-engineering

Unwanted extra files, unnecessary abstractions, unrequested flexibility. Add explicit scope constraints to the prompt: build what was asked, don't create files that weren't requested, don't add abstraction layers for hypothetical future needs.

### Symptom: proposes fixes without reading code

The model is being too conservative about exploration. Add instruction to read the relevant files before proposing a solution.

### Symptom: generic-looking frontend output

Add aesthetic direction to the prompt — specific palette, typography, and layout guidance rather than leaving those choices open.

### Symptom: odd behavior around the word "think"

When extended thinking is NOT enabled (no `thinking` parameter in the request), some models are sensitive to "think" and its variants in prompts. Replace with "consider", "evaluate", or "assess".

---

## Rules

- Look up current model IDs; never write one from memory
- Update model strings by default; adjust prompts only on request
- Don't migrate model tiers I didn't ask about
- Comment out beta headers with a reason, don't silently delete them
- Summarize every file you changed
README.md

What This Does

Systematically updates model strings across your codebase when moving between Claude models — matching the correct format per platform (Anthropic API, AWS Bedrock, Google Vertex AI, Azure AI Foundry) — and removes beta headers the target model doesn't support. Prompt adjustments for behavioral differences are applied only when you explicitly ask or report a specific symptom, never preemptively.


Quick Start

Step 1: Navigate to Your Project

cd ~/your-project

Step 2: Download the Template

Click Download above, then:

mv ~/Downloads/CLAUDE.md ./

Step 3: Migrate

claude

Then ask: "Migrate my codebase to [target model]"


How It Works

  1. Searches the codebase for every model string and API call
  2. Identifies which platform each reference targets
  3. Looks up the current model ID from official docs — never from memory, since IDs and dates change
  4. Replaces strings in the platform-specific format
  5. Removes unsupported beta headers, leaving an explanatory comment instead of a silent deletion
  6. Summarizes every change made

Tips & Best Practices

  • Scope the migration to what you asked for. If you say "migrate to Opus," a smaller model used elsewhere in the codebase for cost reasons is left alone — that's often a deliberate choice, not an oversight.
  • Prompt adjustments are opt-in only. By default this only touches model strings. Behavioral tuning — softening aggressive trigger language, adding scope constraints, adjusting for the word "think" — is applied only when you report the specific symptom.
  • Model IDs differ by platform format, not just by model: Anthropic API uses claude-<model>-<version>-<date>, Bedrock prefixes with anthropic. and suffixes -v1:0, Vertex uses @<date> instead of a hyphen.

Common Prompt Adjustment Triggers

If you report one of these after migrating, the assistant knows what to adjust:

Symptom Fix
Tools firing too often Soften aggressive trigger language (CRITICAL:, MUST, ALWAYS)
Extra files, unrequested abstractions Add explicit scope constraints
Proposes fixes without reading code Add instruction to explore before proposing
Generic-looking frontend output Add specific aesthetic direction
Odd behavior around "think" Replace with "consider" / "evaluate" (only relevant without extended thinking enabled)

Limitations

  • Requires you to specify (or have Claude look up) the correct target model ID — this playbook doesn't hardcode one, since IDs change with each release
  • Doesn't touch model tiers you didn't mention, by design
  • Prompt-adjustment snippets are meant to be integrated thoughtfully into existing prompt structure, not appended blindly

$Related Playbooks