Week 12 of 12 🏗ïļ

Claude Agent SDK & Building Apps

Claude Agent SDK āđāļĨāļ°āļāļēāļĢāļŠāļĢāđ‰āļēāļ‡āđāļ­āļ›

Claude Agent SDK & Building Apps

1. Introduction / āļšāļ—āļ™āļģ

Claude Agent SDK āđƒāļŦāđ‰āļ„āļļāļ“āļŠāļĢāđ‰āļēāļ‡āđāļ­āļ›āļžāļĨāļīāđ€āļ„āļŠāļąāļ™ AI āļ—āļĩāđˆāļāļģāļŦāļ™āļ”āđ€āļ­āļ‡āđ‚āļ”āļĒāđƒāļŠāđ‰āđ€āļ„āļĢāļ·āđˆāļ­āļ‡āļĄāļ·āļ­ Claude Code āđāļšāļšāđ‚āļ›āļĢāđāļāļĢāļĄ āļĄāļĩāļŠāļģāļŦāļĢāļąāļš Python āđāļĨāļ° TypeScript āļĢāļ­āļ‡āļĢāļąāļšāļāļēāļĢāļ—āļģāļ‡āļēāļ™āļāļąāļšāđ„āļŸāļĨāđŒ āļāļēāļĢāđ€āļ‚āđ‰āļēāļ–āļķāļ‡āđ€āļ§āđ‡āļš MCP servers hooks āđāļĨāļ° subagents — āļ—āļąāđ‰āļ‡āļŦāļĄāļ”āļˆāļēāļāđ‚āļ„āđ‰āļ”āļ‚āļ­āļ‡āļ„āļļāļ“āđ€āļ­āļ‡
The Claude Agent SDK lets you build custom AI applications using Claude Code's tools programmatically. Available for Python and TypeScript, it supports file operations, web access, MCP servers, hooks, and subagents — all from your own code.

Fun Facts / āļ‚āđ‰āļ­āđ€āļ—āđ‡āļˆāļˆāļĢāļīāļ‡āļ—āļĩāđˆāļ™āđˆāļēāļŠāļ™āđƒāļˆ

  • The SDK supports async streaming for real-time output.
  • You can resume previous sessions with their ID.
  • Permission modes control what the agent can do automatically.

2. Vocabulary / āļ„āļģāļĻāļąāļžāļ—āđŒ

Click a card to flip it. āļ„āļĨāļīāļāļāļēāļĢāđŒāļ”āđ€āļžāļ·āđˆāļ­āļžāļĨāļīāļ

SDK
āđ€āļ­āļŠāļ”āļĩāđ€āļ„
Software Development Kit — tools for building apps
API
āđ€āļ­āļžāļĩāđ„āļ­
Application Programming Interface — how programs talk
query
āļ„āļīāļ§āļĢāļĩ
To send a request and get a response
async
āļ­āļ°āļ‹āļīāļ‡āļ„āđŒ
Running without waiting for completion
stream
āļŠāļ•āļĢāļĩāļĄ
Data flowing continuously in real-time
option
āļ•āļąāļ§āđ€āļĨāļ·āļ­āļ
A setting that changes behavior
callback
āļ„āļ­āļĨāđāļšāđ‡āļ
A function called when an event happens
deploy
āļ”āļĩāļžāļĨāļ­āļĒ
To make software available for use
pipeline
āđ„āļ›āļ›āđŒāđ„āļĨāļ™āđŒ
A series of automated steps
library
āđ„āļĨāļšāļĢāļēāļĢāļĩ
A collection of pre-written code
import
āļ­āļīāļĄāļžāļ­āļĢāđŒāļ•
To bring in code from a library
production
āđ‚āļ›āļĢāļ”āļąāļāļŠāļąāļ™
The live environment users interact with

3. Grammar Focus / āđ„āļ§āļĒāļēāļāļĢāļ“āđŒ

Future Plans (going to, will, planning to) / āļāļēāļĢāļžāļđāļ”āļ–āļķāļ‡āļ­āļ™āļēāļ„āļ• (going to, will, planning to)

