Tutorials · Claude Agent SDK · examplesExample code
Example code
Claude Agent SDK examples
Every script and captured output quoted in the tutorial. Open a file to read it highlighted, or download everything.
Claude Agent SDKContents
Run a demo
pip install claude-agent-sdk pydantic
export ANTHROPIC_API_KEY=sk-ant-...
cd examples/python && python3 01_hello.py
On first run demo_util.py copies sample-project to examples/project, the working copy the demos change. Delete it to start fresh.
| Name | What it shows | Used in | Size |
|---|---|---|---|
| outputs/ | The captured output of every run quoted in the tutorial | 33 files | |
| python/ | Python demos: one SDK feature or pattern per script | 33 files | |
| sample-project/ | The tiny project every demo runs against | 5 files | |
| typescript/ | The TypeScript agent and its package manifest | 2 files |