Chapter 2
Quickstart
Get started with the Python or TypeScript Agent SDK to build AI agents that work autonomously.
Use the Agent SDK to build an AI agent that reads your code, finds bugs, and fixes them—all without manual intervention.
What you'll do:
- •Set up a project with the Agent SDK
- •Create a file with some buggy code
- •Run an agent that finds and fixes the bugs automatically
Prerequisites
Setup
Install Claude Code
The Agent SDK uses Claude Code as its runtime. Install it for your platform:
After installing Claude Code onto your machine, run claude in your terminal and follow the prompts to authenticate. The SDK will use this authentication automatically.
For more information on Claude Code installation, see Claude Code setup.
Create a project folder
Create a new directory for this quickstart:
For your own projects, you can run the SDK from any folder; it will have access to files in that directory and its subdirectories by default.
Install the SDK
Install the Agent SDK package for your language:
Set your API key
If you've already authenticated Claude Code (by running claude in your terminal), the SDK uses that authentication automatically.
Otherwise, you need an API key, which you can get from the Claude Console.
Create a .env file in your project directory and store the API key there:
Using Amazon Bedrock, Google Vertex AI, or Microsoft Azure? See the setup guides for Bedrock, Vertex AI, or Azure AI Foundry.
Note: Unless previously approved, Anthropic does not allow third party developers to offer claude.ai login or rate limits for their products, including agents built on the Claude Agent SDK. Please use the API key authentication methods described in this document instead.