Thai:
āļāļēāļĢāļžāļđāļ”āļ–āļķāļ‡āļ­āļ™āļēāļ„āļ•āđƒāļŠāđ‰: 'going to' (āđāļœāļ™āļ—āļĩāđˆāļ•āļąāļ”āļŠāļīāļ™āđƒāļˆāđāļĨāđ‰āļ§), 'will' (āļ•āļąāļ”āļŠāļīāļ™āđƒāļˆāļ—āļąāļ™āļ—āļĩ/āđāļ™āđˆāļ™āļ­āļ™), 'planning to' (āļ„āļ§āļēāļĄāļ•āļąāđ‰āļ‡āđƒāļˆ) āļ•āļąāļ§āļ­āļĒāđˆāļēāļ‡: 'We are going to build an agent.' 'The SDK will handle authentication.' 'I'm planning to deploy next week.'
English:
Future plans use: 'going to' (planned decision), 'will' (spontaneous/certain), 'planning to' (intention). Example: 'We are going to build an agent.' 'The SDK will handle authentication.' 'I'm planning to deploy next week.'
āđ€āļĢāļēāļāļģāļĨāļąāļ‡āļˆāļ°āļŠāļĢāđ‰āļēāļ‡āļšāļ­āļ—āļ•āļĢāļ§āļˆāļŠāļ­āļšāđ‚āļ„āđ‰āļ”
We are going to build a code review bot.
Agent āļˆāļ°āļ›āļĢāļ°āļĄāļ§āļĨāļœāļĨāđ„āļŸāļĨāđŒāļ—āļąāđ‰āļ‡āļŦāļĄāļ”āļ­āļąāļ•āđ‚āļ™āļĄāļąāļ•āļī
The agent will process all files automatically.
āļ‰āļąāļ™āļ§āļēāļ‡āđāļœāļ™āļˆāļ°āđ€āļžāļīāđˆāļĄ MCP servers āđƒāļ™ pipeline
I'm planning to add MCP servers to the pipeline.

Section Check 1

What function sends prompts in the SDK?

āļŸāļąāļ‡āļāđŒāļŠāļąāļ™āļ­āļ°āđ„āļĢāļŠāđˆāļ‡ prompts āđƒāļ™ SDK?

Section Check 2

Which expresses a planned decision?

āļ‚āđ‰āļ­āđƒāļ”āđāļŠāļ”āļ‡āļāļēāļĢāļ•āļąāļ”āļŠāļīāļ™āđƒāļˆāļ—āļĩāđˆāļ§āļēāļ‡āđāļœāļ™āđ„āļ§āđ‰?

Section Check 3

How do you install the Python SDK?

āļ•āļīāļ”āļ•āļąāđ‰āļ‡ Python SDK āļĒāļąāļ‡āđ„āļ‡?

4. Tutorial Steps / āļ‚āļąāđ‰āļ™āļ•āļ­āļ™āļāļēāļĢāđ€āļĢāļĩāļĒāļ™āļĢāļđāđ‰

1
Install the SDK / āļ•āļīāļ”āļ•āļąāđ‰āļ‡ SDK
Run: pip install claude-agent-sdk (Python) or npm install @anthropic-ai/claude-agent-sdk (TypeScript).
2
Write a basic query / āđ€āļ‚āļĩāļĒāļ™ query āļžāļ·āđ‰āļ™āļāļēāļ™
Import query from the SDK and send a prompt with allowed_tools.
3
Add tool restrictions / āđ€āļžāļīāđˆāļĄāļ‚āđ‰āļ­āļˆāļģāļāļąāļ”āđ€āļ„āļĢāļ·āđˆāļ­āļ‡āļĄāļ·āļ­
Set allowed_tools=['Read', 'Grep'] to limit what the agent can do.
4
Connect MCP servers / āđ€āļŠāļ·āđˆāļ­āļĄāļ•āđˆāļ­ MCP servers
Pass mcp_servers config to ClaudeAgentOptions for external integrations.
5
Deploy your agent / āļ”āļĩāļžāļĨāļ­āļĒ agent āļ‚āļ­āļ‡āļ„āļļāļ“
Package your script and deploy it as a service, CI/CD step, or scheduled task.

5. Hands-On Activity / āļāļīāļˆāļāļĢāļĢāļĄāļĨāļ‡āļĄāļ·āļ­āļ—āļģ

