Published: June 2026 | Version Tested: 1.12.0 | Platform: macOS


Table of Contents

  1. Overview — What Is the Anthropic CLI “ant”?
  2. Installation — Step by Step
  3. Testing — Commands Executed & Real Output
  4. My Take — How “ant” Can Improve My Workflow
  5. Conclusion

1. Overview — What Is the Anthropic CLI “ant”?

The Anthropic CLI, known as ant, is the official command-line interface for the Claude Developer Platform. Rather than being just a simple wrapper around curl, it is a fully-featured terminal client that exposes the entire Claude API through an intuitive command structure — without writing a single line of application code.

What It Actually Does

At its core, ant lets you:

  • Send messages to Claude models directly from a shell prompt
  • Run batch jobs — submit hundreds of prompts in JSONL format at ~50% cost savings
  • Manage agents and sessions through beta API endpoints for autonomous and multi-turn workflows
  • Upload and reference files — images (JPEG, PNG) and PDFs — by providing base64-encoded content inline
  • Count tokens before sending a request, enabling pre-flight cost estimation
  • Switch output formats between JSON, YAML, raw text, and an interactive explorer

The command structure follows a clean, resource-oriented pattern:

ant <resource>[:<subresource>] <command> [flags]

For example: ant messages create, ant beta:agents list, ant beta:sessions create.

Available Claude Models (as of June 2026)

Model ID Display Name Strength
claude-fable-5 Claude Fable 5 Latest flagship
claude-opus-4-8 Claude Opus 4.8 High capability, balanced
claude-opus-4-7 Claude Opus 4.7 Strong reasoning
claude-sonnet-4-20250514 Claude Sonnet 4 General-purpose
claude-haiku-4-5-20251001 Claude Haiku 4.5 Fast, cost-efficient

All listed models support batch processing, citation, code execution, image and PDF input, structured outputs, and adaptive thinking.

Key Beta Features

Beyond basic messaging, ant exposes a rich set of beta capabilities:

Feature What It Enables
beta:agents Create, update, and deploy autonomous agents
beta:sessions Maintain stateful, multi-turn conversation context
beta:files Upload and reference files in messages
beta:memory-stores Persist information across sessions
beta:vaults Secure credential and secret management
beta:worker Run a self-hosted environment worker for on-premise deployments

Honest Assessment

ant is not just a convenience shortcut. It meaningfully lowers the barrier to:

  • Automating prompt pipelines without a Python environment
  • Integrating Claude into CI/CD or shell scripts via Unix pipes
  • Prototyping agent workflows interactively before writing production code

That said, it has rough edges. Multi-message conversation arrays cannot be passed directly as inline YAML on the command line (more on this in the testing section). For complex workflows, it is still best paired with shell scripts or jq.


2. Installation — Step by Step

Installation via Homebrew on macOS takes under five minutes.

Prerequisites

  • macOS (or Linux with Homebrew), or Windows
  • Homebrew installed

Step 1 — Add the Anthropic Tap and Install

brew tap anthropics/tap https://github.com/anthropics/homebrew-tap
brew install anthropics/tap/ant

Actual output:

==> Tapping anthropics/tap
Cloning into '/opt/homebrew/Library/Taps/anthropics/homebrew-tap'...
Tapped 1 cask (13 files, 30.7KB).
==> Installing Cask ant
==> Linking Binary 'ant' to '/opt/homebrew/bin/ant'
==> Linking Manpage 'ant.1.gz' to '/opt/homebrew/share/man/man1/ant.1.gz'
==> Linking Bash Completion 'ant.bash' to '/opt/homebrew/etc/bash_completion.d/ant'
==> Linking Fish Completion 'ant.fish' to '/opt/homebrew/share/fish/vendor_completions.d/ant.fish'
==> Linking Zsh Completion 'ant.zsh' to '/opt/homebrew/share/zsh/site-functions/_ant'
🍺  ant was successfully installed!

