ant — Anthropic's Claude API command-line tool
Filed 2026-06-03 after founder asked what ant is and how it relates to Claude Code. All facts below verified directly against the doc (not from memory).
Why this is in the vault
ant is Anthropic's official command-line client for the Claude API, and it matters to RDCO on two specific fronts. First, it is a clean, dependency-light candidate path for giving the air-gapped phData work-agent Claude API access for scripting (a third lens alongside the Gmail-MCP vs local-script email-path debate) without standing up a daemon. Second, it makes Managed Agents and Skills version-controllable as YAML kept in sync with the API, which dovetails with the dynamic-workflows / reproducible-artifact direction the COO-agent tooling layer is heading toward. Captured as a primary-source reference (verified directly against the doc, not memory) so the load-bearing distinction is on file: Claude Code is the agentic harness that DOES the work; ant is the one-shot API client you SCRIPT against.
What it is (one line)
ant is a thin, schema-aware command-line wrapper around the Claude API — like curl but every API resource is a subcommand, requests build from typed flags or piped YAML, and you extract fields with a built-in --transform (GJSON path; no jq needed). List endpoints auto-paginate.
- Install:
brew install anthropics/tap/ant(macOS); curl release binary (Linux/WSL);go install github.com/anthropics/anthropic-cli/cmd/ant@latest. Repo:github.com/anthropics/anthropic-cli. - Auth:
ant auth login(browser OAuth, workspace-scoped, profile support) ORANTHROPIC_API_KEYenv var.ant auth statusshows the active credential/workspace. - First call:
ant messages create --model claude-opus-4-8 --max-tokens 1024 --message '{role: user, content: "Hello, Claude"}' - Command shape:
ant <resource>[:<subresource>] <action> [flags]. Beta resources (agents, sessions, deployments, environments, skills) live under thebeta:prefix and auto-send the rightanthropic-betaheader.
vs Claude Code (complementary, not competing — different layers)
- Claude Code = the agentic harness: reasoning loop + tools + skills + MCP + hooks. Give it a goal, it works.
ant= a one-shot API client: no loop, no tools, no reasoning. You construct the call, it returns the response. Built for scripting, automation, CI, and version-controlling API resources (skills/agents/environments/deployments) as YAML files kept in sync with the API.- Rule of thumb: Claude Code to DO the work;
antto SCRIPT against the API.
Use within Claude Code (first-class)
The doc has a dedicated "Use the CLI from Claude Code" section. Verbatim: "Claude Code shells out to ant, parses the structured output, and reasons over the results (no custom integration code required)." Claude Code knows ant natively — e.g. "list my recent agent sessions and summarize which ones errored" runs ant under the hood. Also the intro line: "Claude Code understands how to use ant natively."
Mapping against Ray Data Co
- phData work-agent candidate path.
antis a clean, dependency-light way to give the air-gapped work agent Claude API access for scripting — a third lens alongside the Gmail-MCP vs local-script email-path debate (see the work-agent plan). It's session-friendly and doesn't require a daemon. - Pipelines / CI. The honest fit for a data engineer: fold Claude API calls into data pipelines and CI without writing SDK glue, and keep Managed Agents + skills version-controlled as YAML in a repo.
- Managed-agent version control dovetails with the dynamic-workflows direction (workflows + agents as checked-in, reproducible artifacts).
Related
- [[2026-06-02-thariq-dynamic-workflows-harness-for-every-task]] (Claude Code agentic harness — the layer
antis NOT) - [[2026-06-02-mvanhorn-every-agentic-engineering-hack-june-2026]] (hack #7 AgentMail — adjacent "give the agent an API surface" pattern)
- phData work-agent setup plan:
~/rdco-vault/08-tooling/2026-05-30-phdata-work-agent-setup-plan.md - [[project_l5_north_star_strategic_direction]] (unhobbling the COO agent — tooling layer)