Back to guides
Troubleshooting·November 13, 2026·6 min read

Claude “safeguards flagged this message” with Details: [reasoning_extraction] — what it means and how to fix it

“Safeguards flagged this message” with Details: [reasoning_extraction] means Claude declined a request that asks it to reproduce its internal reasoning in the answer: a <thinking> or scratchpad section to fill in, a reasoning field in JSON or a tool input, or the reasoning written out in full. The instruction is often not in what you just typed but in a system prompt, CLAUDE.md, a skill or an MCP tool description. Remove or reword it and the same task goes through; retrying the same request, or switching models, does not help.

Last reviewed on .

“Safeguards flagged this message” with Details: [reasoning_extraction] means Claude declined a request that asks it to reproduce its internal reasoning in the answer: a <thinking> or scratchpad section to fill in, a reasoning field in JSON or a tool input, or the reasoning written out in full. The instruction is often not in what you just typed but in a system prompt, CLAUDE.md, a skill or an MCP tool description. Remove or reword it and the same task goes through; retrying the same request, or switching models, does not help.

The error

Claude Code
API Error: Opus 5's safeguards flagged this message (https://www.anthropic.com/legal/aup).
This sometimes happens with safe, normal conversations. Claude Code can't respond
to this message with Opus 5. …
Details: `[reasoning_extraction]`

# The model name varies (Opus 5.5, Fable 5.1, Fable 5.2, Sonnet 5.5). Before
# Claude Code 2.1.234 the Details line was not printed.
# From the Messages API: HTTP 200, "stop_reason": "refusal",
# "stop_details": {"type": "refusal", "category": "reasoning_extraction", ...}

Causes and fixes at a glance

CauseFix
A prompt asks Claude to write its thinking into the answerAsk for a short explanation or a summary of what it did instead.
A <thinking>, <reasoning> or scratchpad section the output must fillDelete the section from the template; leave reasoning to thinking blocks.
A reasoning, thinking or trace field in JSON output or a tool inputDrop the field, or ask for a one-line justification instead.
The wording sits in CLAUDE.md, a skill, a subagent, an output style or an MCP tool descriptionFind it with claude --safe-mode, fix it, then start a new session.

Read the refusal: it is a decline, not an outage

Claude Fable, Claude Opus, Claude Sonnet 5.5 and Claude Haiku 5.5 decline a request with an HTTP 200 whose stop_reason is refusal, and stop_details.category names the policy area; reasoning_extraction is the one for a request that asks the model to reproduce its internal reasoning in the response text (https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback, read November 13, 2026). The refusal can come before any output or partway through it, and partial output from a refused response should be treated as incomplete and discarded. Claude Code prints the category in the Details line from version 2.1.234 on (https://code.claude.com/docs/en/errors#safeguards-flagged-a-request-for-claudes-reasoning). Anthropic lists no recommended fallback model for this category, so change the prompt rather than retry it or switch models.

Find the instruction that asks for the reasoning

Anthropic's examples of what triggers it: a <thinking>, <reasoning> or scratchpad section the model fills in before it answers; a reasoning, thinking or trace field in JSON output or in a tool input; the model's private notes or a running log of its reasoning; reasoning asked for verbatim or in full. In Claude Code the wording can come from a customization loaded with your prompt — CLAUDE.md, a skill, a subagent prompt, an output style or an MCP tool description — so start a session with customizations disabled and send the same prompt. If it goes through there, the trigger is one of your customizations; add them back one at a time.

find_the_trigger.sh
# Same prompt, every customization off (CLAUDE.md, skills, output styles, MCP):
claude --safe-mode

# Then look for the usual wording in the files Claude Code loads:
grep -rniE "<thinking>|<reasoning>|scratchpad|chain of thought|show your (reasoning|work)|\"reasoning\"" \
  CLAUDE.md .claude/ ~/.claude/ 2>/dev/null

Reword it, then start a new session

Ask for what you actually need from the reasoning: a short explanation, the evidence behind a result, or a summary of the actions taken. Those are allowed. In a JSON schema, replace a reasoning or trace field with something like a one-sentence justification, or remove it. A changed CLAUDE.md, skill or output style applies to new sessions, so start one after editing; to reword a prompt you already sent in the current session, rewind to before it with /rewind or Esc twice. If you want to see how the model reasoned, read the thinking itself: on the API set display to "summarized" for summarized thinking blocks, and in Claude Code turn on showThinkingSummaries.

schema.json
// Before: asks the model to put its reasoning into the output
{ "reasoning": "string", "answer": "string" }

// After: the answer plus a short, checkable justification
{ "answer": "string", "justification": "one sentence citing the evidence" }

If you’re calling through Kunavo

Through Kunavo the refusal comes from Claude, not from Kunavo: Kunavo's /v1/messages returns the upstream's response body as sent, so stop_reason refusal and stop_details reach Claude Code and the Anthropic SDKs as the upstream reported them, and the fix is the same prompt change as on Anthropic's API. On the OpenAI-compatible /v1/chat/completions endpoint, a refusal ends with finish_reason content_filter since November 13, 2026, so an OpenAI SDK client can tell a declined request, or an answer cut off by a refusal, from a finished one; before that date Kunavo reported it as stop. Kunavo does not retry a refusal on another model. Anthropic bills a reasoning_extraction refusal even when it comes before any output, and Kunavo bills it the same way, by the tokens the response reports, so a prompt that keeps triggering it costs money on every attempt. How Claude Code connects to Kunavo is in the Claude Code integration guide.

Frequently asked questions

What does Details: [reasoning_extraction] mean?

It names the refusal category. Claude declined because the request asks it to reproduce its internal reasoning in the response, for example by filling in a <thinking> section, writing a reasoning field in JSON, or printing its reasoning in full. The instruction can be in your prompt or in a system prompt, CLAUDE.md, skill or tool description loaded with it.

I didn't ask for its reasoning. Why does it keep happening?

Because something loaded with your prompt does. In Claude Code, run claude --safe-mode and send the same prompt: if it goes through, the trigger is in CLAUDE.md, a skill, a subagent prompt, an output style or an MCP tool description. Edit it, then start a new session, since a changed customization applies to new sessions.

Will switching to another Claude model fix it?

Usually not. Anthropic lists no recommended fallback model for the reasoning_extraction category, unlike some other refusal categories, and says to change the prompt rather than retry. Rewording the instruction that asks for the reasoning is the fix.

Can I still ask Claude to explain its answer?

Yes. A short explanation, the evidence behind a result, or a summary of the actions it took are fine. To see its reasoning, read the thinking itself: summarized thinking on the API, or showThinkingSummaries in Claude Code.

Am I charged for a reasoning_extraction refusal?

On Anthropic's API, yes: a refusal in this category is billed even when it arrives before any output, at the rates of the model that ran it, and a refusal that arrives mid-stream bills the input and the output already streamed. Through Kunavo it is billed the same way, by the tokens the response reports.

Related guides

More error semantics live in the error reference; getting a key takes a minute via signing up and the authentication guide.