Verdict

Roughly 5.5 factors each, but the split is not random. Pi wins every factor about owning what the model sees and what state survives. Claude Code wins every factor about operating an agent in the world. Scored by Dex Horthy’s own emphasis rather than by factor count, Claude Code edges it, because 12-Factor is a document about shipping to paying customers and that is the half Claude Code owns.

The spec is being stretched

The twelve factors were written for product agents (LLM software you ship to customers), not interactive coding harnesses. Factors 1, 7, and 11 are being asked a question they were not designed for. Read the per-factor reasoning, not the tally.

The scorecard

#FactorWinnerWhy
1Natural language to tool callstieTable stakes for both; not discriminating
2Own your promptsPiSub-1000-token system prompt, printable, with AGENTS.md appended. Claude Code’s changes silently between releases; cchistory exists precisely to track that
3Own your context windowPiClaude Code injects <system_reminder> blocks, VS Code open files with no UI toggle, and LLM-summarised WebFetch/WebSearch results you never see raw
4Tools are just structured outputsPiFour tools plus bash as the universal escape hatch. MCP moves Claude Code the other way: more schema, more per-turn rent
5Unify execution and business statePiThe file-as-state rule. Pi refuses built-in todos and plan mode because they split execution state into model-tracked internals
6Launch/pause/resumeClaude CodeThe reversal; see below
7Contact humans with tool callsClaude CodePermission prompts, AskUserQuestion, PreToolUse hooks. Pi is YOLO by design
8Own your control flowtiePi owns the inner loop. Claude Code lets you script the outer loop (Workflows, phases, budgets). Pi has no orchestration engine at all
9Compact errors into contextClaude Code, weaklyNeither ships an error counter with escalation; hooks get closer than nothing
10Small, focused agentsClaude CodeSubagents, scoped tools, worktree isolation, per-agent model. Pi meets the intent via /tree but refuses the mechanism
11Trigger from anywhereClaude CodeRoutines, cron, GitHub triggers, Slack, mobile. Pi is CLI-local
12Stateless reducerPiSession trees, fork/rewind/replay, cross-provider handoff via pi-ai

Pi ~5.5 · Claude Code ~5.5.

The three things that matter more than the tally

1. Factor 6 is the sharp reversal

Horthy’s single load-bearing complaint about every framework is that you must be able to pause between tool selection and tool invocation (Agent State and Resumability). Claude Code’s permission prompt fires exactly there, and PreToolUse hooks can block or rewrite the call before it runs. Pi refuses permission prompts as “security theatre” on the argument that an agent with bash already has arbitrary execution.

Pi’s argument is coherent on security grounds and misses the point on control-flow grounds. The pause isn’t only a safety gate. It is the seam where approval, review, and durable escalation attach. On the one criterion the author names as his number-one feature request, the minimal harness loses to the maximal one, deliberately.

Pi does win the other half of factor 6: --resume, --continue, --fork, session trees, headless and RPC modes. It resumes better and pauses worse.

2. Claude Code’s factor 7 sits on a broken factor 5

Claude Code has the product surface of factors 6, 7, and 11 without the state discipline of factor 5 underneath. Its execution state is scattered across TodoWrite (model-tracked), plan mode (an opaque sub-loop), and subagent contexts that never enter the main session. The transcript you can read is also not the thread the model saw, because of the hidden reminders and the summarised web results.

The consequence is concrete: approvals block on a person being at the keyboard. That is the inner-loop failure mode described in Human-in-the-Loop as a Tool Call, not the durable, webhook-resumable approval factor 7 actually describes. Neither harness implements the real thing. Claude Code is closer in surface, Pi is closer in substrate.

3. Pi wins the factors Horthy himself downplays

He calls factor 2 “far from novel advice” and factor 12 “mostly just for fun.” Those are two of Pi’s five wins. Meanwhile factors 6, 7, and 11 are the ones HumanLayer exists to sell, and Claude Code owns all three.

Score by factor count and it’s a draw. Score by the author’s own weighting and Claude Code wins, because 12-Factor is a document about production deployment and Pi is not trying to be a production deployment target.

What this restates

The vault frame already had this: Pi is a harness, Claude Code is a platform. 12-Factor is a platform document, so the scoring tilts the way it does.

What this does not overturn

Open questions

  • Could Pi close factor 6 without adopting permission prompts? A PreToolUse-equivalent extension hook that persists the thread and exits would satisfy Horthy’s criterion while keeping the no-theatre stance. Nothing in Pi’s architecture forbids it.
  • Factor 3’s stronger reading (build a custom context format instead of the messages array) is failed by both. Does provider prompt caching make that permanently uneconomic, or is it still on the table for a harness that controls its own serialisation?
  • Claude Code’s Workflow scripts are a genuine factor 8 win at the orchestration layer. Is there a Pi equivalent worth building, or does /control plus shell scripting already cover the realistic cases?

Freshness

Claude Code Internals is dated April 2026 (review_by: 2026-12) and is the source for most of the factor 3 evidence. The injection behaviours and WebFetch summarisation are the claims most likely to have moved. The Pi evidence is from May-July 2026. Re-verify before treating the factor 3 verdict as current.