Source: This is a summary of a YouTube workshop video where Thariq Shihipar from Anthropic presents a comprehensive guide to the Claude Agent SDK. Watch the original video
This 2-hour workshop provides an in-depth exploration of the Claude Agent SDK, explaining how it differs from regular Claude Code and when developers should choose the SDK over standard Claude implementations. The session covers agent design patterns, the power of bash tools, and includes live coding demonstrations building a Pokemon agent.
The Claude Agent SDK is built on top of Claude Code and packages common agent infrastructure components that Anthropic repeatedly built internally. It includes tools, prompts, file systems, skills, sub-agents, web search, compacting, hooks, and memory management.
Agents build their own context and decide their own trajectories autonomously, unlike workflows which have structured inputs/outputs. Claude Code represents the first true agent where AI can work for 10-30 minutes independently.
Anthropic discovered people were using Claude Code for non-coding tasks (finance, data science, marketing). The bash tool emerged as the most powerful agent primitive, enabling flexible composition of tools and actions.
The "Anthropic way" emphasizes: Unix primitives (bash and file system), agents building their own context, code generation for non-coding tasks, and every agent having a container or running locally.
Bash is described as "the first code mode" - enabling agents to store results, generate scripts dynamically, compose functionality, and use existing software like FFmpeg or LibreOffice. This composability makes agents far more powerful than using discrete tools alone.
The SDK employs a "Swiss cheese defense" with multiple layers: model alignment, harness-level permissioning and prompting, AST path parsing on bash commands, and sandboxing to limit what malicious agents can actually do.
- Gather Context - Finding relevant files, emails, or data
- Take Action - Using tools, bash, or code generation
- Verify Work - Checking outputs, linting, testing
Verification is critical - if you can verify an agent's work, it's a great candidate for automation.
- Tools: Atomic actions requiring high control (sending emails, writing files)
- Bash: Composable actions (searching folders, linting, checking errors)
- Code Generation: Highly dynamic logic, API composition, data analysis, reusable patterns
When building agents for specific domains (spreadsheets, databases, etc.), think creatively about how to translate your data into formats the model knows well - SQL queries, XML paths, spreadsheet range syntax (B3:B5), etc.
Sub-agents are powerful for tasks requiring extensive work where only the final result needs to go into the main agent's context. The SDK handles complex bash interactions and race conditions when running parallel sub-agents.
Skills are folders containing prompts and scripts that agents can discover and load as needed, rather than cramming everything into the context window upfront. They're excellent for repeatable instructions requiring domain expertise.
Thariq demonstrates building an agent using the PokeAPI by:
- First prototyping in Claude Code with custom instructions
- Having Claude generate a TypeScript API wrapper
- Creating example scripts for the agent to reference
- Comparing tool-based approach vs bash/code-generation approach
- Showing how the agent can analyze competitive Pokemon team building from text files
Simple but not easy: Start by giving Claude Code your APIs and scripts, ask it to perform tasks, read the transcripts carefully, iterate on what works. Once you have high conviction, extract it into a standalone agent (50 lines of code in the demo).
- Local apps - Agents may drive a return to desktop applications due to overhead
- Sandboxed hosting - Use providers like Cloudflare, Modal, or Daytona
- Adaptive UIs - Run dev servers in sandboxes with live refresh for custom interfaces
- Start with Claude Code: Prototype agents directly in Claude Code before extracting to the SDK - this lets you focus on domain problems, not infrastructure
- Bash is underrated: The bash tool enables composition, memory, and dynamic script generation that discrete tools cannot match
- Think about verification first: Choose agent use cases where you can verify the work (linting, compilation, rule-based checks)
- Context engineering matters: Use the file system, not just prompts - Cloud.md files, example scripts, and skills are all forms of context
- Keep it simple: Final agent code should be elegant and minimal, not complex - "simple is not easy"
- Expect to rewrite every 6 months: As models improve, revisit your agent architecture rather than over-engineering for an uncertain future
- Progressive context disclosure: Don't load everything upfront - let agents discover and load context as needed through skills, bash discovery, and sub-agents
- Read the transcripts: The meta-learning for agent design is reading agent runs repeatedly and understanding what the model wants
- Try prototyping an agent in Claude Code with your domain-specific APIs
- Experiment with bash-based search interfaces instead of creating dozens of tools
- Design verification steps for your use case - both deterministic rules and sub-agent checks
- Consider using the file system (skills, example scripts) for context instead of cramming everything into prompts
- Join the conversation - Thariq tweets frequently about agent SDK developments at @trq212
🤖 Generated as a summary of Anthropic's Claude Agent SDK workshop featuring live demonstrations and architectural insights.