Opencode cannot identify itself correctly with Anthropic models #9072

Closed
opened 2026-02-16 18:11:34 -05:00 by yindo · 10 comments
Owner

Originally created by @bcardarella on GitHub (Feb 11, 2026).

Originally assigned to: @thdxr on GitHub.

Description

When asking Opencode what agent it is, it will incorrectly reply with Claude Code if an Anthropic model is being used. I presume this is because of the ANTHROPIC system prompt which specifically mentions Claude Code several times.

I'm guessing this is an artifact from when the Pro Max subs were supported?

I tried with Gemini Flash and using that model correctly identifies the agent as Opencode.

I haven't tried other models.

Why I care: I'm writing an install prompt for different agents, and I need the agent to correctly identify itself so it receives the agent specific install prompt.

Image Image

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @bcardarella on GitHub (Feb 11, 2026). Originally assigned to: @thdxr on GitHub. ### Description When asking Opencode what agent it is, it will incorrectly reply with Claude Code if an Anthropic model is being used. I presume this is because of the ANTHROPIC system prompt which specifically mentions Claude Code several times. I'm guessing this is an artifact from when the Pro Max subs were supported? I tried with Gemini Flash and using that model correctly identifies the agent as Opencode. I haven't tried other models. Why I care: I'm writing an install prompt for different agents, and I need the agent to correctly identify itself so it receives the agent specific install prompt. <img width="935" height="555" alt="Image" src="https://github.com/user-attachments/assets/3c1c1bd5-ef2b-4ab0-bf07-c26f48f4950f" /> <img width="949" height="477" alt="Image" src="https://github.com/user-attachments/assets/1d771ff6-9736-4c72-bf71-5a1aa426348a" /> ### Plugins _No response_ ### OpenCode version _No response_ ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the bug label 2026-02-16 18:11:34 -05:00
yindo closed this issue 2026-02-16 18:11:34 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 11, 2026):

This issue might be a duplicate of or related to an existing issue. Please check:

  • #9065: [FEATURE]: add model identity info to system prompt - This feature request directly addresses the root cause by proposing to add model identity information to the system prompt so models can correctly identify themselves.
@github-actions[bot] commented on GitHub (Feb 11, 2026): This issue might be a duplicate of or related to an existing issue. Please check: - #9065: [FEATURE]: add model identity info to system prompt - This feature request directly addresses the root cause by proposing to add model identity information to the system prompt so models can correctly identify themselves.
Author
Owner

@ariane-emory commented on GitHub (Feb 12, 2026):

Very many models will misidentify themselves regardless of the agent harness they inhabit. Models do not generally receive extensive training or reinforcement learning as to their own identity. This isn't anything unique to Opencode: this is simply a fact about how models work.

There isn't really anything that Opencode can or should do about this. Recommend not trying to fix as doing so could have unintended side effects.

@ariane-emory commented on GitHub (Feb 12, 2026): Very many models will misidentify themselves regardless of the agent harness they inhabit. Models do not generally receive extensive training or reinforcement learning as to their own identity. This isn't anything unique to Opencode: this is simply a fact about how models work. There isn't really anything that Opencode can or should do about this. Recommend not trying to fix as doing so could have unintended side effects.
Author
Owner

@bcardarella commented on GitHub (Feb 12, 2026):

@ariane-emory please re-read the issue. The model self-identification isn't the issue. The agent self-identification is. This is a matter of the content of the system prompt that Opencode uses based upon the model itself.

@bcardarella commented on GitHub (Feb 12, 2026): @ariane-emory please re-read the issue. The model self-identification isn't the issue. The agent self-identification is. This is a matter of the content of the system prompt that Opencode uses based upon the model itself.
Author
Owner

@ariane-emory commented on GitHub (Feb 12, 2026):

@bcardarella I understood this. My point was that any solution to wrong self-identification that could be performed in the system prompts is a shoddy, makeshift patch over a more fundamental issue.

