Workflow patterns and gotchas for Anthropic/Claude agents. Directs to RAG for implementation.
| Need | Pattern | RAG Query |
|---|---|---|
| Basic tool use | Tool definitions | "claude tool definition" |
| Agentic loop | Iterative tool calling | "claude agentic loop" |
| Computer control | Computer use | "claude computer use" |
| Deep reasoning | Extended thinking | "claude extended thinking" |
| Conversation | Message history | "claude conversation history" |
Query RAG: mcp__agentic-rag__query_sdk("pattern example", sdk="anthropic", mode="build")
These are Claude-specific traps:
tool_use vs tool_result - Tool calls are tool_use, responses are tool_resulttool_use_idmax_tokens in API callsstop_reason to know if done or needs tool responseanthropic-beta headerRAG Query: mcp__agentic-rag__query_sdk("anthropic python sdk install", sdk="anthropic", mode="explain")
RAG Query: mcp__agentic-rag__query_sdk("tool input_schema definition", sdk="anthropic", mode="build")
Tools need name, description, input_schema (JSON Schema format).
RAG Query: mcp__agentic-rag__query_sdk("messages create tool_choice", sdk="anthropic", mode="build")
RAG Query: mcp__agentic-rag__query_sdk("tool_result content block", sdk="anthropic", mode="build")
Match tool_use_id exactly in your response.
RAG Query: mcp__agentic-rag__query_sdk("agentic loop stop_reason", sdk="anthropic", mode="build")
Loop until stop_reason is not tool_use.
| Symptom | Likely Cause | RAG Query |
|---|---|---|
| Tool not called | Bad schema | "tool input_schema" |
| Tool response ignored | Wrong tool_use_id | "tool_result matching" |
| Loop never ends | Not checking stop_reason | "stop_reason end_turn" |
| Rate limit | Too many requests | "anthropic rate limits" |
| Schema validation error | Wrong JSON schema format | "json schema tool" |
Special capability for GUI automation:
RAG Query: mcp__agentic-rag__query_sdk("claude computer use setup", sdk="anthropic", mode="explain")
Requirements:
For complex reasoning tasks:
RAG Query: mcp__agentic-rag__query_sdk("claude extended thinking", sdk="anthropic", mode="explain")
Query RAG when you need:
"claude streaming response""claude image input""claude pdf document""claude prompt caching""anthropic batch api"