Free developer tool

Free Claude Agent SDK Starter Generator

The Claude Agent SDK is Anthropic's Python and TypeScript library for building agents on the Claude Code harness, with built-in file, shell and web tools. Pick your tools, permission mode, model, custom tools, MCP servers and subagents, and this generator writes a ready-to-run project: the agent file, dependencies, an .env example and a README. It runs in your browser; you never enter an API key here.

Language
Built-in tools to pre-approve

Pre-approved tools run; any other tool needs an approval that a headless script without a canUseTool callback cannot give.

import asyncio

from dotenv import load_dotenv
from claude_agent_sdk import (
    AssistantMessage,
    ClaudeAgentOptions,
    ResultMessage,
    TextBlock,
    query,
)

load_dotenv()

TASK = "Find the TODO comments in this project and summarize what is left to do."


async def main() -> None:
    options = ClaudeAgentOptions(
        system_prompt="You are a careful engineering assistant. Read before you change anything, keep edits small, and finish with a short summary of what you did.",
        allowed_tools=["Read", "Glob", "Grep"],
        permission_mode="default",
        max_turns=20,
    )

    async for message in query(prompt=TASK, options=options):
        if isinstance(message, AssistantMessage):
            for block in message.content:
                if isinstance(block, TextBlock):
                    print(block.text)
        elif isinstance(message, ResultMessage):
            cost = message.total_cost_usd or 0
            print(f"\n[{message.subtype}] turns={message.num_turns} cost=${cost:.4f}")


if __name__ == "__main__":
    asyncio.run(main())

Generated code type-checks against @anthropic-ai/claude-agent-sdk 0.3.325 and runs on claude-agent-sdk 0.2.182 (Python 3.10+), checked November 14, 2026. See the Agent SDK docs for every option.

How to start a Claude Agent SDK project

  1. 1. Pick a language

    Choose Python (claude-agent-sdk) or TypeScript (@anthropic-ai/claude-agent-sdk).

  2. 2. Describe the job

    Name the agent, write the task prompt and the system prompt that sets its rules.

  3. 3. Choose tools and permissions

    Pre-approve built-in tools, pick a permission mode, model and turn limit, and add a custom tool, an MCP server or a reviewer subagent if you need them.

  4. 4. Copy the files and run

    Copy or download agent.py or agent.ts, the dependency file, .env.example and README, add your API key and run the agent in the project it should work on.

Claude Agent SDK FAQ

What is the Claude Agent SDK?

The Claude Agent SDK is Anthropic's library for building agents on the same harness as Claude Code. You call query() with a prompt and options, and the SDK runs the agent loop with built-in tools such as Read, Edit, Bash, Grep and WebFetch, plus MCP servers, subagents, hooks, permissions and sessions.

How is the Claude Agent SDK different from the Claude API?

The Claude API (Messages API) returns one model response at a time, and you write the tool loop and every tool yourself. The Agent SDK runs the whole loop for you and ships with file, shell and web tools, so an agent that reads and edits a codebase takes a few lines.

How is the Claude Agent SDK different from Claude Code?

Claude Code is the interactive coding assistant you use in a terminal or IDE. The Agent SDK is Claude Code packaged as a library, so your own Python or TypeScript program can run the same agent headless, with the tools, prompts and permissions you choose.

Was the Claude Agent SDK called the Claude Code SDK?

Yes. Anthropic renamed the Claude Code SDK to the Claude Agent SDK. The packages are now claude-agent-sdk on PyPI and @anthropic-ai/claude-agent-sdk on npm, and the options class in Python is ClaudeAgentOptions.

What does allowed_tools do?

allowed_tools (allowedTools in TypeScript) is a list of tools that run without asking. It does not remove other tools. Tools not on the list fall through to the permission mode, so in a headless script under the default or dontAsk mode they are denied. Use disallowed_tools to block a tool outright.

Do I need to install Claude Code to use the Agent SDK?

No. Both the Python and TypeScript packages bundle the Claude Code runtime. You need Python 3.10+ or Node.js 18.14+ and an Anthropic API key, or Claude access through a cloud provider such as Amazon Bedrock or Google Vertex AI.

Run your agents as repeatable workflows

Tornic turns AI coding agents into deterministic, multi-step workflows on the Claude Code, Codex or Cursor CLI you already pay for, with the same instructions on every run.

Explore Tornic

Related free tools