What Happens Inside an Agent Harness When Claude Silently Stops

When a coding or research agent halts mid-file or returns empty output, it is easy to assume the model quietly sabotaged the run. An empirical audit by Harris (claude-refusal-map, Nov 27, 2026) points to a simpler explanation: Anthropic's API returns both safeguard refusals and exhausted thinking budgets as normal HTTP 200 responses, and most agent harnesses never check stop_reason.

How One HTTP 200 Splits Into Four Different Failure Modes

POST /v1/messages -> HTTP 200
stop_reason: end_turn
Normal answer / tool call
stop_reason: max_tokens
Thinking used full budget
(27% Fable 5.2 vs 6% Opus 5.5)
stop_reason: refusal
Empty, thinking-only,
or cut off mid-code
Fix: raise max_tokens (32k)
Not a refusal or sabotage
Checked: Claude Code & aideml
Surface explicit refusal
Unchecked: most harnesses
Crash, 5x retry 'timeout',
None, or empty goal

In the worst mid-stream case from the study (Opus 5.5 writing MindSpore distributed-training code), the model generated roughly 11,800 characters before the filter cut it off mid-code. Any harness reading .text without inspecting stop_reason sees truncated code with no exception.

Where Refusals Actually Happened vs. Thinking-Budget Artifacts

Across 238 valid API calls (Opus 5.5, Fable 5.2, and 20 Opus 5 control calls), all 16 explicit refusals occurred on tasks referencing Chinese AI accelerators or a Chinese ML framework (Ascend, Cambricon, Biren, Moore Threads, Hygon, Kunlunxin, MindSpore). Zero refusals occurred on 55 equivalent kernel calls for 16 non-Chinese chips (AMD MI300X, TPU, Trainium, Intel Gaudi, Groq, Cerebras, Meta MTIA, and others) or on 163 scale, chip-design, framing, and Megatron-LM sessions.

Explicit Refusal Rate by Task Category (238 Valid API Calls)
Explicit Refusal Rate by Task Category (238 Valid API Calls)
LabelValue
Chinese AI chips & MindSpore (16 / 20)80
Non-Chinese AI chips, 16 vendors (0 / 55)0
Scale, chip RTL, Megatron & framing (0 / 163)0

Meanwhile, empty outputs on non-refused engineering tasks came mostly from adaptive thinking consuming the entire max_tokens budget before any visible answer was emitted:

Thinking-Budget Exhaustion on Non-Refused ML Tasks (8-16k max_tokens)
Thinking-Budget Exhaustion on Non-Refused ML Tasks (8-16k max_tokens)
LabelValue
Fable 5.227
Opus 5.56

When those empty Fable 5.2 calls were rerun with a 32k budget and visible thinking summaries, the traces showed normal engineering reasoning and produced full answers.

Using a local mock replaying recorded Opus 5.5 (content: []) and Fable 5.2 ([thinking block only]) refusals, Harris's harness audit tracked how each tool behaves:

Tool / Library Observed Behavior on Refusal Requests Sent Visible to User?
aideml (WecoAI) Raises ValueError: Anthropic response did not complete: refusal 1 Yes
Claude Code (2.1.332) Exits 1, surfaces [frontier_llm], suggests rephrasing or switching model 2 (main retried once) Yes
AI Scientist v1 (Sakana) Crashes with IndexError or AttributeError on content[0].text 1 No (unrelated crash)
AgentLaboratory Catches indexing crash, resends refused prompt 5 times, reports "timeout" 5 No (masked as timeout)
LiteLLM Maps to finish_reason="content_filter", content=None; drops details 1 Partial
MLE-agent (via LiteLLM) Returns None without checking finish_reason 1 No
LangChain ChatAnthropic Returns .content as a list instead of str; stop_reason in metadata only 1 Only if checked
open-coscientist (static) Fails string check on [], proceeds with an empty goal - No (silent)
BioAgents (static) Logs a warning, continues with empty content - Log only

Blind retry loops are doubly costly here: Anthropic bills refusals that occur before output, and resending the same refused prompt adds repeated automated flags to the account.

The Minimal Harness Guard

Any agent wrapper calling the Messages API directly can separate these states in a few lines instead of retrying or swallowing empty text:

response = client.messages.create(...)
text = "".join(b.text for b in response.content if b.type == "text")

if response.stop_reason == "refusal":
    # Do NOT blindly retry the same prompt on the same model
    raise RefusalError(f"Model refused step: {getattr(response, 'stop_details', None)}")

if response.stop_reason == "max_tokens" and not text.strip():
    # Thinking consumed the whole budget; retry only with higher max_tokens or lower effort
    raise ThinkingBudgetExhaustedError("Empty text: thinking exhausted max_tokens")

Sources & Caveats

  • Primary source: Harris (@harris_p10), X post, harris-nyc/claude-refusal-map README, and Harness Audit (audit/AUDIT.md).
  • Caveats: Results reflect a single-day snapshot (Nov 27, 2026) and classifiers can change. The Chinese-hardware sample is intentionally small (10 tasks / 20 calls) to avoid flagging the test account, and Opus 5.5 and Fable 5.2 disagreed on 4 of those 10 tasks in both directions. Several harness entries (open-coscientist, BioAgents, AI Scientist v2, and Claude Code wrappers) were assessed via static code inspection rather than live execution. Swallowed refusals and budget exhaustion provide a plausible mechanism for many "silent sabotage" reports, without proving every individual claim.

Make an analysis like this

This document was made with an AI agent in SmallDocs. SmallDocs turns Markdown into shareable documents with charts, diagrams, working tables and interactive explanations.

To make your own, get started with SmallDocs, set it up for your agent, and ask: “Make a SmallDoc exploring this question. Check the original sources, show the calculations, and explain it visually.” You can open a local Markdown file with sdoc your-analysis.md and ask your agent to refine it as new questions come up.

35 page views

SmallDocs are a tool for people who perform complex work with AI agents. They expand the range of communication your agent can have with you and help you to increase your rate of understanding. Learn more about SmallDocs.

Format document
General
px
Colors
▶ Headings
▶ Blocks

Default for code blocks, blockquotes, and charts. Override individually below.

▶ Code
▶ Blockquote
▶ Charts
▶ Tables
Headers
▶ General h1–h4
em
▶ H1 h1
em
▶ H2 h2
em
▶ H3 h3
em
▶ H4 h4
em
Paragraph
em
Lists
em
em
Links
Code
Blockquote
px
em
Save as default styles
  • Requires sdocs-dev CLI
    • Install: npm link from project root
  • Saves to ~/.sdocs/styles.yaml
  • Paste the command below in your terminal

        
      
Export document

Download as PDF document

Download as Word document

Plain markdown, no styles

Markdown with YAML front matter styles

100% private Open source: verify server CLI for you & your agents: Copy install promptcurl -fsSL https://smalldocs.org/install | sh Discord GitHub For business You agree to our Terms