773 pages for write.
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
…ostics = new() { PreviousMessageID = r1.ID }, } ); Console.WriteLine(r2.Diagnostics switch { null => "No divergence detected.", { CacheMissReason: null } => "Comparison still…
citations
Claude Developer Platform · in the page
build-with-claude/citations
…}, }, ], } ); Console.WriteLine(response); ``` ```go Go client := anthropic.NewClient() response, err := client.Messages.New(context.TODO(), a…
claude-in-amazon-bedrock
Claude Developer Platform · in the page
build-with-claude/claude-in-amazon-bedrock
…if (item.Value is TextBlock block) { Console.WriteLine(block.Text); break; } } ``` </Tab> <Tab title="Go"> ```go client, err := bedroc…
claude-in-microsoft-foundry
Claude Developer Platform · in the page
build-with-claude/claude-in-microsoft-foundry
…ges = [new UserMessageParam { Content = "Hello!" }], }); Console.WriteLine( string.Join("", response.Content .Select(block => block.Value) .OfType<TextBlock>()…
anthropic-managed
Claude Developer Platform · in the page
build-with-claude/claude-models-on-google-cloud/anthropic-managed
…var message = await client.Messages.Create(parameters); Console.WriteLine(message); ``` ```go Go import ( "context" "fmt" "github.com/anthropics/anthropic-sdk-go/v2" "github.…
google-managed
Claude Developer Platform · in the page
build-with-claude/claude-models-on-google-cloud/google-managed
…var message = await client.Messages.Create(parameters); Console.WriteLine(message); ``` ```go Go import ( "context" "fmt" "github.com/anthropics/anthropic-sdk-go/v2" "github.…
claude-on-amazon-bedrock-legacy
Claude Developer Platform · in the page
build-with-claude/claude-on-amazon-bedrock-legacy
…foreach (var summary in response.ModelSummaries) { Console.WriteLine(summary.ModelId); } ``` ```go Go import ( "context" "fmt" "log" "github.com/aws/aws-sdk-go-v2/conf…
claude-platform-on-aws
Claude Developer Platform · in the page
build-with-claude/claude-platform-on-aws
…ages = [new UserMessageParam { Content = "Hello!" }] }); Console.WriteLine(message); ``` ```go Go client, err := anthropicaws.NewClient(context.Background(), anthropicaws.ClientConfig{})…
sent_count = len(messages sent in the compaction request)
Claude Developer Platform · in the page
build-with-claude/compaction
…mary.  The previous…
compaction-background
Claude Developer Platform · in the page
build-with-claude/compaction-background
…n.Compaction) { return history; } Console.WriteLine($"Swapped {sent} messages"); // Replace exactly the messages the compaction request held. Later turns stay after t…
compaction-keep-recent-turns
Claude Developer Platform · in the page
build-with-claude/compaction-keep-recent-turns
…, .. recent, ]; Console.WriteLine($"Kept {recent.Count / 2} turns after the block"); } } } ``` ```go Go ctx := context.Background…
compaction-on-demand
Claude Developer Platform · in the page
build-with-claude/compaction-on-demand
…aCompactionConfig(), // type defaults to "summarize" }); Console.WriteLine($"Stop reason: {response.StopReason?.Raw()}"); ``` ```go Go client := anthropic.NewClient() history := []anthr…
compaction-thinking-blocks
Claude Developer Platform · in the page
build-with-claude/compaction-thinking-blocks
…econd.Content.Count(block => block.TryPickThinking(out _)); Console.WriteLine($"Thinking blocks in the kept turn: {thinkingBlocks}"); // 2. Summarize the first turn. The second turn stays out of…
compaction-threshold
Claude Developer Platform · in the page
build-with-claude/compaction-threshold
…ame>  </Frame> ##…
context-editing
Claude Developer Platform · in the page
build-with-claude/context-editing
…e a minimum number of tokens is cleared each time. You'll incur cache write costs each time content is cleared, but subsequent requests can reuse the newly cached prefix. * **Thinking block clearing:…
effort
Claude Developer Platform · in the page
build-with-claude/effort
…var message = await client.Messages.Create(parameters); Console.WriteLine(message); ``` ```go Go client := anthropic.NewClient() response, err := client.Messages.New(context.TODO(), an…
extended-thinking
Claude Developer Platform · in the page
build-with-claude/extended-thinking
…f (block.TryPickThinking(out var thinking)) { Console.WriteLine($"\nThinking summary: {thinking.Thinking}"); } else if (block.TryPickText(out var text)) { C…
fallback-credit
Claude Developer Platform · in the page
build-with-claude/fallback-credit
…first model must be written into the new model's cache in full. Cache writes cost more than cache reads. Fallback credit removes that extra cost. The refusal carries a credit token, you echo the token…
fast-mode
Claude Developer Platform · in the page
build-with-claude/fast-mode
…if (block.TryPickText(out var textBlock)) { Console.WriteLine(textBlock.Text); } } ``` ```go Go client := anthropic.NewClient() response, err := client.Messages.New…
files
Claude Developer Platform · in the page
build-with-claude/files
…on/pdf") } }); var fileId = uploaded.ID; Console.WriteLine(fileId); ``` ```go Go f, err := os.Open("/path/to/document.pdf") if err != nil { log.Fatal(err) } defer…
handling-stop-reasons
Claude Developer Platform · in the page
build-with-claude/handling-stop-reasons
…ock.TryPickText(out var textBlock)) { Console.WriteLine(textBlock.Text); } } } ``` ```go Go client := anthropic.NewClient() response, err := client.…
mid-conversation-effort-example
Claude Developer Platform · in the page
build-with-claude/mid-conversation-effort-example
…} from "node:crypto"; import { mkdtempDisposable, readFile, rename, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; import Anthropic f…
mid-conversation-system-messages
Claude Developer Platform · in the page
build-with-claude/mid-conversation-system-messages
…if (block.TryPickText(out var text)) { Console.WriteLine(text.Text); } } ``` ```go Go client := anthropic.NewClient() response, err := client.Beta.Messages.New…
multilingual-support
Claude Developer Platform · in the page
build-with-claude/multilingual-support
…stem": "Always respond in French, regardless of the language the user writes in.", "messages": [ {"role": "user", "content": "How do I reset my password?"} ] }' ``` ```bas…
pdf-support
Claude Developer Platform · in the page
build-with-claude/pdf-support
…document?"), }, }, ], }); Console.WriteLine(string.Join("\n", message.Content)); ``` ```go Go client := anthropic.NewClient() message, err := client.Messa…
preserved-thinking
Claude Developer Platform · in the page
build-with-claude/preserved-thinking
…d-with-claude/preserved-thinking#per-turn-reminders) and removes or rewrites it later * [Drops some `thinking` blocks and keeps later ones](https://platform.claude.com/docs/en/build-with-claude/preser…
Request 2 caches its request content (not the response)
Claude Developer Platform · in the page
build-with-claude/prompt-caching
…var message = await client.Messages.Create(parameters); Console.WriteLine(message.Usage); ``` ```go Go client := anthropic.NewClient() response, err := client.Messages.New(context.TODO…
claude-prompting-best-practices
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/claude-prompting-best-practices
…var message = await client.Messages.Create(parameters); Console.WriteLine(message); ``` ```go Go client := anthropic.NewClient() message, err := client.Messages.New(context.TODO(), ant…
prompting-claude-fable-5
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/prompting-claude-fable-5
…ord lessons from previous runs and reference them. Provide a place to write notes, as simple as a Markdown file: ```text wrap Store one lesson per file with a one-line summary at the top. Record corr…
Delivering work
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/prompting-claude-fable-5-1
…rewritten for small changes: [Prefer targeted edits over whole-file rewrites](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-fable-5-1#prefer-targeted-edits-…
prompting-claude-haiku-5-5
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/prompting-claude-haiku-5-5
…0 error. * At `xhigh` effort in multi-turn chats, the model sometimes writes its whole answer in its thinking and ends the turn with no visible text. If you see this behavior, check each response for…
prompting-claude-opus-5
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/prompting-claude-opus-5
…:** Claude Opus 5 coordinates teams of subagents well, with effective writer-verifier patterns and few cases of agents overwriting each other's work. For cost-sensitive workloads, cap delegation; see…
prompting-claude-opus-5-5
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/prompting-claude-opus-5-5
…tions that stood in for thinking.** If your prompt asked the model to write its reasoning in the response as a substitute for thinking, remove that instruction and read the reasoning from [summarized…
prompting-claude-sonnet-5-5
Claude Developer Platform · in the page
build-with-claude/prompt-engineering/prompting-claude-sonnet-5-5
…el not to think. Such instructions make it more likely that the model writes internal XML tags in its visible output. * **Read the response by block type.** With adaptive thinking, a response can star…
refusals-and-fallback
Claude Developer Platform · in the page
build-with-claude/refusals-and-fallback
…/en/build-with-claude/refusals-and-fallback#client-side-fallback) or [write the retry yourself](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#manual-retry). <CodeGroup>…
search-results
Claude Developer Platform · in the page
build-with-claude/search-results
…4, Messages = messages, }); Console.WriteLine(finalResponse); break; } } ``` ```go Go client := anthropic.NewClient() knowledgeBaseTool…
skills-guide
Claude Developer Platform · in the page
build-with-claude/skills-guide
…cs/en/agents-and-tools/agent-skills/best-practices"> Learn how to write effective Skills that Claude can discover and use successfully. </Card> </CardGroup> ## Overview <Note> For a detailed…
streaming
Claude Developer Platform · in the page
build-with-claude/streaming
…msg in client.Messages.CreateStreaming(parameters)) { Console.Write(msg); } ``` ```go Go client := anthropic.NewClient() stream := client.Messages.NewStreaming(context.TODO(), anth…
structured-outputs
Claude Developer Platform · in the page
build-with-claude/structured-outputs
…ContactInfo>().FirstOrDefault() is { } contact) { Console.WriteLine(contact); } public record ContactInfo { public string Name { get; set; } = ""; public strin…
task-budgets
Claude Developer Platform · in the page
build-with-claude/task-budgets
…}); var response = await responseUpdates.Aggregate(); Console.WriteLine(response.Usage); ``` ```go Go client := anthropic.NewClient() stream := client.Beta.Messages.NewStreaming(cont…
thinking
Claude Developer Platform · in the page
build-with-claude/thinking
…yPickThinking(out ThinkingBlock? thinking)) { Console.WriteLine($"\nThinking: {thinking.Thinking}"); } else if (block.TryPickText(out TextBlock? text)) { Co…
thinking-steering-and-cost
Claude Developer Platform · in the page
build-with-claude/thinking-steering-and-cost
…ntent.Substring(0, Math.Min(10000, bookContent.Length)); Console.WriteLine("First request - establishing cache"); var parameters1 = new MessageCreateParams { Model = Model.ClaudeO…
thinking-tool-workflows
Claude Developer Platform · in the page
build-with-claude/thinking-tool-workflows
…var message = await client.Messages.Create(parameters); Console.WriteLine(message); ``` ```go Go client := anthropic.NewClient() weatherTool := anthropic.ToolUnionParam…
thinking-troubleshooting
Claude Developer Platform · in the page
build-with-claude/thinking-troubleshooting
…d"}. The model does not think before responding. The short updates it writes between tool calls come back as thinking blocks. ``` To turn off up-front thinking on Claude Sonnet 5.5, send `thinking: {…
token-counting
Claude Developer Platform · in the page
build-with-claude/token-counting
…r response = await client.Messages.CountTokens(parameters); Console.WriteLine(response); ``` ```go Go client := anthropic.NewClient() response, err := client.Messages.CountTokens(context.T…
vision
Claude Developer Platform · in the page
build-with-claude/vision
…this image.")), }, } ] }); Console.WriteLine(message); ``` ```go Go client := anthropic.NewClient() imageData := "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd…
vision-coordinates
Claude Developer Platform · in the page
build-with-claude/vision-coordinates
…/ The A4 example from "How Claude resizes and pads images": Console.WriteLine(ResizedSize(1075, 1520)); // (924, 1307) ``` ```go Go // countImageTokens is the visual tokens consumed by an ima…
working-with-messages
Claude Developer Platform · in the page
build-with-claude/working-with-messages
…; var message = await client.Messages.Create(parameters); Console.WriteLine(message); ``` ```go Go client := anthropic.NewClient() response, err := client.Messages.New(context.TODO(), an…
API usage primer for Claude
Claude Developer Platform · in the page
claude_api_primer
…et_tokens` must be less than `max_tokens` so that Claude has space to write its response after thinking is complete. ## Thinking with tool use Thinking can be used alongside tool use, allowing Claud…
apply
Claude Developer Platform · in the page
cli-sdks-libraries/cli/apply
…approve the plan it shows. Then you commit the `claude-lock.json` it writes, so the next run updates the same resources instead of creating new ones. To install and authenticate the CLI, see the [CL…