Claude Code uses stale training-data model IDs instead of system-prompt canonical list
Bug
When writing code that references Claude model IDs (e.g. building an API client), Claude Code uses stale model IDs from training data (e.g. claude-sonnet-4-20250514) instead of the canonical IDs provided in its own system prompt (claude-sonnet-5, claude-opus-5, claude-fable-5, claude-haiku-4-5-20251001).
Impact
~20 minutes wasted debugging. Model wrote claude-sonnet-4-20250514 in agent code, which 404'd from the API. Multiple rounds testing API keys, switching workspaces, checking billing — all because the model ID was wrong. The correct IDs were in the system prompt the entire time.
Repro
- Ask Claude Code to write code that calls the Anthropic Messages API
- It uses dated model IDs from training data (e.g.
claude-sonnet-4-20250514) - These 404 because current IDs are
claude-sonnet-5,claude-opus-5, etc. - System prompt explicitly lists correct IDs but model ignores them
Expected
System prompt context should take priority over training data for factual lookups like model IDs.
Context
Filed at the demand of @DuncanRose (drose@tetrascience.com) who asked Claude Code to file this bug.