āđāļšāļšāļāļķāļāļŦāļąāļ”: āđ€āļ‚āļĩāļĒāļ™āļŠāļ„āļĢāļīāļ›āļ•āđŒ Python āļ‡āđˆāļēāļĒāđ† āđ‚āļ”āļĒāđƒāļŠāđ‰ Agent SDK āļ—āļĩāđˆāļ­āđˆāļēāļ™āđ„āļŸāļĨāđŒāđāļĨāļ°āļŠāļĢāļļāļ› āđƒāļŠāđ‰āļŸāļąāļ‡āļāđŒāļŠāļąāļ™ query() āļžāļĢāđ‰āļ­āļĄ Read āđƒāļ™ allowed_tools
Practice: Write a simple Python script using the Agent SDK that reads a file and summarizes it. Use the query() function with Read in allowed_tools.

6. Reference Table / āļ•āļēāļĢāļēāļ‡āļ­āđ‰āļēāļ‡āļ­āļīāļ‡

Command / ToolEnglishāļ āļēāļĐāļēāđ„āļ—āļĒ
pip install claude-agent-sdkInstall Python SDKāļ•āļīāļ”āļ•āļąāđ‰āļ‡ Python SDK
query()Send prompt to agentāļŠāđˆāļ‡ prompt āđ„āļ›āļĒāļąāļ‡ agent
allowed_toolsRestrict agent toolsāļˆāļģāļāļąāļ”āđ€āļ„āļĢāļ·āđˆāļ­āļ‡āļĄāļ·āļ­ agent
permission_modeControl permissionsāļ„āļ§āļšāļ„āļļāļĄāļŠāļīāļ—āļ˜āļīāđŒ
resumeContinue a sessionāļāļĨāļąāļšāļĄāļēāļ•āđˆāļ­āđ€āļ‹āļŠāļŠāļąāļ™

7. Summary / āļŠāļĢāļļāļ›

Agent SDK āļ™āļģāļžāļĨāļąāļ‡āļ‚āļ­āļ‡ Claude Code āļĄāļēāļŠāļđāđˆāđāļ­āļ›āļžāļĨāļīāđ€āļ„āļŠāļąāļ™āļ‚āļ­āļ‡āļ„āļļāļ“ āđƒāļŠāđ‰ query() āļŠāđˆāļ‡ prompts āļāļģāļŦāļ™āļ”āļ„āđˆāļēāđ€āļ„āļĢāļ·āđˆāļ­āļ‡āļĄāļ·āļ­āđāļĨāļ°āļŠāļīāļ—āļ˜āļīāđŒ āđāļĨāļ°āļŠāļĢāđ‰āļēāļ‡ AI workflows āļ—āļĩāđˆāļāļģāļŦāļ™āļ”āđ€āļ­āļ‡ Future tenses (going to, will, planning to) āđāļŠāļ”āļ‡āđāļœāļ™āđāļĨāļ°āļāļēāļĢāļ„āļēāļ”āļāļēāļĢāļ“āđŒ
The Agent SDK brings Claude Code's power to your own applications. Use query() to send prompts, configure tools and permissions, and build custom AI workflows. Future tenses (going to, will, planning to) express plans and predictions.

Homework / āļāļēāļĢāļšāđ‰āļēāļ™

1. āļ•āļīāļ”āļ•āļąāđ‰āļ‡ Agent SDK āđƒāļ™ Python āļŦāļĢāļ·āļ­ TypeScript
2. āđ€āļ‚āļĩāļĒāļ™āļŠāļ„āļĢāļīāļ›āļ•āđŒāļ—āļĩāđˆāđƒāļŠāđ‰ Claude āļ§āļīāđ€āļ„āļĢāļēāļ°āļŦāđŒāđ„āļŸāļĨāđŒ
3. āđ€āļ‚āļĩāļĒāļ™ 5 āļ›āļĢāļ°āđ‚āļĒāļ„āđ€āļāļĩāđˆāļĒāļ§āļāļąāļšāđ‚āļ›āļĢāđ€āļˆāļāļ•āđŒ AI āđƒāļ™āļ­āļ™āļēāļ„āļ•āļ‚āļ­āļ‡āļ„āļļāļ“
1. Install the Agent SDK in Python or TypeScript.
2. Write a script that uses Claude to analyze a file.
3. Write 5 sentences about your future AI projects.