Skip to content
WIP

This guide is a work in progress — it is incomplete and parts are out of date.

Adapters

Barry runs a session on one of four coding agents, each through its own adapter. The four are Claude Code, Codex, Cursor, and OpenCode. Barry has no default adapter. The identity or the session chooses one.

The capability declarations are in capabilities.ts, and they describe what Barry implements, not everything each vendor’s tool can do. The adapter notes cover the contracts behind them.

Agent ID Session flag Credential
Claude Code claude None. Set it on the identity, or use an endpoint flag ANTHROPIC_API_KEY from the identity. Without it, Claude Code uses your own login
Codex codex --codex OPENAI_API_KEY from the identity. Without it, the request carries no credential, and Barry’s session API logs a warning
Cursor cursor --cursor Cursor’s own login
OpenCode opencode --opencode OpenCode’s own configuration

z.ai and Ollama are model endpoints, not agents. They serve models over the Anthropic Messages API, so a session on either one runs the Claude Code agent against a different base URL. Barry refuses an agent flag combined with an endpoint that agent cannot reach.

Endpoint Key Flag Endpoint’s default model Address and credential
z.ai zai --zai glm-5.2 https://api.z.ai/api/anthropic, with Z_AI_API_KEY
Ollama ollama --ollama qwen3:4b BARRY_OLLAMA_URL from the session environment, else the port registry. Barry always sends a placeholder key, never your Anthropic credential

A Claude Code session with no endpoint uses Claude Code’s own.

The model catalog is sdk/lib/models.yaml. It is advisory: -m accepts a model ID the catalog does not list, with a warning.

Before an Ollama session starts, Barry checks whether the model makes a real tool call and prints the result. The session starts whatever the result.

Choose the adapter for every session of an identity, or for one session:

Flag or command Effect
barry identity agent set <agent> Set the identity’s default_coding_agent: claude, codex, cursor, or opencode
barry identity agent clear Remove it
--codex, --cursor, --opencode Run this session on that agent
--zai, --ollama Run this session on Claude Code against that endpoint
--model-provider <key> Choose the endpoint by key, for example ollama
-m <model>, --model <model> Use this model
barry identity model set <model> Set the identity’s default_model. --provider <key> also sets default_model_provider, which a model ID the catalog does not list needs
barry identity model clear Remove it

barry session start and barry session resume both take the agent and endpoint flags. session resume does not take -m.

For example:

Terminal
barry identity agent set cursor
barry --codex
barry --ollama -m qwen3:8b
barry --model-provider ollama
barry identity model set qwen3:8b --provider ollama

Barry resolves each choice in this order:

Choice Order
Agent An agent flag, then the identity’s default_coding_agent. An endpoint flag runs the session on Claude Code, and the identity’s agent does not apply
Endpoint --model-provider, --zai, or --ollama, then the identity’s default_model_provider, then the endpoint the catalog lists for the model. Two different endpoint flags are an error
Model -m, then the identity’s default_model when the session runs on the identity’s own agent, then the endpoint’s default model

With --prompt, a Codex session runs through Barry’s session API instead of in the terminal.

Capability Claude Code Codex Cursor OpenCode
Native tool denial Yes No. Barry warns, and the tools stay available Yes, through the session’s .cursor/cli.json. Cursor has no denial for Glob or LS No. Barry warns, and the tools stay available
Egress sandbox Yes, on the z.ai endpoint and Claude Code’s own, not Ollama No No No
System prompt Appended to Claude Code’s own None. Guidance reaches the agent only as prompt text Written to AGENTS.md in the session workspace None. Guidance reaches the agent only as prompt text
Skills Mounted as a plugin Not mounted Mounted as a plugin Not mounted
Actions as slash commands Yes No Yes No
Structured output Native schema. Prompted and validated on Ollama Native schema Prompted and validated Prompted and validated
Resume Yes Yes Yes No. OpenCode does not report its session ID to Barry
MCP transports stdio, HTTP, SSE stdio, HTTP stdio, HTTP stdio, HTTP, SSE
Model discovery No. Ollama: yes, from the daemon No Yes No

A capability that says yes still depends on how the session started. The egress sandbox applies only in sessions that Barry’s session API runs, and native tool denial in a terminal session follows only the bound named with --bound. The bounds reference gives the full enforcement tables.

Codex and OpenCode sessions have a narrower boundary than their bound suggests. Barry’s filtering removes tools it serves, but it cannot remove the agent’s own shell, so bash, file, and network rules do not bind commands the agent runs natively there.

Local models on Ollama can describe a tool call instead of making one. For a model with fewer than 30 billion parameters, or one whose size the daemon does not report, Barry prints a warning before the session starts. A passing preflight check does not guarantee later tool calls.