ARIA · Claude Code Agent SDK

Build AI agents
with Claude Code.

ARIA is your launchpad for building agents. Give Claude real tools, point it at a task, and let it work, with the same engine behind Claude Code in a few lines of your own code. No framework to learn, no orchestration to wire up.

  • 1 install
  • ~12 lines of code
  • 0 servers required

Why build with it

An agent is a model that can take action on your behalf.

01

Real tools, not just chat

Your agent can Read files, run Bash, and fetch the web. You hand it an allow-list and it decides when to use each one, in a loop, until the job is done.

02

Bring your own key and model

Use your own Anthropic API key and pick the model per task. Reach for Sonnet when you want speed and value, Opus when the reasoning gets hard.

03

From idea to running in minutes

One install and roughly a dozen lines gives you a working agent loop. No orchestration framework, no vector database, no boilerplate to wade through.

04

Deploy anywhere it is just code

An agent is plain Node. Ship it to a server, a queue worker, a cron job, or behind a small web UI like this very page. Wherever your code runs, it runs.

Get started

Four steps to your first agent.

You will need Node 18+ and an Anthropic API key. Copy each block as you go.

  1. 1

    Install the tools

    Grab the Claude Code CLI for working in your terminal, and the Agent SDK to build agents in your own project.

    bash
     # the interactive CLI $ npm install -g @anthropic-ai/claude-code # the SDK, inside your project $ npm install @anthropic-ai/claude-agent-sdk tsx
    
  2. 2

    Set your API key

    The SDK reads ANTHROPIC_API_KEY from your environment. Create a key in the Anthropic Console, then export it.

    bash
     $ export ANTHROPIC_API_KEY="sk-ant-..." 
  3. 3

    Write the agent

    One call to query() starts the loop. Pick a model and an allowedTools allow-list, then stream the result.

    agent.ts
     import { query }from "@anthropic-ai/claude-agent-sdk";
    const agent = query({
    prompt: "Read package.json and tell me what this project does.",
      options: {
    model: "sonnet",
        allowedTools: ["Read", "Bash", "WebFetch"],
        permissionMode: "acceptEdits",
    },
    });
    for await (const msg of agent) {if (msg.type === "assistant") {for (const block of msg.message.content) {if (block.type === "text") process.stdout.write(block.text);
    }}}
  4. 4

    Run it, then ship it

    Run locally to watch it work. When you are happy, deploy it anywhere Node runs. This page itself is a static build on Cloudflare Pages.

    bash
     $ npx tsx agent.ts
    

The whole thing

A complete agent that triages a repo.

This is the entire program. It reads the project, runs a couple of safe commands, and writes a short report to disk. Everything between the prompt and the tools is handled by Claude inside the loop.

  • maxTurns caps how long the agent runs.
  • allowedTools is the only thing it is allowed to touch.
  • result arrives once when the work is finished.
triage.ts
 import { query }from "@anthropic-ai/claude-agent-sdk";
import { writeFile }from "node:fs/promises";
const agent = query({
prompt:
"Skim the codebase, find anything risky or unfinished, " +
"and summarise it as five bullet points.",
  options: {
model: "sonnet",
    maxTurns: 12,
    allowedTools: ["Read", "Grep", "Bash"],
    permissionMode: "acceptEdits",
},
});
let report = "";
for await (const msg of agent) {if (msg.type === "assistant") {for (const b of msg.message.content)
if (b.type === "text") report += b.text;
}if (msg.type === "result")
await writeFile("TRIAGE.md", report);
} 

FAQ

Questions, answered.

Still curious? The official docs go deeper on every tool and option.

Open the SDK docs
What is the difference between Claude Code and the Agent SDK?

Claude Code is the interactive agent you run in your terminal. The Claude Agent SDK is the library that powers it, so you can build your own agents on the same loop, tools, and permission model.

Do I need an Anthropic API key?

Yes. Create one in the Anthropic Console and set it as ANTHROPIC_API_KEY. The SDK is open and free to use; you pay only for the model tokens your agent consumes.

Which model should I choose?

Start with Sonnet for everyday work, it is fast and cost effective. Switch to Opus for the hardest reasoning or long, multi-step tasks. You set it with the model option, so it is one line to change.

How do I give an agent tools safely?

The allowedTools array is an allow-list. Anything not on it simply does not exist for the agent. Keep that list tight, and avoid bypassPermissions outside local development; use acceptEdits or a permission callback instead.

Where can I deploy an agent?

Anywhere Node runs: a server, a container, a queue worker, a scheduled job, or behind a small web app. The agent is just code, so your usual deployment path works.

Can it write and edit files, not just read them?

Yes. Add tools like Write and Edit to the allow-list and the agent can change files, run builds, and verify its own work, the same way Claude Code does on your machine.

Point Claude at a task and watch it work.

Start building