Skip to main content
Java SDK for programmatic access to Claude Code. Three APIs at different abstraction levels: Query (one-liner fire-and-forget), ClaudeSyncClient (blocking sessions), and ClaudeAsyncClient (reactive with Project Reactor). Pure Java — no native dependencies. Full Spring Boot auto-configuration. This is the SDK that powers ClaudeStep in Agent Workflow — each step runs a full multi-turn Claude session internally.

Getting Started

Overview & Quick Start

Three-API architecture, when to use each, first example

Hello World

One-line Query.text() — your first Claude Code call from Java

Tutorials

23 progressive modules from fundamentals to multi-agent orchestration:

Query & Clients

Query API, sync client, async client, message types

Configuration

CLI options, tool permissions, permission modes, structured outputs

Sessions

Multi-turn conversations, session resume, session fork

Safety & Hooks

Permission callbacks, pre/post tool-use hooks, interrupt handling

MCP Integration

External MCP servers, multiple servers, MCP with hooks

Multi-Agent

Subagent definitions, parallel subagents, orchestrator pattern

Reference

Java API Reference

All classes: Query, ClaudeSyncClient, ClaudeAsyncClient, CLIOptions, PermissionMode, HookRegistry

Source Code

SDK implementation

Tutorial Code

23 runnable tutorial modules

Role in the Lab

  • Agent Workflow uses ClaudeStep which wraps ClaudeSyncClient — each workflow step runs a full multi-turn Claude session
  • Agent Client uses the SDK for Claude Code integration with Spring Boot lifecycle and sandbox isolation
  • All experiments invoke Claude through this SDK via the experiment driver’s ClaudeSdkInvoker