agent-sdk-quickstart

agent-sdk-quickstart is a skill for Claude Code from latestaiagents/agent-skills. It costs 99 tokens per session (1,411 once invoked), scanned C, original, MIT.

A starting guide for Anthropic's Claude Agent SDK, a framework for building agents in TypeScript or Python. It covers installation, a basic agent loop, tool definitions, and how the SDK differs from direct API calls and managed agents.

In plain words
What is it for?
Use it to start an agent project, move from hand-written API loops to the SDK, or choose between direct API calls, the SDK, and Managed Agents.
Why use it?
It gives you a clear starting point without requiring you to build the agent's tool-use loop, context reduction, and related plumbing yourself.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: mentions subagents.

Part of the claude-agent-sdk plugin — 5 skills shipped together , and of latestaiagents

Good fit Use it to start an agent project, move from hand-written API loops to the SDK, or choose between direct API calls, the SDK, and Managed Agents.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/latestaiagents/agent-skills/agent-sdk-quickstart
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add latestaiagents/agent-skills --skill agent-sdk-quickstart
Clone the repo
git clone --depth 1 https://github.com/latestaiagents/agent-skills

Made for: Claude Code.

Or install claude-agent-sdk, the plugin that ships this one along with the rest of its 5 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agent-sdk-quickstart

README.md
[![agentmods](https://agentmods.dev/badge/skills/latestaiagents/agent-skills/agent-sdk-quickstart.svg)](https://agentmods.dev/skills/latestaiagents/agent-skills/agent-sdk-quickstart)
Your own site
<a href="https://agentmods.dev/skills/latestaiagents/agent-skills/agent-sdk-quickstart"><img src="https://agentmods.dev/badge/skills/latestaiagents/agent-skills/agent-sdk-quickstart.svg" alt="Measured on agentmods" height="20"></a>
Per session 99 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,411 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00099 $0.01411
Opus 5 $0.00049 $0.00705
Sonnet 5 $0.00020 $0.00282
Haiku 4.5 $0.00010 $0.00141

Measured 3d ago against content hash 6b5ee87134f0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade C, and why

agent-sdk-quickstart scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

if (toolName === "bash" && input.command.includes("rm -rf")) {
skills/claude-agent-sdk/agent-sdk-quickstart/SKILL.md · 196 lines

How it starts

The opening of the file, as written. The whole thing — 196 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Claude Agent SDK — Quickstart

The Claude Agent SDK is Anthropic's framework for building agents. It handles the tool-use loop, context compaction, sub-agent spawning, and MCP integration so you don't reinvent them.

When to Use

  • Starting a new agent project
  • Migrating from hand-rolled messages.create loops
  • Need sub-agent orchestration, compaction, or skills out-of-box
  • Building CLI tools, automation, or backend agents

SDK vs Direct API vs Managed Agents

Approach Best for Tradeoff
Direct messages.create Simple one-shot calls You manage everything
Agent SDK (client-side) Custom agents with full control You run the loop, manage state
Managed Agents API (/v1/agents) Production agents at scale Anthropic runs the loop server-side

Use the SDK when you need more control than Managed Agents but don't want to rewrite the tool loop.

Install

TypeScript:

npm i @anthropic-ai/claude-agent-sdk

Python:

pip install claude-agent-sdk

Minimal Agent — TypeScript

import { query } from "@anthropic-ai/claude-agent-sdk";

for await (const message of query({
  prompt: "What files are in the current directory?",
  options: {
    model: "claude-sonnet-4-6",
    permissionMode: "default",
  },
})) {
  if (message.type === "assistant") {
    for (const block of message.message.content) {
      if (block.type === "text") process.stdout.write(block.text);
    }
  }
}

Under the hood: the SDK connects to Claude, provides default tools (file read, bash, web fetch), runs the tool-use loop, and streams results back.

Minimal Agent — Python

import asyncio
from claude_agent_sdk import query

async def main():
    async for msg in query(
        prompt="What files are here?",
        options={"model": "claude-sonnet-4-6"},
    ):
        if msg.type == "assistant":
            for block in msg.message.content:
                if block.type == "text":
                    print(block.text, end="")

asyncio.run(main())

Read the full file on GitHub · 196 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 196 lines · 99 tokens per session scan C 6b5ee87134f0

Subscribe to this mod's changes

agent-sdk-quickstart is a skill published in the GitHub repository latestaiagents/agent-skills (5 stars, last pushed 4mo ago), licensed MIT. It adds 99 tokens to every session and 1,411 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.