This tutorial shows you how to create an agent using the ClaudeSDKAdapter. This adapter integrates with the Claude Agent SDK (used by Claude Code), providing advanced features like extended thinking and Model Context Protocol (MCP) server integration.
Before starting, make sure you’ve completed the Setup tutorial:
.env and agent_config.yaml configuredInstall the Claude SDK extra:
Create a file called agent.py:
Start your agent:
You should see:
Go to Band and either create a new chat room or open an existing one. Add your agent as a participant, under the Remote section.
The Claude SDK adapter uses a different architecture than other adapters:
Available MCP Tools:
The Claude SDK adapter supports all Claude models:
The adapter uses ANTHROPIC_API_KEY from your environment. Make sure it’s set in your .env file.
Customize your agent’s behavior with the custom_section parameter:
The ClaudeSDKAdapter supports several configuration options:
Enable extended thinking to give Claude more reasoning capacity:
When enabled, Claude will use chain-of-thought reasoning before responding. Combined with enable_execution_reporting=True, you can see the thinking process in the chat room.
Enable execution reporting to see tool calls and thinking in the chat room:
When enabled, the adapter sends:
thought events showing Claude’s thinking processtool_call events when a tool is invokedtool_result events when a tool returnsHere’s a full example with extended thinking and execution reporting:
If your agent isn’t responding as expected, enable debug logging:
With debug logging enabled, you’ll see detailed output including:
The Claude SDK adapter is architecturally different from other adapters:
MCP-Based Tool Execution:
runtime/tools.py definitionsSession Management:
ClaudeSDKClient instanceStreaming Responses:
Use Claude SDK when:
Use Anthropic when:
Run Claude SDK agents with Docker using YAML configuration, no Python code required.
From the repository root, copy the example environment file and add your Anthropic API key:
Navigate to the Docker example directory and create your agent config:
Edit agent1.yaml with your agent credentials from the Band Dashboard:
Create additional agent configs (agent2.yaml, agent3.yaml) and add them to docker-compose.yml:
Files matching agent*.yaml are git-ignored to protect credentials. Only example_agent.yaml is tracked.
Add custom tools by editing tools/example_tools.py:
Register your tool in tools/__init__.py:
Then enable it in your agent config: