Skip to content

Agent CLI Reference: 5-Tool Comparison

A side-by-side reference for Claude Code, Pi Coding Agent, OpenCode, Hermes Agent, and OpenClaw.


1. Claude Code (Anthropic)

Role: Primary generalist coding agent. Best all-around tool.
License: Proprietary (free tier + Pro subscription)
Runtime: Node.js
Config: CLAUDE.md in project root

Key Capabilities

FeatureHow ToCourse Reference
Multi-agent teamsclaude --teammate-mode tmuxM4 — teammate-mode spawns agents in split panes
Headless executionclaude -p "prompt" --printM5 CI/CD pipeline
Constrained tools--allowedTools "Read Write Edit"M3 security (L4 whitelist pattern)
Hooks system.claude/hooks/*.pyM3 hook architecture (13 lifecycle events)
Subdirectory rulesfrontend/CLAUDE.md, backend/CLAUDE.mdM2 skills deep dive
Stop hook self-improvePostToolUse → headless claude sessionM3, also ClaudeFAST pattern

Boilerplate Setup

bash
# Project initialization
claude --init

# Launch with teammate mode
claude --teammate-mode tmux

# Headless CI mode
claude -p "Implement the feature described in spec.md" --allowedTools "Read Write Edit Bash" --print

# With custom hooks directory
claude --hooks .claude/hooks/

Hook Lifecycle (13 events)

PhaseEvents
SessionSetup, SessionStart, SessionEnd
Main LoopUserPromptSubmit, PreToolUse, PermissionRequest, PostToolUse, PostToolUseFailure, Stop, Notification
SubagentsSubagentStart, SubagentStop
MaintenancePreCompact

2. Pi Coding Agent (pi.dev)

Role: Customizable agent harness. Full control over every aspect.
License: Open source (MIT)
Runtime: Node.js (TypeScript SDK)
Config: .pi/settings.json, .pi/agents/*.md

Key Capabilities

FeatureHow ToCourse Reference
Extensionspi -e extensions/<name>.tsM3 — damage-control, tilldone
RPC modepi --mode rpcM5 — programmatic control (26+ commands)
Agent teamsagent-team extension + teams.yamlM4 dispatcher pattern
Agent chainsagent-chain extension + agent-chain.yamlM4 pipeline pattern ($INPUT/$ORIGINAL)
P2P communicationcoms (Unix sockets) / coms-net (HTTP/SSE)M4 flat P2P pattern
Mental models.pi/multi-team/expertise/*.yamlM4 agent memory, self-improve commands
Damage controldamage-control.ts + damage-control-rules.yamlM3 three access levels
Skills system.pi/skills/*/SKILL.mdM2 composable skills

Boilerplate Setup

bash
# Launch with extensions
pi -e extensions/damage-control.ts -e extensions/tilldone.ts -e extensions/minimal.ts

# Launch with multiple extensions (stackable)
pi -e extensions/purpose-gate.ts -e extensions/tool-counter.ts

# RPC mode (programmatic control from any language)
pi --mode rpc

# Pi-to-Pi peer communication (same machine)
just local-coms --name planner --purpose "Plans the work"
just local-coms --name coder --purpose "Writes the code"

# Pi-to-Pi networked (across machines)
just coms-net-server    # hub
just coms --name dev    # client 1
just coms2 --name prod  # client 2

Extension Catalog (16 total)

CategoryExtensions
UIpure-focus, minimal, theme-cycler, session-replay
Monitoringtool-counter, tool-counter-widget
Tasktilldone, purpose-gate
Multi-Agentsubagent-widget, agent-team, agent-chain
Safetydamage-control, damage-control-continue
P2Pcoms, coms-net
Cross-Toolcross-agent, system-select
Metapi-pi

Pi Agent Rust Port (Jeff Emanuel, 1,024★)

A Rust reimplementation of the Pi agent with zero unsafe code.

FeaturePi (TypeScript)Pi Agent Rust
ExtensionsFull (16+)Compatible
RPC modeYesYes
PerformanceBaseline~2x faster
Binary size~35MB~8MB
Memory safetyNode.js GCZero unsafe Rust

