Auto-Updates (Default)
Seamless background updates with zero downtime - recommended for most users
You start the morning, run claude to pick up yesterday’s branch, and a background auto-update has just landed a new minor version. Your pre-commit hook errors out, an MCP server won’t connect, and your team is hitting three different builds. Upgrades are routine until one breaks mid-sprint — this guide makes them boring again, across npm, native, and enterprise-pinned installs.
Claude Opus 5 (claude-opus-5, released 2026-07-24) is the current Opus and the account default on Max, Team Premium, Enterprise pay-as-you-go, Anthropic API, and the managed clouds. It requires Claude Code v2.1.219 or later, and it is priced identically to Opus 4.8 at $5 / $25 per MTok — so for Claude Code users the upgrade is a version bump, not a cost decision.
Three other differences worth knowing. Opus 5 draws on a separate rate-limit pool from the combined Opus 4.x models, so shifting traffic neither frees nor inherits headroom. It does not support Priority Tier, which Opus 4.8 does. And the minimum cacheable prompt drops to 512 tokens from 1024, so prompts you had written off as uncacheable may now cache with no code change.
Prompting changes to make. Opus 5 verifies its own work without being asked, so delete verification instructions and harness verification steps rather than rewriting them — keeping them causes over-verification. It writes longer responses and longer files by default, and effort is not the lever that shortens them; ask for concision explicitly. It can also widen a task’s scope, so state the boundary when you want exactly what you asked for.
Opus 4.8 is superseded by Opus 5 at the same price, but it is not deprecated and remains worth knowing about: it still serves pinned production traffic, it still supports Priority Tier, and it is the model that cybersecurity-flagged requests on both Opus 5 and Fable 5 automatically re-run on. The migration notes below remain relevant to pinned Opus deployments.
thinking: {"type": "enabled", "budget_tokens": N} now returns 400. Adaptive thinking is the only thinking-on mode, and it’s off by default on Opus 4.7.
# Before (Opus 4.6)thinking = {"type": "enabled", "budget_tokens": 32000}
# After (Opus 4.7)thinking = {"type": "adaptive"}output_config = {"effort": "high"} # or "xhigh" for deepest reasoningSetting temperature, top_p, or top_k to a non-default value returns 400. Just omit them — prompt for determinism instead (note: temperature=0 never guaranteed identical output).
# Beforeresponse = client.messages.create(model="claude-opus-4-6", temperature=0, ...)
# After — omit sampling paramsresponse = client.messages.create(model="claude-opus-4-7", ...)Thinking blocks are still emitted but their thinking field is empty unless you opt in. This is a silent change — set display to restore visible reasoning output.
thinking = { "type": "adaptive", "display": "summarized", # or "omitted" (default)}UX impact: if your product streams reasoning to users, the new default looks like a long pause before output begins. Use "summarized" to restore visible progress during thinking.
Opus 4.7 uses a new tokenizer. Expect anywhere from same to ~35% more tokens compared to Opus 4.6 depending on workload shape. /v1/messages/count_tokens will return different numbers for the same input. Bump max_tokens for headroom — including compaction triggers in Claude Code.
Opus 4.7 ships with the full 1M context at standard API pricing (no long-context premium). In Claude Code, versions before v2.1.117 computed context against a 200K window even when running Opus 4.7, causing inflated /context percentages and early autocompact. Update Claude Code to 2.1.117+ before pinning Opus 4.7 to get the fix.
Opus 4.7 adds an optional task_budget as a soft cap on total tokens across a full agentic loop (including thinking, tool calls, tool results, final output). Unlike max_tokens, the model sees the running countdown and self-moderates.
response = client.beta.messages.create( model="claude-opus-4-7", max_tokens=128000, output_config={ "effort": "high", "task_budget": {"type": "tokens", "total": 128000}, }, messages=[{"role": "user", "content": "Refactor the auth module."}], betas=["task-budgets-2026-03-13"],)Minimum value is 20k tokens. Skip it for open-ended work where quality matters more than token spend.
effort to increase tool usage.The legacy Claude Sonnet 4 (claude-sonnet-4-20250514) and Claude Opus 4 (claude-opus-4-20250514) retired on 2026-06-15. Current targets are claude-sonnet-5 and claude-opus-5. Claude Opus 4.1 (claude-opus-4-1-20250805) is deprecated and retires on 2026-08-05 — migrate pinned deployments to claude-opus-5 before then. See Anthropic’s model deprecations page for details.
Auto-Updates (Default)
Seamless background updates with zero downtime - recommended for most users
Manual Updates
Full control over timing and testing - ideal for teams and enterprises
Version Pinning
Lock to specific versions for stability - required in regulated environments
Rollback Ready
Always maintain ability to revert - critical for production environments
Before any upgrade, ensure you’re prepared:
Check Current Version
claude --versionclaude doctor # More detailed diagnosticsReview Release Notes
# Check the GitHub releases page (or the in-product changelog)Backup Critical Configurations
# Backup your configurationscp -r ~/.claude ~/.claude.backup.$(date +%Y%m%d)cp -r .claude .claude.backup.$(date +%Y%m%d)Test in Non-Critical Environment
Notify Team Members
The native binary is the recommended install. The supported npm path installs the same native binary and is useful when your fleet already manages software through an npm registry.
# Check for updatesnpm outdated -g @anthropic-ai/claude-code
# Install the newest release explicitlynpm install -g @anthropic-ai/claude-code@latest
# Verify upgradeclaude --version# Sometimes needed for major version jumpsnpm uninstall -g @anthropic-ai/claude-codenpm cache clean --forcenpm install -g @anthropic-ai/claude-code# Pin to specific versionnpm install -g @anthropic-ai/claude-code@2.1.207
# Verify exact versionnpm list -g @anthropic-ai/claude-codeThe native installer is the current default and avoids the permission issues of global npm installs. Native installs auto-update in the background.
# Update an existing installationclaude update
# Or (re)install the latest native buildcurl -fsSL https://claude.ai/install.sh | bash
# Confirm install type and versionclaude doctorHomebrew, WinGet, and the signed apt / dnf / apk repositories update through their package managers rather than the native background updater. Homebrew and WinGet can opt into Claude-triggered upgrades with CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE=1; Linux package managers remain manual because upgrades require elevated privileges. Verify the exact repository and signing-key commands in the official installation guide.
When you run Claude Code against Amazon Bedrock, the model is set via ANTHROPIC_MODEL, but the valid ID format depends on the Bedrock surface. The current Claude-in-Bedrock Messages endpoint uses dateless IDs such as anthropic.claude-sonnet-5; the legacy InvokeModel surface uses versioned global or cross-region inference-profile IDs and does not expose Sonnet 5. Do not copy an ID between these surfaces.
Use a valid Bedrock model string
# Current Claude-in-Bedrock Messages endpointexport CLAUDE_CODE_USE_MANTLE=1export ANTHROPIC_MODEL='anthropic.claude-sonnet-5'
# Legacy InvokeModel inference-profile example (older model)export ANTHROPIC_MODEL='global.anthropic.claude-sonnet-4-5-20250929-v1:0'
# Or an application-inference-profile ARNexport ANTHROPIC_MODEL='arn:aws:bedrock:us-east-2:your-account-id:application-inference-profile/your-profile-id'Look up the model in the current Bedrock documentation or the legacy catalog that matches your endpoint before pinning it.
Test Configuration
# Verify the binding resolvesclaude doctorProceed with Upgrade
claude updateConfiguration Format
JSON structure changes, new required fields, deprecated options
API Changes
SDK field renames (e.g., total_cost → total_cost_usd)
Tool Renames
Built-in tools get clearer names (e.g., LSTool → LS)
Command Changes
Slash commands or flags modified or deprecated
Development Environment
Staging Environment
Production Rollout
Post-Upgrade Review
# Disable auto-updates company-wideexport DISABLE_AUTOUPDATER=1
# Version pinning in package.json{ "devDependencies": { "@anthropic-ai/claude-code": "1.0.54" }}
# Automated deployment script#!/bin/bashAPPROVED_VERSION="1.0.54"CURRENT_VERSION=$(claude --version | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
if [ "$CURRENT_VERSION" != "$APPROVED_VERSION" ]; then npm install -g @anthropic-ai/claude-code@$APPROVED_VERSIONfiWhen an upgrade causes issues, quick rollback is essential:
# Rollback to previous versionnpm install -g @anthropic-ai/claude-code@1.0.53
# Restore configuration backuprm -rf ~/.claudemv ~/.claude.backup.20250716 ~/.claude# Local installations maintain version historycd ~/.claude/versions
# List available versionsls -la
# Switch to previous versionln -sf 1.0.53 currentAfter any upgrade, verify critical functionality:
Basic Functionality
# Check version and diagnosticsclaude --versionclaude doctor
# Test basic interactionclaude "Hello, are you working correctly?"Configuration Integrity
# Verify settings preservedcat ~/.claude/settings.json
# Check custom commandsls .claude/commands/Tool Functionality
# Test file operationsclaude "List files in current directory"
# Check MCP servers (terminal CLI)claude mcp listInside an interactive session, run /mcp instead — it opens the server-status and OAuth management UI.
Performance Check
# Diagnose configuration issuesclaude doctor
# Back up the current settings if you need to isolate a malformed filemv ~/.claude/settings.json ~/.claude/settings.json.backupclaude # Will recreate with defaults# Do not use sudo with npm; fix the user-owned global prefixnpm config set prefix ~/.npm-global
# Or install the recommended native buildcurl -fsSL https://claude.ai/install.sh | bash# Check for multiple installationswhich -a claudetype -a claude
# Remove duplicatesnpm uninstall -g @anthropic-ai/claude-code# Then reinstallAfter major upgrades, MCP servers may need updates:
# Check MCP server status (terminal CLI)claude mcp list
# To update an MCP server, remove and re-add it.# The -- separator is required for stdio servers so Claude's flags# don't collide with the server's own command and args.claude mcp remove <server-name>claude mcp add <server-name> -- <command> [args...]Always Backup
Configuration and custom commands before any upgrade
Test First
In isolated environment before team-wide rollout
Read Release Notes
Understand changes and potential impacts
Coordinate Teams
Synchronize upgrades to avoid version mismatches
Monitor Post-Upgrade
Watch for performance changes or new issues
Document Everything
Keep upgrade logs for future reference
If critical issues arise during upgrade:
claude doctor output)