Clean code still matters. Messy code is expensive.
Many teams assume smarter models make code structure obsolete. Across 27,025 coding-agent sessions (20,110 pre-session AST-joined edit episodes and 18,824 edited-function episodes across oh-my-pi, Claude Code, and Codex), structural debt taxes every model—and breaks cheaper models first: frontier reasoning models (Tier1) mask debt by burning extra tokens, while mid-tier and fast models (Tier2 & Tier3) hit sharp thrash, edit-failure, and test-failure gaps on the exact same files.
Token burn snaps past a complexity cliff. Edit thrash climbs with file length.
Plateaus from 11–25, then jumps to 619 tok (+82% raw vs LOW; 1.62× controlled within the same file across 2,508 files and 1,595 sessions, t = +11.78, p = 5.1e-32). Remains a significant nonlinear break (+14.0%, p = 0.0008) even controlling simultaneously for function length and smooth log-complexity.
Smooth monotonic climb across all 20,110 edit episodes (2.31×, log-LOC FE t = +20.55, p = 7.7e-94), steepest past ~200–300 LOC read windows. Past 500 LOC, edit failures rise 14.1% → 29.9%, anchor errors jump 2.6× (4.4% → 11.4%), and controlled output/total tokens rise 1.56× / 1.52×. Positive in 20/20 repos, 5/5 languages, 3/3 harnesses—and steepest in Nov–Dec 2026.
Structural debt taxes every model—and widens the Tier2/Tier3 failure gap 3×–6× on the same files.
Pure logic (+0.0 pp) and thin I/O shells (+0.6 pp) stay flat; collapsing high complexity (>25) into high I/O coupling jumps +10.7 pp raw (49.2%; borderline FE interaction p = 0.068 after repo, model, harness & LOC controls).
n = 624), Tier2/Tier3 matches Tier1 on edit thrash (25.4% vs. 23.7%, p = 0.36) and sits +4.2 pp on edit failures. On debt files (n = 482), the Tier2/Tier3 gap widens 6× on thrash (+10.5 pp, p = 1.7e-06), 3.3× on edit failures (+13.9 pp, p = 4.6e-13), and to +31.0 pp on test failures (p = 2.1e-33; within-file FE interaction +7.6 pp, p = 0.025)—while Tier1 masks debt by burning 1.76× more tokens past the complexity cliff.
Goodhart’s Law hits even strong complexity metrics.
In our 16-refactor audit, 14 of 16 complexity-cap refactors were mechanical helper slicing.
Cognitive complexity is already a stronger structural signal than standard syntax or formatting linters. Yet once an autonomous agent treats a single-function cap as its target, it splits one tangled routine into 6–27 thin private helpers—turning the check green while increasing total file complexity and jump-cost for the next session.
Enforcing whole-diff structure unlocks model optionality. Teams stay trapped on Tier1 pricing only when structural debt breaks cheaper models. Gate the cliffs cleanly and route routine execution safely down the compute curve.