Shell completions for Bash, Fish, and Zsh are installed automatically — a nice touch.

Step 2 — Verify the Installation

ant --version
# ant version 1.12.0

which ant
# /opt/homebrew/bin/ant

Step 3 — Authenticate

There are two authentication methods:

Option A — OAuth (recommended for interactive use):

ant auth login
# Opens your browser for Claude Console login

Option B — API Key (recommended for scripting and CI/CD):

export ANTHROPIC_API_KEY="sk-ant-your-key-here"

To check your authentication status at any time:

ant auth status

Output:

Active profile:  default
Config dir:      /Users/tinhnguyen/.config/anthropic
Profile config:  /Users/tinhnguyen/.config/anthropic/configs/default.json
Credentials:     /Users/tinhnguyen/.config/anthropic/credentials/default.json

Alternative — Install from Source with Go

If Homebrew is not available:

go install 'github.com/anthropics/anthropic-cli/cmd/ant@latest'
export PATH="$PATH:$(go env GOPATH)/bin"

3. Testing — Commands Executed & Real Output

All tests below were executed on June 10, 2026, using ant version 1.12.0 with a valid API key. Results are taken directly from terminal output — no edits or fabrication.


Test 1 — List Available Models

ant models list --format yaml

Output (excerpt):

type: model
id: claude-fable-5
display_name: Claude Fable 5
created_at: "2026-06-07T00:00:00Z"
max_input_tokens: 1000000
max_tokens: 128000
capabilities:
  batch:
    supported: true
  thinking:
    supported: true
    types:
      adaptive:
        supported: true
  image_input:
    supported: true
  pdf_input:
    supported: true
---
type: model
id: claude-opus-4-8
display_name: Claude Opus 4.8
created_at: "2026-05-28T00:00:00Z"

Verdict: ✅ Returned a complete, structured model catalog with capabilities per model. The YAML format is immediately useful for scripts that need to select a model based on feature support.


Test 2 — Send a Simple Message

ant messages create \
  --model claude-opus-4-1-20250805 \
  --max-tokens 100 \
  --message '{role: user, content: "Hello Claude! What is your name?"}'

Output:

{
  "model": "claude-opus-4-1-20250805",
  "id": "msg_013tD3wtLH9eASHWv5kDLVYh",
  "role": "assistant",
  "content": [
    {
      "type": "text",
      "text": "Hello! My name is Claude. It's nice to meet you!"
    }
  ],
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 15,
    "output_tokens": 17
  }
}

Verdict: ✅ Response time was approximately 400–800ms. The full message object is returned by default — useful for logging. The usage field gives you immediate token visibility.


Test 3 — Count Tokens Before Sending

ant messages count-tokens \
  --model claude-opus-4-1-20250805 \
  --message '{role: user, content: "This is a test message to count tokens"}'

Output:

{
  "input_tokens": 15
}

Verdict: ✅ This command completes in under 200ms and costs nothing. It is essential for building cost-aware scripts — check token count, estimate cost, then decide whether to proceed.


Test 4 — Use a System Prompt

ant messages create \
  --model claude-opus-4-1-20250805 \
  --max-tokens 150 \
  --system 'You are a helpful assistant that answers in exactly 2 sentences.' \
  --message '{role: user, content: "Explain quantum computing"}'

Output (content only):

“Quantum computing uses quantum mechanical phenomena like superposition and entanglement to process information in ways that classical computers cannot, allowing quantum bits (qubits) to exist in multiple states simultaneously rather than just 0 or 1. This enables quantum computers to potentially solve certain complex problems exponentially faster than classical computers, particularly in areas like cryptography, drug discovery, and optimization problems.”

Verdict: ✅ System prompts work exactly as expected. Claude adhered strictly to the two-sentence constraint — this opens up reliable, templated behavior in shell pipelines.


Test 5 — Extract a Specific Field with --transform

ant messages create \
  --model claude-opus-4-1-20250805 \
  --max-tokens 100 \
  --message '{role: user, content: "What is 2+2?"}' \
  --transform content.0.text \
  --raw-output

