SKILL.md
Anthropic Agents Workflow
When to Choose Anthropic/Claude
- Building with Claude models
- Need computer use capabilities
- Want extended thinking (deep reasoning)
- Require strong safety/alignment features
Decision Framework
Pattern Selection
| 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: mcpagentic-ragquery_sdk("pattern example", sdk="anthropic", mode="build")
Critical Gotchas
These are Claude-specific traps:
- Tool schemas are strict - JSON schema format, not Python type hints
toolusevstoolresult- Tool calls aretooluse, responses aretoolresult- Tool IDs must match - Response must include the exact
tooluseid - ANTHROPICAPIKEY - Environment variable name is specific
- Max tokens required - Must specify
max_tokensin API calls - Stop reason matters - Check
stop_reasonto know if done or needs tool response - Computer use needs beta header - Requires
anthropic-betaheader
Workflow: Building a Claude Agent
Step 1: SDK Setup
RAG Query: mcpagentic-ragquery_sdk("anthropic python sdk install", sdk="anthropic", mode="explain")
Step 2: Tool Schema Definition
RAG Query: mcpagentic-ragquerysdk("tool inputschema definition", sdk="anthropic", mode="build")
Tools need name, description, input_schema (JSON Schema format).
Step 3: Message Construction
RAG Query: mcpagentic-ragquerysdk("messages create toolchoice", sdk="anthropic", mode="build")
Step 4: Tool Response Handling
RAG Query: mcpagentic-ragquerysdk("toolresult content block", sdk="anthropic", mode="build")
Match tooluseid exactly in your response.
Step 5: Agentic Loop
RAG Query: mcpagentic-ragquerysdk("agentic loop stopreason", sdk="anthropic", mode="build")
Loop until stopreason is not tooluse.
Common Error Patterns
| Symptom | Likely Cause | RAG Query |
|---|---|---|
| Tool not called | Bad schema | "tool input_schema" |
| Tool response ignored | Wrong tooluseid | "tool_result matching" |
| Loop never ends | Not checking stop_reason | "stopreason endturn" |
| Rate limit | Too many requests | "anthropic rate limits" |
| Schema validation error | Wrong JSON schema format | "json schema tool" |
Computer Use
Special capability for GUI automation: RAG Query: mcpagentic-ragquery_sdk("claude computer use setup", sdk="anthropic", mode="explain")
Requirements:
- Beta header required
- Screenshot handling needed
- Coordinate system understanding
Extended Thinking
For complex reasoning tasks: RAG Query: mcpagentic-ragquery_sdk("claude extended thinking", sdk="anthropic", mode="explain")
Advanced Features
Query RAG when you need:
- Streaming:
"claude streaming response" - Vision:
"claude image input" - PDF processing:
"claude pdf document" - Caching:
"claude prompt caching" - Batching:
"anthropic batch api"