Starter
The smallest project that runs Claude Code in a local Docker Sandbox with the AI SDK harnesses, fetched without the monorepo and run in five minutes.
The smallest project that runs a coding agent with the AI SDK harnesses: one harness, Claude Code, in one sandbox, a local Docker Sandbox through ai-sdk-sandbox-sbx. A script of some fifty lines, agent.ts, a .env file, and three packages from npm. No clone of the monorepo, no pnpm, no build step.
Run it
You need Node.js 24 or later, and Docker Sandboxes installed and signed in (sbx login, then sbx ls answers without an error).
npx giget@latest gh:fpasquet/ai-sdk-harness/examples/starter my-agent
cd my-agent
npm install
cp .env.example .env # set CLAUDE_CODE_OAUTH_TOKEN, or ANTHROPIC_API_KEY
npm startThe agent writes a script that prints the first ten primes, runs it in the sandbox, and streams its answer, with the tools it calls:
› bash
I wrote `primes.py` in the working directory and ran it. It printed the first ten primes:
`[2, 3, 5, 7, 11, 13, 17, 19, 23, 29]`Give it a prompt of your own:
npm start -- "Write fizzbuzz in Rust and run it"The first run installs Claude Code in a sandbox and saves it as a template image, which takes a minute or two. It then keeps the sandbox, stopped, under the name ai-sdk-harness-starter: the next runs resume it in seconds, each one a new conversation in a directory of its own. sbx rm ai-sdk-harness-starter removes it.
Left empty, .env falls back to the login of the claude CLI on this machine. Whatever the credential, only a placeholder of it enters the sandbox: the Docker Sandboxes proxy swaps the real value in on the way to Anthropic.
Next steps
- Another coding agent. Install its adapter,
@ai-sdk/harness-codexfor Codex for instance, and passcreateCodex()to theHarnessAgentinstead ofcreateClaudeCode(). The AI SDK lists the adapters. - Another sandbox. A microVM booted from any OCI image, a Cloud Run sandbox or a Compute Engine VM on Google Cloud, or your machine behind Anthropic Sandbox Runtime: Choosing a sandbox compares them.
- Your project. Mount a directory, or a private clone of a repository, so the agent works on your files.
- More of the agent. Plugins, sessions that outlive a run, approvals of its commands, and the network its sandbox may reach.
- A chat. The Next.js starter streams turns to a
useChatpage, with sessions, plugins, approvals and the network, on Claude Code, Codex or Pi.
ai-sdk-harness-network
The hosts an AI SDK harness agent's sandbox may reach: trusted lists for the forges, registries, toolchains and container registries of the whole ecosystem, the hosts of each harness and model provider, and a closed network policy built from them.
Next.js starter
Every package in one Next.js app to start from, fetched without the monorepo - a useChat page talking to Claude Code, Codex or Pi in a sandbox, with sessions, approvals, the network, a repository and a marketplace of plugins.