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

Get new playbooks like this one

One email a week with new Claude Code workflows. Free, like everything here.

No spam. Unsubscribe anytime.

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

Developer Tools

Claude Code Plugin Builder

End-to-end guided workflow for building Claude Code plugins — structure, commands, agents, skills, hooks, and MCP integration — with a validation checklist before you distribute.

15 minutes
Advanced
Developer Tools

CLAUDE.md Progressive Disclosurer

Slim down and restructure a bloated CLAUDE.md (or AGENTS.md) using progressive disclosure — move low-frequency detail to Level 2 references while keeping Level 1 lean, with zero information loss.

15 minutes
Intermediate
Developer Tools

Claude Usage Analyst

Analyze Claude Code token usage, cost, quota burn, model mix, and cache read/write using ccusage evidence — and explain in human terms why your quota got exhausted.

10 minutes
Beginner
Developer Tools

CLI Demo Generator

Generate professional animated CLI demos as GIFs using VHS terminal recordings — with self-bootstrapping setup, output filtering, and frame-level verification.

15 minutes
Intermediate
Developer Tools

Cloudflare Troubleshooting

Investigate and resolve Cloudflare issues with API-driven evidence — ERR_TOO_MANY_REDIRECTS, SSL mode mismatches, DNS, and proxy problems — instead of guessing.

15 minutes
Intermediate
Developer Tools

Changelog Generator

Generate release notes from git commits, updates, or feature lists

10 minutes
Advanced
Developer Tools

CI/CD Pipeline Generator

Create production-ready CI/CD pipeline configurations for GitHub Actions, GitLab CI, CircleCI, and Jenkins with deployment to Vercel, Netlify, or AWS.

15 minutes
Intermediate
Developer Tools

Codebase Documenter

Create comprehensive, beginner-friendly documentation for codebases including READMEs, architecture guides, API docs, and code comments.

10 minutes
Beginner
Developer Tools

Docker Containerization

Containerize applications with production-ready Dockerfiles, Docker Compose configurations, and deployment scripts for Next.js, React, and Node.js projects.

15 minutes
Intermediate
Developer Tools

DevOps Server Manager

Manage servers, Docker containers, VMs, and network infrastructure through Claude Code via SSH. Keep your entire infrastructure documented in markdown files.

15 minutes
Advanced
Developer Tools

Error Message Explainer — Decode Any Error in Plain English

Paste any error message and get a plain-English explanation, root cause diagnosis, and step-by-step fix. Works with Python, JavaScript, Docker, Git, and any CLI error.

5 minutes
Beginner
Developer Tools

Leanback to Compose for TV Migration

Migrate an Android TV app from the legacy Leanback UI Toolkit to Jetpack Compose for TV (androidx.tv) — the 10-foot UI design constraints, D-pad focus handling (initial focus, bidirectional routing, focusRestorer, IME focus chaining), Media3 playback with PlayerSurface, a five-phase migration order, and a direct Leanback-class-to-Compose-screen mapping table.

15 minutes
Advanced

Browse all Developer Tools playbooks →