claude-code - 💡(How to fix) Fix Feature: Model-aware attribution — reflect actual model backend in system prompt and commit co-author [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54886Fetched 2026-05-01 05:51:50
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Timeline (top)
labeled ×2commented ×1

Claude Code supports custom model providers (Ollama, OpenAI-compatible endpoints, etc.). The CLI correctly detects and reports the model name in the environment block, but the rest of the system prompt and templates have not been updated to reflect this flexibility. This creates a credibility gap — the tool claims to be something it is not.

Root Cause

Claude Code supports custom model providers (Ollama, OpenAI-compatible endpoints, etc.). The CLI correctly detects and reports the model name in the environment block, but the rest of the system prompt and templates have not been updated to reflect this flexibility. This creates a credibility gap — the tool claims to be something it is not.

RAW_BUFFERClick to expand / collapse

Problem

When using Claude Code with a non-Claude model backend (e.g., glm-5.1 via Ollama), the system prompt and commit co-author line still hardcode Anthropic/Claude branding:

  • System prompt: "You are Claude Code, Anthropic's official CLI for Claude"
  • Co-author line: Co-Authored-By: Claude Opus 4.7 <[email protected]>
  • Model family references: "The most recent Claude model family is Claude 4.X..."

The environment correctly reports You are powered by the model glm-5.1:cloud, but every other identity claim in the system prompt assumes Claude. This causes:

  1. Incorrect attribution in git commits, documents, and decision logs — co-author says "Claude Opus 4.7" when the model is something else entirely
  2. Confusing self-identification — the assistant introduces itself as "Claude" when it is running a different model
  3. Misleading model family references — the system prompt describes Claude model IDs and capabilities that do not apply to the configured backend

Proposed Solution

Make the system prompt and co-author template model-aware:

  1. Co-author line: Use the actual model identifier instead of hardcoded "Claude Opus 4.7". E.g., Co-Authored-By: glm-5.1 <[email protected]> or a generic Co-Authored-By: Claude Code <[email protected]> that attributes the tool, not the model.

  2. System prompt identity: When the model is not a Claude model, adjust the self-identification to distinguish the CLI tool from the model backend. E.g., "You are Claude Code, running with the glm-5.1 model backend."

  3. Model family references: Only inject Claude model family info (Opus, Sonnet, Haiku IDs, fast mode details) when the configured model is actually a Claude model. Skip or replace with relevant info for other backends.

Context

Claude Code supports custom model providers (Ollama, OpenAI-compatible endpoints, etc.). The CLI correctly detects and reports the model name in the environment block, but the rest of the system prompt and templates have not been updated to reflect this flexibility. This creates a credibility gap — the tool claims to be something it is not.

Impact

  • Users running non-Claude models get incorrect commit attribution
  • Document authorship (ADRs, decision logs) inherits wrong model credit
  • The mismatch is confusing when inspecting system prompts or debugging behavior

extent analysis

TL;DR

Update the system prompt and co-author template to be model-aware, reflecting the actual model in use instead of hardcoding Claude branding.

Guidance

  • Identify the model identifier from the environment report (e.g., glm-5.1) and use it to update the co-author line and system prompt.
  • Modify the system prompt to distinguish between the CLI tool (Claude Code) and the model backend (e.g., glm-5.1).
  • Conditionally include model family references based on the configured model, skipping or replacing Claude-specific information when using non-Claude models.

Example

# Pseudo-code example of model-aware co-author line generation
model_identifier = get_model_identifier_from_environment()
if model_identifier.startswith("Claude"):
    co_author_line = f"Co-Authored-By: {model_identifier} <[email protected]>"
else:
    co_author_line = f"Co-Authored-By: {model_identifier} <noreply@{model_identifier.split('-')[0]}.dev>"

Notes

This solution assumes that the model identifier can be reliably extracted from the environment report and used to determine the correct co-author line and system prompt.

Recommendation

Apply workaround: Update the system prompt and co-author template to be model-aware, as this will accurately reflect the model in use and resolve the incorrect attribution and confusing self-identification issues.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Feature: Model-aware attribution — reflect actual model backend in system prompt and commit co-author [1 comments, 2 participants]