cd /news/ai-agents/program-claude-code-codex-pi-and-oth… · home topics ai-agents article
[ARTICLE · art-25294] src=vercel.com ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Program Claude Code, Codex, Pi and other agent harnesses with AI SDK

AI SDK 7 introduces `HarnessAgent`, a unified API that lets developers run established agent harnesses including Claude Code, Codex, and Pi through a single interface. The new abstraction allows users to switch between different agent harnesses without rewriting code, while maintaining sandboxed workspaces and compatibility with existing AI SDK tooling.

read1 min publishedJun 12, 2026

AI SDK 7 introduces HarnessAgent , a single API for running established agent harnesses, including Claude Code, Codex, and Pi. AI SDK has always let you switch models without rewriting your agent. Now you can switch the harness the same way.

Write the agent once. Use the best harness available. Today. In 3 months. A year from now.

Harnesses manage the components above a model call, including skills, sandboxes, sessions, permission flows, compaction, runtime configuration, and sub-agents. The AI SDK normalizes access to those capabilities through a unified harness abstraction.

Initial harness adapters for this experimental release include Claude Code, Codex, and Pi, with more coming soon.

Swap claudeCode

for codex or pi

and keep the same HarnessAgent

flow. Every harness runs the agent in a sandboxed workspace, keeping the host environment safe.

Both `HarnessAgent.generate()`

and `HarnessAgent.stream()`

return AI SDK-compatible results. If your app already uses `useChat`

or related AI SDK tooling, you can swap in HarnessAgent

without changing your user interface code.

HarnessAgent

is available on the AI SDK canary release. Read the AI SDK harness documentation to get started.

── more in #ai-agents 4 stories · sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/program-claude-code-…] indexed:0 read:1min 2026-06-12 ·