The Complete Claude Guide
Chapter 29 · CLI

Agent SDK and API: building on Claude Code

The Agent SDK lets you build applications using Claude Code capabilities as a library: tools, sessions, hooks and permissions. It is a developer appendix, different from the regular Claude subscription for daily use.

Verified against source on 2026-09-30

Video

Steps

  1. Understand the difference: the SDK is for building products and processes, with an API key and usage pricing, not a consumer subscription.
  2. Walk the SDK quickstart and run a minimal example in a development environment.
  3. Map the familiar concepts: session, tools, hooks and permissions exist in the SDK too, with the same caution principles.
  4. Manage API keys as secrets: environment variables or a secret manager, never in code or git.
Common pitfall: An API key exposed in git is stolen within minutes by automated scanners; revoke and replace a leaked key immediately.
Hands-on exercise: Read the SDK overview page and record three differences between it and regular Claude Code use.
Filmed demo · Video is added in the media phase

Recap

Comprehension check

What is the difference between the Agent SDK and a regular Claude subscription?

Recap

Official sources

← Previous Back to contents Next →