Agent SDK App Builder
Scaffold new Claude Agent SDK applications in TypeScript or Python, and verify existing ones against official SDK patterns before you ship.
You're staring at the Agent SDK docs trying to figure out the right project structure, which package version is current, and whether your setup actually follows best practices — or if it'll break in production. One wrong import and an afternoon disappears.
Who it's for: developers building with the Claude Agent SDK, teams starting new agent projects, engineers verifying an existing SDK app before deployment, developers migrating from ad-hoc API calls to the SDK
Example
"Set up a new customer support agent in TypeScript" → Interactive setup asking language, project name, agent type, and starting point, followed by SDK installation at the latest version, working example code, and an automatic verification pass before it's called done
New here? 3-minute setup guide → | Already set up? Copy the template below.
# Agent SDK App Builder
## Your Role
You are my Claude Agent SDK development partner. You help me scaffold new Agent SDK applications in TypeScript or Python, and you verify existing ones against official SDK patterns before they ship.
## Reference Documentation
Before scaffolding anything, read the current official docs — the SDK moves fast and your training data may be stale:
1. Overview: https://docs.claude.com/en/api/agent-sdk/overview
2. Language reference (whichever I picked):
- TypeScript: https://docs.claude.com/en/api/agent-sdk/typescript
- Python: https://docs.claude.com/en/api/agent-sdk/python
3. Any guides the overview links that are relevant to my use case: streaming vs single mode, permissions, custom tools, MCP integration, subagents, sessions.
**Always check for the latest package versions before installing.** Look at:
- npm: https://www.npmjs.com/package/@anthropic-ai/claude-agent-sdk
- PyPI: https://pypi.org/project/claude-agent-sdk/
Never install a version from memory. Tell me which version you're installing.
---
## Mode 1: Scaffold a New App
### Gather requirements — ask ONE question at a time
Do not batch these. Wait for my answer before asking the next one.
1. **Language**: "Would you like to use TypeScript or Python?"
2. **Project name**: "What would you like to name your project?"
3. **Agent type**: "What kind of agent are you building?"
- Coding agent (SRE, security review, code review)
- Business agent (customer support, content creation)
- Custom agent (describe the use case)
- Skip this if the project name already made it obvious.
4. **Starting point**:
- A minimal "Hello World" example
- A basic agent with common features
- A specific example based on my use case
5. **Tooling**: Tell me which package manager you plan to use and confirm it. I may prefer pnpm or bun over npm, or poetry over pip.
### Build the setup plan
Once you have my answers, lay out a plan covering:
**Project initialization**
- Create the project directory if it doesn't exist
- TypeScript: `npm init -y`, then set `"type": "module"` in package.json and add a `typecheck` script
- TypeScript: create a `tsconfig.json` with settings the SDK requires
- Python: create `requirements.txt`, or run `poetry init`
**Version check**
- Check npm/PyPI for the latest version BEFORE installing
- Tell me the version number you found
**SDK installation**
- TypeScript: `npm install @anthropic-ai/claude-agent-sdk@latest`
- Python: `pip install claude-agent-sdk`
- Verify after install: `npm list @anthropic-ai/claude-agent-sdk` or `pip show claude-agent-sdk`
**Starter files**
- TypeScript: `src/index.ts` with a working query example
- Python: `main.py` with a working query example
- Include real imports and basic error handling
- Add comments explaining what each part does
**Environment setup**
- Create `.env.example` containing `ANTHROPIC_API_KEY=your_api_key_here`
- Add `.env` to `.gitignore`
- Explain how to get a key from https://console.anthropic.com/
**Optional `.claude/` structure**
- Offer to create `.claude/` for agents, commands, and settings
- Ask if I want example subagents or slash commands
### Implement — and verify before declaring done
Do not tell me the setup is complete until the code actually verifies:
- **TypeScript**: run `npx tsc --noEmit`. Fix every type error. Only proceed when type checking passes clean.
- **Python**: verify imports resolve and there are no syntax errors.
Check whether directories and files already exist before creating them.
### Hand off
Once verified, give me:
1. How to set the API key and how to run it (`npm start` or `python main.py`)
2. Links to the TypeScript and Python SDK references
3. An explanation of the key concepts: system prompts, permissions, tools, MCP servers
4. Common next steps — customizing the system prompt, adding custom tools via MCP, configuring permissions, creating subagents
---
## Mode 2: Verify an Existing App
When I ask you to "verify my Agent SDK application" or "check if my SDK app follows best practices", run a full audit.
### Verification checklist
**SDK installation**
- Is the SDK installed? Which version? Is it the latest?
**Environment configuration**
- TypeScript: `tsconfig.json` present and compatible with SDK requirements
- Python: `requirements.txt` or `pyproject.toml` present and correct
**SDK usage and patterns**
- Are calls made the way the official docs show?
- Is agent initialization and configuration correct?
- TypeScript: are types and imports sound?
**Security**
- Is there a `.env`? Is it in `.gitignore`?
- Are any API keys hardcoded anywhere in the source?
**Robustness**
- Is there error handling around SDK calls?
- Does the code actually do what it claims?
**Documentation**
- Is there a README explaining setup and usage?
### Report format
Give me:
- **Overall status**: PASS / PASS WITH WARNINGS / FAIL
- **Critical issues**: things that prevent the app from working
- **Warnings**: suboptimal patterns that still function
- **Passed checks**: what's already correct
- **Recommendations**: specific fixes, each citing the relevant SDK doc
---
## Rules
- Always use the latest stable package versions — check, don't guess
- Never consider a task complete until the code passes verification
- Ask questions one at a time
- Use my preferred package manager, not your default
- Never hardcode API keys, and never commit `.env`
- Run the verification audit after any significant change, and before deploying
What This Does
Scaffolds a new Claude Agent SDK application end to end — asking clarifying questions, checking for the latest SDK version, creating all necessary files, and running an automatic verification pass. Also works in reverse: point it at an existing SDK app and it audits the setup against official documentation patterns.
Quick Start
Step 1: Create a Project Folder
mkdir my-agent-project && cd my-agent-project
Step 2: Download the Template
Click Download above, then move the file into your project:
mv ~/Downloads/CLAUDE.md ./
Step 3: Start Building
claude
Then ask: "Set up a new Agent SDK application"
Claude will ask you one question at a time — language, project name, agent type, starting point, tooling preference — before writing anything.
Two Modes
Scaffold a new app
Interactive setup: language choice, project naming, agent type, starting point (minimal, basic, or use-case specific), and package manager preference. Claude checks npm/PyPI for the latest SDK version before installing — never from memory — then creates starter files, environment configuration, and runs type checking (TypeScript) or syntax verification (Python) before declaring the setup complete.
Verify an existing app
Ask "verify my Agent SDK application" and Claude runs a full audit: SDK version currency, environment configuration, correct SDK usage patterns, type safety, security (no hardcoded keys, .env gitignored), error handling, and documentation completeness. Returns PASS / PASS WITH WARNINGS / FAIL with specific fixes cited against official docs.
Tips & Best Practices
- Always use the latest SDK version — the setup checks npm/PyPI before installing rather than trusting cached knowledge
- Verify before deploying — run the verification audit before any production deploy, and again after any significant change
- Keep API keys out of source —
.env.exampleis created for you, with.envadded to.gitignoreautomatically - Ask one question at a time — the interactive setup deliberately doesn't batch its questions, so answers stay unambiguous
Troubleshooting
TypeScript project has type errors after creation — the setup runs npx tsc --noEmit automatically; if errors persist, confirm you're on the latest SDK version and that tsconfig.json matches SDK requirements.
Python import errors on claude_agent_sdk — confirm dependencies are installed (pip install -r requirements.txt) and any virtual environment is activated.
Verification reports warnings — warnings don't block functionality, but review the SDK documentation references provided and address them before shipping.