608 pages for reason.
Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.
cache-diagnostics
Claude Developer Platform · in the page
build-with-claude/cache-diagnostics
…print("No divergence detected.") elif diagnostics.cache_miss_reason is None: print("Comparison still pending.") else: print(f"cache_miss_reason: {diagnostics.cache_miss_reason.t…
anthropic-managed
Claude Developer Platform · in the page
build-with-claude/claude-models-on-google-cloud/anthropic-managed
…and why do you need higher limits?**, describe your use case and the reason you need higher limits. If you need a higher [monthly spend cap](https://platform.claude.com/docs/en/api/rate-limits#spend-…
claude-platform-on-aws
Claude Developer Platform · in the page
build-with-claude/claude-platform-on-aws
…and why do you need higher limits?**, describe your use case and the reason you need higher limits. If you need a higher tier or spend cap, say so here. * In **Expected monthly spend**, enter a wh…
sent_count = len(messages sent in the compaction request)
Claude Developer Platform · in the page
build-with-claude/compaction
…. When enabled, the API returns a message with the `compaction` stop reason after generating the compaction block: <CodeGroup> ```bash cURL # pause_after_compaction stops the response right afte…
compaction-background
Claude Developer Platform · in the page
build-with-claude/compaction-background
…is swapped in or has failed. 3. When the response arrives with `stop_reason` `"compaction"`, drop exactly the messages you sent from the front of your history and put the returned message in their pl…
compaction-keep-recent-turns
Claude Developer Platform · in the page
build-with-claude/compaction-keep-recent-turns
…mpaction={"type": "summarize"}, ) if summary.stop_reason == "compaction": history = [{"role": "assistant", "content": summary.content}, *recent] print(f…
compaction-on-demand
Claude Developer Platform · in the page
build-with-claude/compaction-on-demand
…, generates no reply after it, and returns the block alone with `stop_reason` `"compaction"`. Send the same `system` prompt and `tools` that you use for the rest of the conversation. The summarizer re…
compaction-thinking-blocks
Claude Developer Platform · in the page
build-with-claude/compaction-thinking-blocks
…ry[:2], compaction={"type": "summarize"}, ) if summary.stop_reason != "compaction": raise SystemExit(f"No summary: {summary.stop_reason}") # 3. Put the block in front of the kept tu…
compaction-threshold
Claude Developer Platform · in the page
build-with-claude/compaction-threshold
…. When enabled, the API returns a message with the `compaction` stop reason after generating the compaction block: <CodeGroup> ```bash cURL # pause_after_compaction stops the response right afte…
context-editing
Claude Developer Platform · in the page
build-with-claude/context-editing
…preservation: you can choose to keep more thinking blocks to maintain reasoning continuity, or clear them more aggressively to save context space. When a request doesn’t include the `clear_thinking_2…
context-windows
Claude Developer Platform · in the page
build-with-claude/context-windows
…generation then reaches the context window limit, it stops with `stop_reason: "model_context_window_exceeded"`. On earlier models, the API returns a [validation error](https://platform.claude.com/docs…
effort
Claude Developer Platform · in the page
build-with-claude/effort
…net 4.6, and Claude Haiku 5.5. | Tasks requiring the deepest possible reasoning and most thorough analysis | | `xhigh` | Extended capability for long-horizon work. Available on Claude Fable 5.2, Claud…
extended-thinking
Claude Developer Platform · in the page
build-with-claude/extended-thinking
…ter sets a target for how many tokens Claude can use for its internal reasoning process. Larger budgets can improve response quality by allowing more thorough analysis for complex problems. ## Budget…
fallback-credit
Claude Developer Platform · in the page
build-with-claude/fallback-credit
…esponse = send("claude-fable-5", request) if ( response.stop_reason == "refusal" and (details := response.stop_details) and (token := details.fallback_credit_token) ): exa…
message-threads
Claude Developer Platform · in the page
build-with-claude/message-threads
….5, and Claude Haiku 5.5. The model then answers without that earlier reasoning. * **Why:** Changing `system` or `tools` makes the `thinking` and `redacted_thinking` blocks already in the conversatio…
mid-conversation-effort-example
Claude Developer Platform · in the page
build-with-claude/mid-conversation-effort-example
…els.messages.OutputConfig; import com.anthropic.models.messages.StopReason; import com.anthropic.models.messages.TextBlock; import com.anthropic.models.messages.Tool; import com.anthropic.mode…
mid-conversation-system-messages
Claude Developer Platform · in the page
build-with-claude/mid-conversation-system-messages
…](https://platform.claude.com/docs/en/build-with-claude/handling-stop-reasons#pause-turn) after the message, or a server-side tool loop, adds no user message, so the message still renders on that cont…
overview
Claude Developer Platform · in the page
build-with-claude/overview
…ails/handle-streaming-refusals) | A streamed response ends with `stop_reason` `"refusal"` when streaming classifiers stop it for a possible policy violation. | | [Structured outputs](https://platform.…
pdf-support
Claude Developer Platform · in the page
build-with-claude/pdf-support
…d evaluation results. The key findings include..." } ], "stop_reason": "end_turn", "usage": { "input_tokens": 45000, "output_tokens": 300 } } ``` #### Option 2: Base64-encoded PDF…
preserved-thinking
Claude Developer Platform · in the page
build-with-claude/preserved-thinking
…opped blocks aren’t billed. The model answers that turn without using reasoning from dropped blocks, and the prompt cache restarts at the edit. The response lists each dropped block in `input_transfor…
change-tools-or-instructions
Claude Developer Platform · in the page
build-with-claude/preserved-thinking/change-tools-or-instructions
…block with empty text is complete, because its `signature` holds the reasoning, encrypted. A turn that holds a [`fallback` block](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fa…
fix-bound-to-a-different-conversation
Claude Developer Platform · in the page
build-with-claude/preserved-thinking/fix-bound-to-a-different-conversation
…pping thinking costs Claude can spend more output tokens working out reasoning it can no longer read. Dropping the blocks also invalidates the prompt cache from the first dropped block onward. When…
prefix-checks
Claude Developer Platform · in the page
build-with-claude/preserved-thinking/prefix-checks
…a new message at the end, and leave it there. Each thinking block’s reasoning is about exactly what came before it: `system`, `tools`, and every earlier message. That content is the block’s *prefix*…
Request 2 caches its request content (not the response)
Claude Developer Platform · in the page
build-with-claude/prompt-caching
…nerating any output. The response has an empty `content` array, `stop_reason: "max_tokens"`, and a fully populated `usage` block. Place the `cache_control` breakpoint on the last block that is shared…
claude-prompting-best-practices
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/claude-prompting-best-practices
…ruction following, long-run progress claims, memory systems, and the `reasoning_extraction` refusal category. | | Claude Sonnet 5.5 | [Prompting Claude Sonnet 5.5](https://platform.claude.com/docs/en/…
prompting-claude-fable-5
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/prompting-claude-fable-5
…ld-with-claude/thinking#configuring-thinking). For the `refusal` stop reason and fallback handling, see [Refusals and fallback](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallb…
Delivering work
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/prompting-claude-fable-5-1
…earch-triggering-at-low-effort) * Benign coding requests return `stop_reason: "refusal"`: [Reduce safeguard false positives](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/pr…
Finishing work
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/prompting-claude-fable-5-2
…claude-fable-5-2#make-reports-easy-to-follow) * Requests return `stop_reason: "refusal"`: [Safeguard refusals](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude…
prompting-claude-haiku-5-5
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/prompting-claude-haiku-5-5
…ication, mid-turn user messages, system prompt adherence in chatbots, reasoning in user-facing text, and refusals." --- This guide covers the prompting patterns specific to Claude Haiku 5.5. For the…
prompting-claude-opus-4-8
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/prompting-claude-opus-4-8
…effort there is some risk of under-thinking. If you observe shallow reasoning on complex problems, raise effort to `high` or `xhigh` rather than prompting around it. If you need to keep effort at `l…
prompting-claude-opus-5
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/prompting-claude-opus-5
…ult and the maximum, and its instruction following, tool calling, and reasoning stay consistent throughout the window. * **Office and document tasks:** Claude Opus 5 generates and works with complex,…
prompting-claude-opus-5-5
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/prompting-claude-opus-5-5
…uild-with-claude/prompt-engineering/prompting-claude-opus-5) remain a reasonable starting point. Start with the section that matches what you observe: * You’re unsure which effort level to run, or tu…
prompting-claude-sonnet-5
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/prompting-claude-sonnet-5
…effort there is some risk of under-thinking. If you observe shallow reasoning on complex problems, raise effort to `high` or `xhigh` rather than prompting around it. If you need to keep effort at `l…
prompting-claude-sonnet-5-5
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/prompting-claude-sonnet-5-5
…ld-with-claude/prompt-engineering/prompting-claude-sonnet-5) remain a reasonable starting point. For the hardest long-horizon work, an Opus model is the better choice. Start with the section that matc…
refusals-and-fallback
Claude Developer Platform · in the page
build-with-claude/refusals-and-fallback
…that happens, you receive a normal response, not an error, with `stop_reason: "refusal"`. Its `stop_details.category` names the policy area (see [What a refusal looks like](https://platform.claude.com…
search-results
Claude Developer Platform · in the page
build-with-claude/search-results
…drails/handle-streaming-refusals"> Detect and handle refusal stop reasons in streaming responses, and retry refused requests on a fallback model. </Card> <Card title="Citations" icon="book" h…
skills-guide
Claude Developer Platform · in the page
build-with-claude/skills-guide
…form operations that require multiple turns. Handle `pause_turn` stop reasons: <CodeGroup exclude="shell:cURL, shell:CLI"> <CodeGroupItem language="cURL"> This workflow needs more logic than a…
streaming
Claude Developer Platform · in the page
build-with-claude/streaming
…ngle `signature_delta`, and closes. With `display: "updates"` (beta), reasoning blocks stream the same way, and only the [progress updates](https://platform.claude.com/docs/en/build-with-claude/thinki…
structured-outputs
Claude Developer Platform · in the page
build-with-claude/structured-outputs
…Anthropic::BaseModel required :value, Float optional :reason, String, doc: "why is this number mathematically significant?" end class Output < Anthropic::BaseModel…
task-budgets
Claude Developer Platform · in the page
build-with-claude/task-budgets
…s/en/build-with-claude/effort): effort controls how thoroughly Claude reasons about each step, whereas task budgets cap the total work Claude can do across an agentic loop. ## Setting a task budget…
thinking
Claude Developer Platform · in the page
build-with-claude/thinking
…nse itself or skipped. Thinking has a cost: the tokens Claude spends reasoning are billed as output tokens, even when the thinking text isn’t returned to you, and they count toward `max_tokens` along…
thinking-steering-and-cost
Claude Developer Platform · in the page
build-with-claude/thinking-steering-and-cost
…set an intent, optionally specify the effort, and the model allocates reasoning where reasoning is likely to help. This makes thinking a strong fit for workloads that mix trivial and complex requests…
thinking-tool-workflows
Claude Developer Platform · in the page
build-with-claude/thinking-tool-workflows
…nking#preserving-thinking-blocks): dropping thinking blocks loses the reasoning in them, even without an error. The samples use adaptive thinking. On Claude Opus 4.5, Claude Sonnet 4.5, Claude Haiku…
thinking-troubleshooting
Claude Developer Platform · in the page
build-with-claude/thinking-troubleshooting
…very later request. The request then succeeds without the invalidated reasoning. On Claude Sonnet 5.5 and Claude Haiku 5.5, `block_binding` works only with `thinking: {"type": "adaptive"}`. With any o…
vision
Claude Developer Platform · in the page
build-with-claude/vision
…-quality, rotated, or very small images under 200 pixels. * **Spatial reasoning:** Claude’s coordinate and localization outputs are approximate. Follow the guidance in [Coordinates and bounding boxes]…
vision-coordinates
Claude Developer Platform · in the page
build-with-claude/vision-coordinates
…-coordinates-when-you-cannot-pre-resize)). <Note> Claude’s spatial reasoning has limits (see [Limitations](https://platform.claude.com/docs/en/build-with-claude/vision#limitations)). Coordinate acc…
working-with-messages
Claude Developer Platform · in the page
build-with-claude/working-with-messages
…"text": "Hello!" } ], "model": "claude-opus-5-5", "stop_reason": "end_turn", "stop_sequence": null, "usage": { "input_tokens": 12, "output_tokens": 6 } } ``` Refusal respo…
claude_api_primer
Claude Developer Platform · in the page
claude_api_primer
…"text": "Hello!" } ], "model": "claude-opus-5-5", "stop_reason": "end_turn", "stop_sequence": null, "usage": { "input_tokens": 12, "output_tokens": 6 } } ``` ### Multiple…
apply
Claude Developer Platform · in the page
cli-sdks-libraries/cli/apply
…r example), the plan ends with `This plan cannot be applied:` and the reason. The command then exits with `refusing to apply`. Pass `--force` to overwrite the edit or create a replacement. Deleting a…
quickstart
Claude Developer Platform · in the page
cli-sdks-libraries/cli/quickstart
…ng today? Is there something I can help you with?" } ], "stop_reason": "end_turn", "usage": { "input_tokens": 27, "output_tokens": 20 /*, ... */ } } ``` The response is the full API object,…