Skip to main content
This is how you develop your agent:
1

Edit

Edit your agent code in handle_query.py
class Handler:
  async def handle_query(
      self,
      prompt: str,
      session_id: str | None = None,
      **kwargs,
  ) -> AsyncIterator[Message]:
      opts = ClaudeAgentOptions(...)
      async for message in query(prompt=prompt, options=opts):
          # ... your agent logic
          yield message
2

Add dependencies (optional)

Add any additional Python packages using uv:
uv add requests  # Example: adding the requests library
You can install uv by following the instructions in the uv documentation.
3

Test

sb0 agent run --prompt "Hello"
Use --session-id to continue conversations across queries:
sb0 agent run --prompt "What is 2+2?" --session-id "test-id"
sb0 agent run --prompt "What did I ask?" --session-id "test-id"

Iterate

Repeat until satisfied.

Adding Dependencies