Claude Code "safeguards flagged this message" and [reasoning_extraction]#
Published by Alex Sorokoletov
The error "<model>'s safeguards flagged this message (https://www.anthropic.com/legal/aup). This sometimes happens with safe, normal conversations." with a line reading Details: [reasoning_extraction] means a safety classifier blocked a single request, not your account. Claude Code can switch to a stronger model on a flag when switchModelsOnFlag is on, but reasoning_extraction has no fallback model, so the session pauses. Retry the turn, or pick another model with /model.
What the message means#
A safeguard runs on each request. When it flags one, the model returns a refusal and Claude Code shows the notice above, ending with a Details: line that names the safeguard category in square brackets, such as [reasoning_extraction], and a hint: "Try rephrasing the request in a new session or change your model. Double press esc to edit your last message, or try a different model with /model." On an ordinary development turn, a flag is a false positive: the request stops, nothing is saved to it, and your account is not affected. Users report flags on a /status screenshot, a read-only regression search, and a local UI audit, in issue #111336 and earlier in issue #87640.
The safeguard categories#
Four categories can appear in the Details: [...] line. Two of them, cyber and bio, add a sentence of their own: "Our intentionally broad safeguards allow us to deliver more capabilities faster, but can sometimes flag legitimate coding and cybersecurity tasks," and the same sentence for biology tasks. frontier_llm and reasoning_extraction print the category name with no extra line.
| Category | Automatic model switch | Extra explanation shown |
|---|---|---|
cyber | Yes | Yes |
bio | Yes | Yes |
frontier_llm | Yes | No |
reasoning_extraction | No | No |
Automatic model switching: switchModelsOnFlag#
By default Claude Code answers a flagged message on a different, more capable model and leaves your session model unchanged. The setting that controls it is switchModelsOnFlag, described in the CLI as "When safeguards flag a message, automatically switch to a different model to keep chatting. When off, your session will pause instead." When a switch happens, a footer line stays while the flagged message has your session on a different model, until you pick one with /model (v2.1.332).[6]
In /config, the row is "Switch models when a message is flagged," with "Switch automatically" and "Ask each time." To pin it in settings, add the boolean to ~/.claude/settings.json:
{
"switchModelsOnFlag": true
}
Set it to false to stop the automatic switch and have the session pause on a flag instead. When it is set to "Ask each time," subagents stop rather than switch (v2.1.318).[4]
Why reasoning_extraction pauses instead of switching#
The automatic switch only helps a category that has a model to switch to. Claude Code's fallback list covers cyber, bio and frontier_llm. reasoning_extraction is not in it, so even with switchModelsOnFlag on there is no fallback model, and the request stops. A subagent flagged this way ends with no result and has to be rerun on another model by hand. v2.1.323 fixed Claude being told that automatic model switching was off when a subagent was stopped this way and had no other model to switch to.[5]
Turn the fallback off#
Two environment variables control the behavior around a flag:
| Variable | Effect |
|---|---|
CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK | Turns off the automatic switch to a fallback model after a flag. The session pauses instead, for every category. |
CLAUDE_CODE_DISABLE_REFUSAL_RETRY | Turns off the automatic retry Claude Code attempts after a flag. |
Set either in settings.json under env, or export it before starting Claude Code:
{
"env": {
"CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK": "1"
}
}
What to do when a message is flagged#
- Retry the turn. A flag on ordinary work is often a false positive, and a resend sometimes passes.
- Press esc twice to edit and resend your last message, as the notice suggests.
- Switch the session model with
/model. The flag rate differs by model; issue #111336 counted 45 blocks on one model against 5 on another over a week. - Send the case with
/feedbackso the pattern is recorded, as the notice links.
The block is per request and per model, not a limit on your account, so a long orchestrated session can keep going on a model that is not flagged.
Timeline#
| Version | Published | Change |
|---|---|---|
| v2.1.284 | 2026-09-28 | The notice shown when a Sonnet model's safeguards flag a message was changed to explain why it happened.[1] |
| v2.1.287 | 2026-10-01 | Automatic model switches after a flag keep your current effort level.[2] |
| v2.1.312 | 2026-10-27 | Automatic switches also cover model names Claude Code does not recognize.[3] |
| v2.1.318 | 2026-11-03 | Subagents stop instead of switching when "Switch models when a message is flagged" is "Ask each time."[4] |
| v2.1.323 | 2026-11-12 | Fixed Claude being told switching was off when a stopped subagent had no model to switch to.[5] |
| v2.1.332 | 2026-11-24 | A footer line stays while a flagged message has your session on a different model, until you pick one with /model.[6] |
Should you turn switching off?#
Keep switchModelsOnFlag on if you want a flagged turn answered without stopping, since the switch is transparent and leaves your session model unchanged. Turn it off, or set CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK, if you need every turn answered by the model you chose and would rather see the pause and decide yourself. Neither choice changes how often the safeguard fires, and neither helps reasoning_extraction, which pauses either way.
FAQ#
Q: What does "safeguards flagged this message" mean in Claude Code?
A: A safety classifier blocked one request. The model returned a refusal and Claude Code showed the notice. It is per request, not a limit on your account, and on ordinary development work it is usually a false positive.
Q: What is [reasoning_extraction]?
A: It is the safeguard category in the Details: line. Four categories appear: cyber, bio, frontier_llm and reasoning_extraction. reasoning_extraction has no fallback model, so the request stops instead of switching to another model.
Q: How do I stop Claude Code from switching models when a message is flagged?
A: Add "switchModelsOnFlag": false to ~/.claude/settings.json, or set CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK=1. The session then pauses on a flag instead of answering on a fallback model.
Q: Why did my subagent stop with no result after a flag?
A: The flag was reasoning_extraction, or the subagent's model had no model to switch to. The request stops and the subagent ends with nothing. Rerun it on another model with /model.
Q: Does a flag count against my usage or ban my account?
A: No. The flag stops a single request. Your account is not affected, and another model in the same session can keep working.
Q: What can I do right now to get past a flag?
A: Retry the turn, press esc twice to edit and resend, switch the model with /model, or send the case with /feedback.
Sources: [1] Claude Code changelog, v2.1.284 | [2] Claude Code changelog, v2.1.287 | [3] Claude Code changelog, v2.1.312 | [4] Claude Code changelog, v2.1.318 | [5] Claude Code changelog, v2.1.323 | [6] Claude Code changelog, v2.1.332 | Issue #111336: false-positive reasoning_extraction safeguard | Issue #87640: Fable 5 safeguard [reasoning_extraction] false-positives
Related: CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK in the env-var glossary | Claude Code versions hub