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.
ARIA · Claude Code Agent SDK
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.
Why build with it
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.
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.
One install and roughly a dozen lines gives you a working agent loop. No orchestration framework, no vector database, no boilerplate to wade through.
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
You will need Node 18+ and an Anthropic API key. Copy each block as you go.
Grab the Claude Code CLI for working in your terminal, and the Agent SDK to build agents in your own project.
# the interactive CLI $ npm install -g @anthropic-ai/claude-code # the SDK, inside your project $ npm install @anthropic-ai/claude-agent-sdk tsx
The SDK reads ANTHROPIC_API_KEY from your
environment. Create a key in the Anthropic Console, then export it.
$ export ANTHROPIC_API_KEY="sk-ant-..."
One call to query() starts the loop. Pick
a model and an allowedTools allow-list,
then stream the result.
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);
}}} 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.
$ npx tsx agent.ts
The whole thing
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.
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
Still curious? The official docs go deeper on every tool and option.
Open the SDK docsClaude 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.
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.
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.
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.
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.
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.