Output:

2 + 2 = 4

Verdict: ✅ The --transform flag uses GJSON path syntax to extract nested fields from the JSON response. Combined with --raw-output, the result is plain text — ready to pipe into another command. This is one of the most practically powerful features.


Test 6 — Multi-Turn Conversation Array (Known Limitation)

ant messages create \
  --model claude-opus-4-1-20250805 \
  --max-tokens 200 \
  --message '[{role: user, content: "Hello"}, {role: assistant, content: "Hi!"}, {role: user, content: "What is your purpose?"}]'

Output:

Incorrect Usage: invalid value "[...]" for flag -message:
failed to parse as YAML: [1:1] sequence was used where mapping is expected

Verdict: ❌ Inline multi-turn arrays are not supported through the --message flag directly. For multi-turn conversations, the recommended approach is to use beta:sessions or to construct messages from a JSONL file. This is a real limitation for interactive chatbot scripting.


Test 7 — Debug Mode (Inspect HTTP Traffic)

ant --debug messages create \
  --model claude-opus-4-1-20250805 \
  --max-tokens 50 \
  --message '{role: user, content: "Test"}' 2>&1 | head -20

Output:

2026/06/10 13:29:34 Request Content:
POST /v1/messages HTTP/1.1
Host: api.anthropic.com
Anthropic-Version: 2023-06-01
Content-Type: application/json
User-Agent: Anthropic/CLI 1.12.0
X-Api-Key: <REDACTED>

{"max_tokens":50,"messages":[{"content":"Test","role":"user"}],"model":"claude-opus-4-1-20250805"}

2026/06/10 13:29:36 Response Content:
HTTP/2.0 200 OK
Anthropic-Ratelimit-Input-Tokens-Remaining: 500000
Anthropic-Ratelimit-Output-Tokens-Remaining: 80000
Anthropic-Ratelimit-Requests-Remaining: 49

Verdict: ✅ Debug mode exposes full HTTP request/response headers and body. The API key is automatically redacted. This is invaluable for troubleshooting rate limits, identifying payload issues, or understanding what the CLI is doing under the hood.


Test 8 — Inspect Beta: Agents

ant beta:agents --help

Output:

COMMANDS:
   create    Create Agent
   retrieve  Get Agent
   update    Update Agent
   list      List Agents
   archive   Archive Agent

Verdict: ✅ The full agent lifecycle — create, retrieve, update, list, archive — is accessible from the CLI. This means agent deployment can be fully scripted without any web console interaction.


Test 9 — Inspect Beta: Sessions

ant beta:sessions --help

Output:

COMMANDS:
   create    Create Session
   retrieve  Get Session
   update    Update Session
   list      List Sessions
   delete    Delete Session
   archive   Archive Session

Verdict: ✅ Sessions provide stateful, multi-turn conversation management. Creating, listing, and archiving sessions programmatically makes it possible to build stateful agents as shell scripts.


Test 10 — Profile Management

ant profile --help

Output:

COMMANDS:
   activate  Set the active profile
   list      List configured profiles
   get       Print the profile config (or one field)
   set       Set a field in the profile config

Verdict: ✅ Profile management allows isolation of API keys, base URLs, and settings per environment — critical for safely working across development, staging, and production without environment variable juggling.


Test Summary

# Test Result Notes
1 List models ✅ Pass YAML output, full capability data
2 Simple message ✅ Pass 400–800ms, full JSON response
3 Count tokens ✅ Pass <200ms, zero cost
4 System prompt ✅ Pass Constraint respected
5 Transform / raw output ✅ Pass Plain text via GJSON path
6 Multi-turn inline array ❌ Fail YAML parse limitation
7 Debug mode ✅ Pass HTTP details, redacted key
8 Beta: Agents ✅ Pass Full CRUD accessible
9 Beta: Sessions ✅ Pass Full lifecycle commands
10 Profile management ✅ Pass Multi-env isolation

