From CLI to SDK: Programmatic Claude Code
- Treating the agent loop as a library: invoking, streaming, and capturing structured output through the SDK / agent harness
- Embedding headless mode inside your own apps, bots, and services
- Seeding context, persisting state, and resuming work across invocations
- Drawing the decision boundary between an interactive session and an automated agent