Skip to content

<thinking> tags output as body text in Claude Code

Quick fix

Changing the provider's apiFormat from openai_chat to anthropic, if supported upstream, can bypass inline leakage.

Error output
<thinking>tool call</thinking>
日志很大。我先看当前配置和最近的日志内容。
English translation

<thinking>tool call</thinking> The log is large. I will first check the current configuration and the recent log content.

When Claude Code uses `apiFormat: "openai_chat"`, the Anthropic streaming conversion path outputs `choice.delta.content` directly as a `text` block without stripping inline `<thinking>...</thinking>` tags at the start of the stream. Thinking content is therefore displayed in plain text together with the response.

This occurs with the `<thinking>` variant: existing handling recognizes only `<think>` or covers only the Codex path, not this Claude conversion path. The issue report confirms that, if the upstream supports the native Anthropic interface, switching to the `anthropic` format avoids this conversion path.

  1. Confirm that the upstream provider supports the native Anthropic interface.

  2. Change this provider's `apiFormat` from `openai_chat` to `anthropic` so requests use the passthrough path and avoid this streaming conversion.

ToolClaude Code
Version3.20.4(受影响版本)
PlatformsWindows

(No FAQ yet)

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.