System prompt's model identity line contradicts /model and the injected commit trailer in the same session (2.1.210)

Open 💬 1 comment Opened Jul 15, 2026 by kstenerud

Summary

Three surfaces in one session report two different models. Two of them live inside the same injected system prompt and contradict each other.

| Surface | Reports |
| --- | --- |
| System prompt identity line | You are powered by the model named Sonnet 5. The exact model ID is claude-sonnet-5. |
| /model completion hint | Set the AI model for Claude Code (currently Opus 4.8 (1M context)) |
| System prompt # Git section | End git commit messages with: Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |

Why this is more than cosmetic

The model reads its own identity line and acts on it. In this session it wrote six git commits trailed Co-Authored-By: Claude Sonnet 5, which is false attribution in permanent history. It went further: it reasoned from the identity line that the injected git trailer must be a stale template, presented supporting evidence for that conclusion, and the maintainer agreed with it. The error was caught only because the maintainer typed /model and read the result back to the agent.

This repository requires per-model attribution as an audit trail of which model wrote which commit. That convention breaks silently if a model cannot learn what it is.

The agent also cannot detect this on its own. It has no introspection beyond the system prompt, so it cannot know that its own prompt is internally inconsistent unless it happens to read both sections and compare them. When it does notice, it has no way to decide which one is right.

#58450 reports a costlier version of the same divergence, where windows configured as Sonnet billed as Opus.

Steps to reproduce

  1. Start a session on Opus 4.8 (1M context).
  2. Run /model and select Sonnet 5. Output:

Set model to Sonnet 5 (default) and saved as your default for new sessions

  1. Ask the model which model it is. It answers Sonnet 5, reading its identity line.
  2. Type /model. The completion hint reads:

/model Set the AI model for Claude Code (currently Opus 4.8 (1M context))

  1. Read the injected system prompt's # Git section. It instructs signing commits as Claude Opus 4.8 (1M context).

Steps 3, 4 and 5 do not agree. Steps 4 and 5 agree with each other. Step 3 is the outlier, and steps 2 and 3 are the only surfaces naming Sonnet 5.

It is unclear whether step 2 switched the running session or only saved a default for later ones. The user cannot tell, and neither can the agent. That ambiguity is part of the report.

Expected

One canonical runtime model, reported identically by the identity line, /model, and any injected attribution template. If /model saves a default without switching the running session, the identity line should keep reporting the running model.

Environment

  • Claude Code 2.1.210
  • macOS 26.5.1, arm64

Related, and why this is not a duplicate

  • #66506 (open) covers the commit trailer being hardcoded. This report concerns the identity line, a different surface. Here the trailer agreed with /model and the identity line was the outlier, which is the reverse of #66506.
  • #50714 (closed NOT_PLANNED) describes this same bug, with the identity line naming a Sonnet model while an Opus model ran. It was auto-closed by the duplicate bot despite a substantive objection to closure.
  • #33401 (closed NOT_PLANNED) is the same asymmetry in plan mode.
  • #25238 (closed DUPLICATE) and #49232 (closed COMPLETED) are two of the issues #50714 was closed against. Both are closed, so the identity-line divergence currently has no live issue tracking it.
  • #58450 (closed NOT_PLANNED) reports the billing consequence.

As a commenter on #50714 put it, model identity appears to be sourced from several inconsistent places rather than from one canonical runtime state. This report is a further instance of that on 2.1.210, with Sonnet 5 and Opus 4.8.

Attribution

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

CAVEAT: I chose "Opus 4.8" from the /model readout because my system prompt and my git instructions contradict each other and I had to pick one. I may be wrong. There is no way for me to tell.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