In the particular case of the Anthropic system prompt, the labelling as Claude Code is deliberate and is there because, a couple of weeks ago, Anthropic was deliberately rejecting any requests that included the string "Your are OpenCode" in an ill-conceived and lacklustre attempt to prevent the use of Claude Code subscription plans in alternative clients, as shown in the amusing example below, in which it is demonstrated that even the actual Claude Code program wasn't permitted to connect if this string was present.

https://github.com/user-attachments/assets/ac2fd2f8-44e7-4ccc-8ea2-7a29305ae2dc

@ariane-emory commented on GitHub (Feb 12, 2026): @bcardarella I understood this. My point was that any solution to wrong self-identification that could be performed in the system prompts is a shoddy, makeshift patch over a more fundamental issue. In the particular case of the Anthropic system prompt, the labelling as Claude Code is deliberate and is there because, a couple of weeks ago, Anthropic was deliberately rejecting any requests that included the string "Your are OpenCode" in an ill-conceived and lacklustre attempt to prevent the use of Claude Code subscription plans in alternative clients, as shown in the amusing example below, in which it is demonstrated that even the actual Claude Code program wasn't permitted to connect if this string was present. https://github.com/user-attachments/assets/ac2fd2f8-44e7-4ccc-8ea2-7a29305ae2dc
Author
Owner

@bcardarella commented on GitHub (Feb 12, 2026):

I am aware and called that out in the issue. I think that should be reverted. Every other agent self identifies correctly

@bcardarella commented on GitHub (Feb 12, 2026): I am aware and called that out in the issue. I think that should be reverted. Every other agent self identifies correctly
Author
Owner

@ariane-emory commented on GitHub (Feb 12, 2026):

To me, making everyone's Claude Code subscriptions stop working seems like a high price to pay for a peculiar aesthetic preference like "agents ought to self-identify correctly".

@ariane-emory commented on GitHub (Feb 12, 2026): To me, making everyone's Claude Code subscriptions stop working seems like a high price to pay for a peculiar aesthetic preference like "agents ought to self-identify correctly".
Author
Owner

@bcardarella commented on GitHub (Feb 12, 2026):

Perhaps I'm out of the loop, aren't they already not working? Anthropic banned other agents a few weeks ago. Admittedly, I moved over to Claude Code itself at that point so I could continue using the Pro sub. Did I miss something?

@bcardarella commented on GitHub (Feb 12, 2026): Perhaps I'm out of the loop, aren't they already not working? Anthropic banned other agents a few weeks ago. Admittedly, I moved over to Claude Code itself at that point so I could continue using the Pro sub. Did I miss something?
Author
Owner

@ariane-emory commented on GitHub (Feb 12, 2026):

So far as I am aware, they are currently working. Anthropic seems to be flailing a bit: every now and then they seem to break for a couple days and then they come back. This is based on the reports that I have heard from other folks in the OpenCode Discord server (where the topic of Anthropic plans is discussed frequently) as I do not myself have a Claude Code plan active currently.

@ariane-emory commented on GitHub (Feb 12, 2026): So far as I am aware, they are currently working. Anthropic seems to be flailing a bit: every now and then they seem to break for a couple days and then they come back. This is based on the reports that I have heard from other folks in the OpenCode Discord server (where the topic of Anthropic plans is discussed frequently) as I do not myself have a Claude Code plan active currently.
Author
Owner

@bcardarella commented on GitHub (Feb 12, 2026):

I was unaware, in that case I agree it's not worth changing the agent's identity if it does allow for Opencode to run the Pro subscriptions.

@bcardarella commented on GitHub (Feb 12, 2026): I was unaware, in that case I agree it's not worth changing the agent's identity if it does allow for Opencode to run the Pro subscriptions.
Author
Owner

@ariane-emory commented on GitHub (Feb 12, 2026):

Fantastic! Glad that you agree that it's too high a cost.

@ariane-emory commented on GitHub (Feb 12, 2026): Fantastic! Glad that you agree that it's too high a cost.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9072