The 4 Dimensions of Control (Pi's strength)

DimensionPi's Advantage
ContextFull control over what the agent sees via extensions
ModelAny provider, any model — pluggable
PromptSkills, system prompts, agent .md files — fully customizable
ToolsExtensions can add, remove, or override any tool

3. OpenCode (opencode.ai)

Role: Open-source Claude Code alternative. MIT license.
License: MIT (open source)
Runtime: Node.js (npm global package)
Config: Shares ~/.grok/config.toml with Claude Code

Key Capabilities

FeatureHow ToCourse Reference
Headless commandsopencode run "prompt"M5 CI/CD alternative to Claude Code CLI
Model selectionopencode --model opencode-go/deepseek-v4-flashM6 cascade routing
Proxy supportRoutes through localhost:18901/v1M6 cost optimization
Shared configUses same ~/.grok/config.tomlM5 production stack — dual tool setup
Go models12 Go-optimized models availableM6 economics (Go models are cheaper per token)

Available Go Models (through proxy)

Model IDCost TierBest For
opencode-go/deepseek-v4-flashBudgetGeneral agentic tasks ($10/mo flat)
opencode-go/deepseek-v4-proMidComplex reasoning
opencode-go/kimi-k2.6MidLong context
opencode-go/qwen3.6-plusBudgetStructured tasks
opencode-go/minimax-m2.7BudgetFast responses

Boilerplate Setup

bash
# Headless task execution
opencode run "Refactor the auth module to use JWT tokens"

# With specific model
opencode --model opencode-go/deepseek-v4-flash run "Write unit tests for the API"

# With custom config
opencode --config ~/.grok/config.toml run "Deploy to staging"

# List available models
opencode models

When to Use OpenCode Instead of Claude Code

ScenarioChoose
Need open-source licenseOpenCode
Budget-constrainedOpenCode (Go models at $10/mo flat)
CI/CD pipelinesOpenCode run command
Primary developmentClaude Code (better tool calling)
Need hooks systemClaude Code (13 events vs OpenCode's limited hooks)
Heterogeneous stackBoth (OpenCode as backup/alternative model)

4. Hermes Agent (Some Engineering Inc.)

Role: TypeScript-native, MCP-first agent for structured workflows.
License: Open source
Runtime: Node.js (TypeScript)
Design philosophy: MCP-native architecture, structured output first

Key Capabilities

FeatureHow ToCourse Reference
MCP-native toolsBuilt-in MCP clientM2 Beyond MCP channels
Structured outputTypeScript types enforcedM2 context management
Tool-use workflowsDesigned for function-calling chainsM2 agent loop variants
OpenClaw ecosystemIntegrates with OpenClaw agentsM4 multi-agent orchestration

Boilerplate Setup

bash
# Run with MCP server
hermes --mcp-servers ./mcp-config.json

# Execute workflow
hermes run workflow.ts

# With custom tools
hermes --tools-dir ./tools/

When to Use Hermes

  • Building TypeScript-native agent pipelines
  • MCP-first architecture (tools as MCP servers)
  • Tight integration with OpenClaw ecosystem
  • Structured output enforcement (TypeScript types)

5. OpenClaw

Role: Always-on agent employee. Heartbeat-driven, autonomous execution.
License: Open source
Runtime: Node.js daemon
Design philosophy: "If it can receive a heartbeat, it's hired."

Key Capabilities

FeatureHow ToCourse Reference
Heartbeat modelWakes on schedule, works, sleepsM7 always-on agents
One-shot executionclaw do "task"M5 production task dispatch
Device-key pairingAuth via device key + inviteM5 deployment modes
Paperclip-nativePrimary agent for Paperclip orchestrationM7 framework comparison
tmux integrationCan run inside tmux sessionsM5 production stack

Boilerplate Setup

bash
# Start as daemon (always-on employee)
claw start --daemon

# One-shot task
claw do "Review the latest PR and leave comments"

# Schedule recurring task
claw schedule --cron "0 6 * * 1" --task "Generate weekly report"

# Check status
claw status

# Stop daemon
claw stop

Heartbeat Execution Model

Timer fires → Check for queued work → Wake agent → Execute → Report results → Sleep

No continuous running. The agent wakes, works, and goes back to sleep. This is the most cost-effective model for scheduled/recurring work.


Comparison Matrix

FeatureClaude CodePi AgentOpenCodeHermesOpenClaw
LicenseProprietaryMITMITOpenOpen
CostPro subFreeFreeFreeFree
Hooks13 eventsExtension eventsLimitedMCP eventsNone
Multi-agentteammate-modeExtensionsNoChainsHeartbeats
P2P comsNocoms/coms-netNoNoNo
Headless mode--printRPC moderunYesdaemon
MCP supportBuilt-inVia extensionsVia proxyNativeVia Paperclip
Best forGeneralist codingCustom harnessOSS alternativeTS pipelinesAlways-on tasks
Course moduleM3, M4, M5M3, M4, M5M5, M6M5M5, M7

Quick Selection Guide

What are you building?
├── A feature? → Claude Code
├── A custom workflow? → Pi Agent
├── An open-source project? → OpenCode
├── A TypeScript pipeline? → Hermes
└── A recurring task? → OpenClaw

Need multiple?
├── Production system → All 5 (see REFERENCE-STACK.md)
├── Budget constrained → OpenCode + Go models
├── Maximum control → Pi Agent + extensions
└── Enterprise rollout → Claude Code + Agent Manager

FDSA Agency — Agentic Engineering Course. Part of the fdsa.ai orchestration platform.