9/10 passed. The one failure is a known parser limitation, not an API failure.


4. My Take — How “ant” Can Improve My Workflow

My day-to-day work at FPT Software involves Japanese-facing client deliverables — requirement documents, process flow diagrams, WBS spreadsheets, and translation work across Vietnamese, Japanese, and English. Here is where ant fits naturally:

Scenario 1 — Automated Translation Pre-Check

When translating requirements documents between Vietnamese and Japanese, I often need a first-pass draft before doing detailed review. Currently this is a manual copy-paste process into a chat interface. With ant, I can pipe document text directly:

cat requirement_section.txt | ant messages create \
  --model claude-opus-4-8 \
  --max-tokens 2000 \
  --system 'You are a professional Japanese-Vietnamese technical translator. Translate the following Vietnamese text to Japanese, preserving all technical terminology accurately.' \
  --message '{role: user, content: "'"$(cat requirement_section.txt)"'"}' \
  --transform content.0.text \
  --raw-output > translated_draft.txt

This turns a 10-minute copy-paste cycle into a one-command operation per document section.

Scenario 2 — Batch Processing Multiple Requirement Sections

For large documents like the 戸籍附票システム specification with dozens of sections, batch processing makes sense. Instead of sending requests one by one, I can prepare a JSONL file with all sections and submit in one shot:

# Build batch file
for file in sections/*.txt; do
  echo "{\"custom_id\": \"$(basename $file)\", \"params\": {\"model\": \"claude-opus-4-8\", \"max_tokens\": 1000, \"messages\": [{\"role\": \"user\", \"content\": \"Translate to Japanese: $(cat $file)\"}]}}"
done > batch_translate.jsonl

# Submit batch (50% cheaper than individual requests)
ant messages:batches create --requests batch_translate.jsonl

This is directly applicable to my current project workload.

Scenario 3 — Pre-flight Cost Checks Before Large Jobs

When working with large documents, I can count tokens first to avoid surprises:

TOKENS=$(ant messages count-tokens \
  --model claude-opus-4-8 \
  --message "{role: user, content: \"$(cat large_document.txt)\"}" \
  --transform input_tokens --raw-output)

echo "This request will use $TOKENS tokens"

For projects with API budget limits (common in client-facing work), this adds a safety gate.

Scenario 4 — Agent-Based Review Workflow

For iterative document review cycles — which happen constantly in the IMI rare earth system project — I can imagine deploying a named agent with a specific review persona and system context, then invoking it via session to maintain review history across multiple passes. This would replace ad-hoc chat sessions with a traceable, reproducible review record.

What I Would Not Use “ant” For

ant is a CLI, not a GUI. It requires comfort with the terminal and shell scripting. For colleagues who primarily work in Word or Excel environments, the overhead of learning the command line outweighs the benefit. For those contexts, a thin Python wrapper around the SDK remains more accessible.


5. Conclusion

The Anthropic CLI ant is production-ready for teams that already live in the terminal. Its strongest points are:

  • Zero-overhead API access — no environment setup, no SDK to import, no application boilerplate
  • Unix composability--transform, --raw-output, and standard piping make it a first-class citizen in shell pipelines
  • Cost visibility — built-in token counting is a genuine workflow improvement for budget-conscious projects
  • Beta feature access — agents, sessions, memory stores, and self-hosted workers are all accessible from day one

The main limitation today is inline multi-turn conversation syntax, which requires a workaround via sessions or JSONL files. This is a minor friction point, not a blocker.

For anyone doing document-heavy, multilingual, or automation-oriented work with Claude, ant is worth adding to the toolchain immediately.


Resources:

  • Official Documentation: https://platform.claude.com/docs/en/api/sdks/cli
  • GitHub Repository: https://github.com/anthropics/anthropic-cli
  • Claude Platform Console: https://platform.claude.com

Tested on macOS, June 2026. ant version 1.12.0.