AO

Claude Code

Anthropic's CLI coding agent. The default agent in AO.

Slot: agent · Name: claude-code · Binary: claude

Claude Code is Anthropic's CLI coding agent. It's AO's default because it has first-class session resume, rich JSONL event logs, and a native hook system AO can register against.

macOSSupported
LinuxSupported
WindowsSupported

Install

npm install -g @anthropic-ai/claude-code

Then sign in once:

claude

Use

agent-orchestrator.yaml
agent: claude-code

That's it — there are no plugin-level config keys.

How it works

  • Launch: claude runs inside the worktree. AO sets CLAUDECODE="", AO_SESSION_ID, and AO_ISSUE_ID in the environment.
  • Activity tracking: AO registers a PostToolUse hook in .claude/settings.json on workspace setup. The hook writes an AO activity entry each time Claude calls a tool, so the dashboard's active/ready/idle states stay accurate.
  • Session resume: claude --resume <sessionId> rehydrates the previous chat. AO maps its session ID to Claude's via the JSONL at ~/.claude/projects/<project>/...jsonl.
  • Cost reporting: AO reads Claude's per-message cost field from the JSONL — visible on the dashboard card.

Environment variables

VariableSet by AOPurpose
AO_SESSION_IDUnique AO session identifier
AO_ISSUE_ID✓ (when spawned from an issue)Issue identifier
CLAUDECODESignals to Claude that it's running under a harness

Your Anthropic API key comes from wherever claude normally reads it — ~/.claude/, env, etc. AO doesn't touch it.

Troubleshooting

`claude` not found

npm install -g @anthropic-ai/claude-code, then reopen your terminal so the PATH picks it up.

Dashboard shows no activity state

AO registers the PostToolUse hook in .claude/settings.json on spawn. If the hook got removed, run ao spawn again — AO re-installs it idempotently.

Session won't resume

Claude's session JSONL lives at ~/.claude/projects/<project-slug>/<sessionId>.jsonl. If that file is gone (cleaned up, moved), resume won't work — spawn fresh.