| FOUNDATION |
|---|
| Primary language | TypeScript | TypeScript + Python | TypeScript + Rust | TypeScript | TypeScript | Python | TypeScript (+Swift/Kotlin) | Rust |
|---|
| Runtime | Node 22 / Bun | Node 22.8+ / Bun | Bun (enforced) | Node 22/24 | Bun (+Node path) | CPython 3.11–3.13 | Node 22.22+ (pnpm) | Tokio async |
|---|
| Build system | tsgo + npm workspaces | tsgo + npm workspaces | Bun + Cargo + Bazel | tsc + tsdown + pnpm | Bun + Turborepo | setuptools + uv | tsdown + build-all.mts | Cargo + Bazel |
|---|
| Source LOC | 125,552 TS | 151,531 TS (+2.6k py) | 782k TS + 170k Rust | 245,957 TS | 482,356 TS | 918k py + 367k TS | ~partial: 1.83M core (+0.95M ext) | 1,079,904 Rust |
|---|
| Test LOC / count | 115,736 · 476 files | 161,495 · 463 files | 612,043 · 2,265 files | 303,442 · 1,014 files | 188,075 · 848 files | 785,624 py · 3,114 files | ~partial: 4.6M · 11,971 files | 312,784 · 467 files |
|---|
| Modules | 10 packages | 4 pkgs + 1 py runtime | 17 pkgs + 8 crates | 234 packages | 33 packages | 13 pkgs / ~600 modules | 78 src · 22 pkgs · 151 ext | 134 members · 141 crates |
|---|
| License | MIT | MIT | MIT | MIT | MIT | MIT | MIT | Apache-2.0 |
|---|
| Binary | pi | prime-agent (bin: pi) | omp | dsh | opencode | hermes | openclaw | codex |
|---|
| Distribution | npm + 6 Bun binaries | curl installer + binaries | npm, brew, nix, docker, curl | npm (npx dsh web) | curl, npm, nix, docker | ~partial: shell/docker/nix only — no PyPI | npm, docker, nix, fly, brew | npm + brew binaries |
|---|
| THE TURN |
|---|
| Agent loop | agent-loop.ts · 796 L | agent-loop.ts · 963 L | agent-loop.ts · 2,935 L | ReactLoopAgent (plugin) | prompt.ts runLoop:1081 | conversation_loop.py · 6.5k L | run-loop.ts · 725 L | session/turn.rs run_turn |
|---|
| Orchestrator | AgentSession · 3,344 L | AgentSession · 10,946 L | AgentSession · 9,428 L | AgentLoop service + inbox | SessionProcessor + runner | AIAgent · ~180 methods | Gateway + run-orchestrator | Session + submission_loop |
|---|
| Turn protocol | in-process events | local daemon socket | in-process events | append-only event log | Effect stream → SQLite rows | NormalizedResponse | gateway RPC + events | +present: Op / EventMsg queue (~95) |
|---|
| Parallel tool calls | +present: Promise.all unless sequential | ~partial: inherited; one tool | +present: shared/exclusive scheduler | +present: rolling pool, cap 10 | +present: AI SDK concurrency | +present: 3 executors, 8 workers | +present: per-turn scheduler | +present: RwLock read/write gate |
|---|
| Interrupt model | one AbortController | +present: abort + kernel interrupt | +present: four distinct signals | fused AbortControllers | fiber interruption | interrupt / steer / redirect | abort across gateway | CancellationToken tree |
|---|
| Mid-run steering | +present: steering + follow-up queues | +present: steering + side questions | +present: non-consuming detection | +present: per-agent inbox | ~partial: queued input | +present: steer() / redirect() | +present: queued follow-ups | +present: input_queue drain |
|---|
| Retry | backoff + regex classifier | backoff + classifier (pi) | +present: model fallback chains | provider-owned policy | 5 attempts, honors retry-after | classifier + credential rotation | +present: failover chains | stream + request level |
|---|
| Context-overflow recovery | +present: compact then continue | +present: compact then continue | +present: compact then continue | +present: compact then retry | +present: compact then continue | +present: compress + failover | +present: queued compaction | +present: auto-compact then continue |
|---|
| TOOLS |
|---|
| Built-in tools | 7 (4 default) | 1 — ipython | 32 | 52 | 17 | 104 | ~partial: 45 core, per-context | ~partial: 32 |
|---|
| Edit format | exact string replace | exact replace (host op) | hashline (content-anchored) | string replace + str_replace_editor | 9-strategy fuzzy replace | 9-strategy fuzzy + V4A patch | string replace + repair | apply_patch (Lark grammar) |
|---|
| Read-before-write guard | −absent: none | −absent: none | +present: seen-line provenance | +present: fs-observation policy | −absent: none | +present: file_state tracking | ~partial: via tool policy | ~partial: context-match anchoring |
|---|
| Shell | one-shot spawn | ~partial: host op, not a tool | +present: persistent embedded shell (Rust) | one-shot + persistent PTY pkg | one-shot, 120s | +present: persistent per task_id | exec host or container | +present: persistent PTY sessions |
|---|
| Shell built-ins in-process | −absent: no | −absent: no | +present: ~58 Rust utilities | −absent: no | −absent: no | −absent: no | −absent: no | −absent: no |
|---|
| Code search | auto-downloaded rg + fd | ~partial: Python in the kernel | native Rust grep engine | packaged @vscode/ripgrep | auto-downloaded ripgrep | subprocess grep/glob | ~partial: ripgrep via exec | ~partial: none — model uses shell |
|---|
| LSP | −absent: none | −absent: none | +present: full client + mux daemon | +present: lsp tool, stdio provider | +present: 38 servers, auto-install | +present: client + manager | −absent: none | −absent: none |
|---|
| AST / structural edit | −absent: none | −absent: none | +present: ast_grep + ast_edit | −absent: none | ~partial: tree-sitter for shell parsing | −absent: none | −absent: none | −absent: none |
|---|
| Debugger (DAP) | −absent: none | −absent: none | +present: 14 adapters | −absent: none | −absent: none | −absent: none | −absent: none | −absent: none |
|---|
| Browser control | −absent: none | −absent: none | +present: Chromium + relay to your browser | ~partial: web_fetch / web_search | ~partial: webfetch | +present: 3 backends (CDP, camoufox, browser-use) | ~partial: sandboxed CDP sidecar | ~partial: hosted web_search |
|---|
| Desktop / computer use | −absent: none | −absent: none | +present: windows, input, a11y trees | −absent: none | −absent: none | +present: computer_use (macOS) | +present: via native app nodes | −absent: none |
|---|
| Code mode / interpreter | −absent: none | +present: the only tool | +present: 4 REPL kernels w/ tool bridge | +present: run_code reserved transport | +present: confined JS interpreter | +present: execute_code | −absent: no | +present: V8 isolate (exec/wait) |
|---|
| Plan / todo tool | ~partial: example extension | −absent: none | +present: todo + plan mode | +present: todo_write + exit_plan_mode | +present: todowrite + plan agent | +present: todo + kanban | +present: boards + tasks | +present: update_plan + Plan mode |
|---|
| Tool-output truncation | 2,000 lines / 50 KB | 2,000 lines / 50 KB | 3,000 lines / 50 KB + artifacts | 50 KB spill + pruner | 2,000 lines / 50 KB + spill | bounded response + storage | truncation + context guard | catalog-driven policy |
|---|
| CONTEXT |
|---|
| System prompt source | inline TS, tool snippets | immutable base + RLM prompt | 163 markdown files, templated | plugin-contributed sections | 9 per-model .txt files | 3 cache tiers, SOUL.md | composed + plugin sections | +present: remote catalog per model |
|---|
| Per-model prompt variants | −absent: no | −absent: no | +present: conditional templates | ~partial: persona presets | +present: 9 families | ~partial: personalities | ~partial: per-provider caching | +present: server-delivered |
|---|
| Memory files | AGENTS.md / CLAUDE.md + worktree logic | AGENTS.md + harness state | AGENTS/CLAUDE/GEMINI + RULES.md | AGENTS/CLAUDE + .local overlays | AGENTS/CLAUDE/CONTEXT.md | HERMES/AGENTS/CLAUDE/.cursorrules | AGENTS.md + skills | AGENTS.md + override |
|---|
| Agent-written memory | −absent: none | +present: /refine, with rollback | +present: 4 backends (local/SQLite/remote) | ~partial: skills only | −absent: none | +present: MEMORY.md + USER.md + 9 providers | +present: 4 memory extensions | +present: memories subsystem |
|---|
| Compaction trigger | window − 16k reserve | window − 16k reserve | threshold % or absolute | 0.8 ratio + overflow event | usable = limit − reserve | pluggable context engine | queued, engine-owned | catalog auto-compact limit |
|---|
| Compaction extras | turn-split + file carryover | branch summarization | +present: prune, shake, snapcompact PNG | shadowing, no deletion | tool-result pruning | lineage split + recall evals | prompt-cache retention | 4 impls, remote v1/v2 |
|---|
| Prompt-cache engineering | +present: cache-waste analyzer | ~partial: inherited from pi | +present: 5m/1h retention, fork inherit | +present: prefix-stability by construction | +present: declarative breakpoint policy | +present: write-once prompt, tier scopes | +present: per-provider + observability | +present: cache key + prefix-excluded budget |
|---|
| Context as diff | −absent: no | −absent: no — live variables | −absent: no | ~partial: dynamic context sections | ~partial: context epochs (v2) | −absent: no | −absent: no | +present: ~15 versioned world states |
|---|
| MODEL LAYER |
|---|
| Providers | 40 | 32 (1,227 models) | 64 (4,367 models) | 2 adapters (+pi-ai bridge) | 24 bundled + 23 loaders | 35 plugins | 77 (234 models) | 5 |
|---|
| Catalog source | generated + remote refresh | generated in-repo | in-repo models.json | adapter defaults + discovery | models.dev (embedded + live) | per-profile fetch_models() | extension manifests | remote, ETag-cached |
|---|
| Wire protocols | 10 | 9 | 14 + custom registry | 3 (via bridge) | 2 stacks, 5 protocols | 6 api modes | ~partial: via plugin providers | 1 — Responses only |
|---|
| WebSocket transport | ~partial: optional | −absent: no | −absent: no | −absent: no | −absent: no | −absent: no | +present: gateway websocket | +present: Responses-over-WS |
|---|
| OAuth flows | 7 + device code + PKCE | ~partial: inherited + MCP OAuth | 6 + CLI credential reuse | ~partial: credential refs only | Anthropic, Copilot, GitLab, Poe | 7 auth types | +present: per-provider plugins | PKCE + device code |
|---|
| Reasoning support | 6 levels, budgets | effort levels + budgets | auto-thinking + ultrathink | off/high/max + passback | interleaved, signature-safe | summaries + scrubber | per-model capabilities | effort + summaries |
|---|
| Non-native tool calling | −absent: no | −absent: no | +present: 11 textual dialects | −absent: no | −absent: no | ~partial: schema sanitizers | +present: tool-call repair | −absent: no |
|---|
| Serves model APIs itself | ~partial: pi-messages protocol | −absent: no | +present: Anthropic/OpenAI compatible | −absent: no | −absent: no | +present: OpenAI-compatible server | +present: OpenAI + Responses HTTP | ~partial: responses-api-proxy |
|---|
| SAFETY & PERMISSIONS |
|---|
| OS sandbox | −absent: none (documented refusal) | −absent: none — workers ≠ sandbox | −absent: none | +present: bwrap+Landlock/Seatbelt/ACL | −absent: none | ~partial: 8 pluggable backends, local default | ~partial: opt-in Docker, host default | +present: Seatbelt/bwrap+seccomp/Windows |
|---|
| Fails closed if unavailable | −absent: n/a | −absent: n/a | −absent: n/a | +present: yes | −absent: n/a | −absent: no | −absent: no | ~partial: guardian fails closed |
|---|
| Approval modes | −absent: none | −absent: none | 3 tiers × 3 modes (yolo default) | ask/never × 3 sandbox modes | allow/ask/deny rulesets | manual / smart / off | +present: operator approval store | UnlessTrusted/OnRequest/Granular/Never |
|---|
| Command policy | ~partial: extension hook | −absent: none | regex patterns + interceptor | ~partial: no allowlist — fs-effect based | +present: tree-sitter parsed, arity-aware | dangerous-pattern detection | +present: sandbox tool policy | +present: Starlark execpolicy rules |
|---|
| LLM-based approver | −absent: no | −absent: no | −absent: no | −absent: no | −absent: no | +present: smart approval (aux model) | −absent: no — human in the loop | +present: Guardian sub-session |
|---|
| Network policy | −absent: none | ~partial: kernel boot gate only | −absent: none | ~partial: sandbox-level | −absent: none | URL safety + egress cmd | +present: net-policy + proxy capture | +present: MITM proxy, per-host ask |
|---|
| Trust / load-time guard | +present: project trust | −absent: dropped from pi | ~partial: plugin install warnings | +present: trusted layers for env | ~partial: --pure disables plugins | +present: capability grants | +present: install security scan | +present: layered managed config |
|---|
| Path guards | −absent: none | −absent: none | generated-file guard, plan mode | fs fence shares sandbox roots | external_directory ask | path_security + self-repo guard | +present: sandbox path roots | read-only subpaths in writable roots |
|---|
| Secret redaction | −absent: none | −absent: none | +present: share/export obfuscator | ~partial: credential refs never inlined | ~partial: export --redact | +present: egress-boundary redaction | +present: secrets subsystem | ~partial: keyring storage |
|---|
| EXTENSIBILITY |
|---|
| Extension model | in-process TS extensions | in-process TS + py skills | extensions + plugins + marketplace | Cordis DI container + YAML patches | npm/local plugins + TUI plugins | directory plugins (4 sources) | plugins + marketplace | 13-trait ext API + plugins |
|---|
| Lifecycle hooks | 34 | ~partial: extension event surface | extension events + legacy hooks | waterfalls (+CC/Codex bridges) | ~partial: 20 | 37 | +present: hook bus + native relay | 11 |
|---|
| Hot reload | ~partial: themes only | −absent: no | ~partial: /reload-plugins | +present: module + config HMR | −absent: no | ~partial: /reload-mcp | +present: plugin reload | −absent: no |
|---|
| MCP client | −absent: none | +present: stdio + OAuth | +present: stdio/HTTP/SSE + OAuth | +present: stdio + streamable-http | +present: stdio/HTTP + OAuth | +present: stdio/HTTP/SSE + OAuth | +present: stdio + HTTP | +present: rmcp 3.0, 4 transports |
|---|
| MCP server | −absent: no | −absent: no | −absent: no (separate memory server) | −absent: no | −absent: no | +present: yes (10 tools) | +present: serves its own tools | +present: yes (codex mcp-server) |
|---|
| Skills | +present: SKILL.md, 3 roots | +present: python packages, 13 bundled | +present: multi-provider + agent-authored | +present: registry + watcher | +present: local + remote index | +present: 82 bundled +115 optional + Hub | +present: 52 bundled + plugin skills | +present: 5 scopes + skill-creator |
|---|
| Slash commands | 22 + templates | 42 | 70 built-in | 6 | built-in + markdown commands | 96 + one per skill | +present: plugin-contributed | 56 (no user .md dir) |
|---|
| Package/plugin registry | +present: pi install npm/git/path | +present: npm / git / path installs | +present: marketplace + auto-update | +present: dsh plugin (pnpm) | +present: opencode plug | +present: Skills Hub + entry points | +present: ClawHub + scan on install | +present: marketplace + signatures |
|---|
| Agent writes its own tools | −absent: no | +present: writes Python at will | ~partial: custom tools + learn | +present: tool_cordis (live plugins) | −absent: no | +present: skill_manage + /learn | ~partial: via plugin SDK | ~partial: skill-creator skill |
|---|
| SDK | TS in-process + RPC | TS in-process + RPC + ACP | TS + Python RPC bindings | TS + Python JSON-RPC | generated JS/TS + Effect | ACP + OpenAI API + TUI SDK | packages/sdk + plugin SDK | TypeScript + Python |
|---|
| MULTI-AGENT |
|---|
| Subagents | ~partial: example extension only | +present: rlm() inside the REPL | +present: task tool, subprocesses | +present: 6 interchangeable providers | +present: child sessions | +present: delegate_task + kanban swarm | +present: embedded + system agent | +present: two generations (v1/v2) |
|---|
| Isolation | process | process (+ own kernel) | +present: copy-on-write worktrees | scope + preset | narrowed permissions | git worktree + task_id | process (+ optional container) | real thread + rollout |
|---|
| Depth limit | ~partial: n/a | +present: configurable per chat | spawn policy by depth | bounded | 1 (configurable) | max_spawn_depth | ~partial: per-agent policy | agent_max_depth |
|---|
| Peer messaging | −absent: no | +present: agent-message skill | +present: IRC bus + hub | +present: send_message / interrupt_agent | −absent: no | ~partial: async delegation | +present: gateway routing | +present: InterAgentCommunication |
|---|
| Background jobs | −absent: no | +present: daemon-backed sessions | +present: job manager + hub | +present: ctx.jobs + workflow engine | ~partial: experimental flag | +present: process registry + async | +present: cron + tasks + fleet | +present: background terminals |
|---|
| Scheduler / cron | −absent: no | +present: heartbeat + cron | −absent: no | +present: schedule package | −absent: no | +present: full cron subsystem | +present: 33k L cron subsystem | ~partial: cloud tasks |
|---|
| Second-opinion model | −absent: no | ~partial: side questions | +present: advisor on separate context | −absent: no | −absent: no | +present: MoA + background review | ~partial: failover, not review | +present: guardian + review mode |
|---|
| STATE |
|---|
| Storage | JSONL files | JSONL + artifact dirs | JSONL (+SQLite/Redis backends) | JSONL+zstd (+SQLite backend) | SQLite (Drizzle) | SQLite (schema v26) | 2 SQLite DBs (raw SQL) | JSONL+zstd + 2 SQLite DBs |
|---|
| Model | append-only tree, parent ids | append-only, resumable | append-only, title slot | append-only event log | rows = streaming buffer | tables + lineage chain | 169 tables, migrated in place | rollout envelopes |
|---|
| Config changes persisted | +present: model/thinking/tools as entries | +present: settings + migrations | header + usage entries | +present: all policy as events | ~partial: session settings | ~partial: session columns | +present: config + plugin state | ~partial: thread settings |
|---|
| Fork / branch | +present: in-file tree + branch summary | +present: resume + fork | +present: exact-route fork keeps cache | +present: log-prefix fork | +present: fork endpoint | +present: parent_session_id lineage | ~partial: session spawn + threads | +present: fork / side threads |
|---|
| Filesystem revert | −absent: none | −absent: none | ~partial: context-level checkpoint/rewind | −absent: none | +present: shadow git snapshots | +present: checkpoint manager | ~partial: snapshots | ~partial: rollback drops turns only |
|---|
| Session search | ~partial: fuzzy picker | ~partial: agents-view browser | listing + history:// URLs | +present: FTS5 (opt-in) | ~partial: fuzzy picker | +present: FTS5 + trigram + CJK | +present: session cards + boards | +present: search_threads index |
|---|
| Share / export | HTML + secret gist | HTML export | sealed share + HTML | /export + download | share service + export --redact | HTML/MD + HF trace upload | ~partial: transcripts | /export + codex apply |
|---|
| Telemetry | ~partial: attribution headers only | ~partial: traces, opt-in | ~partial: OTEL opt-in | ~partial: OTLP, disabled by default | ~partial: OTEL spans, opt-in | ~partial: OTLP local-first, opt-in | ~partial: OTEL extension | OTEL + analytics crate |
|---|
| SURFACES |
|---|
| TUI | +present: in-house renderer (16.7k) | +present: forked pi renderer (14.6k) | +present: in-house (70k) + agent hub | −absent: none | +present: SolidJS on OpenTUI | +present: prompt_toolkit + Ink TUI | +present: pi-tui based (14.1k) | +present: ratatui (258k LOC) |
|---|
| Web UI | −absent: none | −absent: none | ~partial: collab guest + bench dashboard | +present: lead surface, Cordis in browser | +present: full SolidJS app | +present: React dashboard | +present: Control UI (276k) | −absent: none in repo |
|---|
| Desktop app | −absent: none | −absent: none | −absent: none | −absent: none | +present: Electron | +present: Electron | +present: 5 native targets | ~partial: launcher for separate app |
|---|
| IDE / ACP | −absent: none | +present: ACP mode | +present: ACP (Zed) | +present: ACP server | +present: VS Code ext + ACP | +present: ACP adapter | +present: ACP + acp-core | ~partial: /ide via app-server |
|---|
| Server API | CBOR protocol (experimental) | ~partial: local daemon protocol | auth-gateway + relays | HTTP+WS + Typert gateway | +present: ~118 REST endpoints + SSE | +present: FastAPI + OpenAI-compatible | +present: gateway + 2 HTTP APIs | +present: 226-method JSON-RPC |
|---|
| Headless / CI | +present: print + json + rpc modes | +present: print + json + rpc | +present: --print + rpc modes | +present: headless profile | +present: run + GitHub Action | +present: oneshot + batch runner | +present: CLI + docker deploy | +present: codex exec --json |
|---|
| Chat platforms | −absent: none (separate repo) | −absent: none | −absent: none | −absent: none | ~partial: Slack package | +present: 31 platforms in one gateway | +present: 26 channel ids | −absent: none |
|---|
| Voice | −absent: none | −absent: none | +present: STT/TTS + WebRTC live | −absent: none | −absent: none | +present: TTS + wake word + transcription | +present: talk + TTS + transcription | ~partial: realtime ops present |
|---|