Prerequisites
- Java 21 or later
- Maven 3.8+
- Claude CLI installed and authenticated (
claude login)
Tutorial Structure
Getting the Code
Running a Module
Three API Styles
The SDK provides three ways to interact with Claude:
Both
ClaudeSyncClient and ClaudeAsyncClient support the full feature set: multi-turn conversations, hooks, MCP integration, and permission callbacks. They differ only in programming paradigm.
The tutorial primarily uses Query for simple examples and ClaudeSyncClient for advanced features (blocking is more accessible to most developers).