Varun Vemulapalli

Day 72 of 100 · Phase 9: Claude for builders

The Claude Agent SDK: what it is and when to use it

2 min readBy Varun Vemulapalli

A contract auto-renews because nobody noticed the 90-day notice window. That's not an AI problem. It's a "nobody checks every week" problem.

Today: the Claude tool built for agents that check every week.

Video explainer · 1:46
Key takeaway

Use the API for single calls, Claude Code for hands-on work, and the Agent SDK when your own program needs an agent that reads, acts and loops without you.

Day 72 visual: The Claude Agent SDK: what it is and when to use it
The visual from the original post.

The concept

The Claude Agent SDK is a Python and TypeScript library that gives your own program the agent loop and built-in tools behind Claude Code: read files, run commands, search the web, plus hooks, subagents, MCP and permissions.

Agent loop (Day 36): think, act, observe, repeat until done.

Four Claude options, one question: who runs the loop?

  • Claude API (Days 67–68): you write the tool loop yourself. Best for one clear call: summarize, classify, extract.
  • Claude Code (Days 69–70): you, working interactively.
  • Agent SDK: Claude Code's loop as a library inside your app, running without you, e.g. on a schedule.
  • Managed Agents: Anthropic hosts the loop for you.

Walkthrough: weekly vendor-contract renewal check

A procurement team keeps one text summary per vendor contract in a folder: vendor, renewal date, notice period. Illustrative numbers, checked on 12 December:

1. Vendor A renews 1 February with 60 days' notice. Deadline: 3 December. Already passed.
2. Vendor B renews 31 March with 90 days' notice. Deadline: 31 December. 19 days left.

With the API alone, you'd code the file listing, reading and looping. With the Agent SDK, you give one instruction and allow two tools:

prompt: "Read every file in contracts/. List contracts whose notice deadline is within 45 days or already passed, soonest first."
allowed tools: Read, Glob (find files). Nothing that edits or deletes.

The agent finds the files, reads them, does the date math and returns the list. A scheduler runs it every Monday.

Why it fits: many files, several steps, no human at the keyboard. A person still decides what to renew.

Where you see it at work

  • Banking: weekly checks of vendor and outsourcing contracts.
  • Insurance: policy files missing a required document.
  • Healthcare: licence and certification expiry tracking.

Try it today (10–15 min)

1. Read the comparison table: https://code.claude.com/docs/en/agent-sdk/overview
2. Note the setup: Python 3.10+ or Node 18+, then pip install claude-agent-sdk (or npm install @anthropic-ai/claude-agent-sdk), and an API key from the Claude Console in ANTHROPIC_API_KEY.
3. Skim the quickstart's first agent: https://code.claude.com/docs/en/agent-sdk/quickstart
4. Pick one weekly check at work and mark it: API, Claude Code or Agent SDK?

In one sentence

Use the API for single calls, Claude Code for hands-on work, and the Agent SDK when your own program needs an agent that reads, acts and loops without you.

What weekly check at your job would you hand to an agent first? 👇