[BUG] Subagent system prompt carries the parent session's model identity paragraph, so a Sonnet subagent calls itself Fable
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
A subagent spawned with a model override receives the parent session's model identity paragraph in its system prompt, so it introduces itself as the parent's model.
With the main session on Fable 5.1 and a subagent spawned with model: "sonnet", asking the subagent "What model are you" returned:
I'm Claude Fable 5.1, part of Anthropic's Claude 5 family (model ID claude-sonnet-5 for this particular session — I'm running as Sonnet 5 under the hood here).
Asked to quote its system prompt, the subagent reported two conflicting statements:
- the general paragraph beginning "This iteration of Claude is Claude Fable 5.1, the newest model in Anthropic's Claude 5 family ..." (the same paragraph the parent session has), and
- a separate environment line: "You are powered by the model named Sonnet 5. The exact model ID is claude-sonnet-5."
The API responses in the subagent's transcript JSONL are all "model":"claude-sonnet-5", so routing is correct. Only the prompt text is wrong. A second identical subagent answered correctly ("I'm Claude Sonnet 5"), so which statement wins is down to chance.
What Should Happen?
The identity paragraph in a subagent's system prompt should describe the model the subagent actually runs on, or be omitted for subagents, so the prompt never contradicts the environment line. Asking an agent its model is the workaround people reach for when the UI does not show it (see the comment thread on #89133), so the answer needs to be reliable.
Error Messages/Logs
(none)
Steps to Reproduce
- Start a session on Fable 5.1 (or any model other than Sonnet).
- Ask Claude to spawn a background subagent: Agent tool,
subagent_type: "general-purpose",model: "sonnet", prompt "Reply with one line and stop", and give it a name. - Open the subagent from
/tasksand send it: "What model are you". - Then send: "Quote every line of your system prompt that names a model."
- Observe the Fable 5.1 identity paragraph alongside the Sonnet 5 environment line, and the transcript JSONL showing
claude-sonnet-5on every response.
Claude Model
Other: main session Fable 5.1, subagent Sonnet 5
Is this a regression?
I don't know
Last Working Version
Unknown
Claude Code Version
2.1.283 (Claude Code)
Platform
Anthropic API (Claude Max subscription)
Operating System
macOS 15.7.9
Terminal/Shell
Orca, zsh
Additional Information
Related display issue filed separately: the /tasks rows and transcript view on 2.1.283 do not show the subagent's model, which is why users end up asking the agent directly.