Token-efficient
An agent is 30โ38% fewer tokens than the equivalent JSON-schema + SDK boilerplate it replaces โ cheaper to write, read, and generate. Measured, not guessed.
See the benchmarks
Write an AI agent as a tiny, declarative .agent file in a token-oriented syntax derived from TOON. The toac compiler turns it into readable, fully-typed TypeScript that runs on Claude โ 30โ38% fewer tokens than the JSON it replaces.

You describe what the agent is; the compiler writes how it works.
agent: researcher
model: claude-opus-4-7
description: Research a topic and return a sourced summary.
inputs[1]{name,type}:
topic,string
tools[2]: web_search,fetch_page
prompt: |
You are a research analyst. Research: {inputs.topic}
Use web_search to find sources, then fetch_page to read them.
Return a cited summary.
outputs[2]{name,type}:
summary,string
sources,string[]// Generated by toac from researcher.agent โ do not edit.
import { createAgent, type Agent } from "toad-runtime";
import { z } from "zod";
import { web_search, fetch_page } from "./researcher.tools";
export interface ResearcherInput {
topic: string;
}
export interface ResearcherOutput {
summary: string;
sources: string[];
}
const inputSchema = z.object({
topic: z.string(),
});
const outputSchema = z.object({
summary: z.string(),
sources: z.array(z.string()),
});
export const researcher: Agent<ResearcherInput, ResearcherOutput> = createAgent({
name: "researcher",
model: "claude-opus-4-7",
description: "Research a topic and return a sourced summary.",
tools: { web_search, fetch_page },
inputSchema,
outputSchema,
prompt: (inputs: ResearcherInput) =>
`You are a research analyst. Research: ${inputs.topic}
Use web_search to find sources, then fetch_page to read them.
Return a cited summary.`,
});
export default researcher;That .agent file is 101 tokens; the same agent written as JSON is 162 tokens โ and at runtime, toolResultFormat: "auto" feeds tabular tool results back to the model as TOON when it's cheaper, saving another 30โ40% per result.
# the compiler + `toac` CLI
npm i -g toad-compiler
# the runtime your compiled agents import
npm i toad-runtime @anthropic-ai/sdktoac build researcher.agent # โ researcher.tsTOAD is MIT-licensed and early. Star it, file an issue, or send a PR โ the compiler, runtime, language features, and docs are all fair game.