Claude Codes Plan Mode: Verschränkte Lese-Schreib-Schleifen sparen fast 95 Prozent Input-Tokens
💡 AI Labo Benchmark Series — Experiment E26 (Orchestration & Phase Gates) This post is part of our empirical benchmark series testing AI coding agent harness patterns inside network-isolated Proxmox VMs against a hidden 20-case grading suite. 🚀 View All 41 Benchmark Results & Master Ranking 🛡️ R

Posted on Nov 23 • Originally published at tappers.hashnode.dev
💡 AI Labo Benchmark Series — Experiment E26 (Orchestration & Phase Gates)
This post is part of our empirical benchmark series testing AI coding agent harness patterns inside network-isolated Proxmox VMs against a hidden 20-case grading suite.
When an AI coding agent has unrestricted access to both Read ( read_file, grep ) and Write ( edit_file, write_file ) tools from Turn 1, its natural reflex on multi-file tasks is Premature Interleaved Patching: it reads the first upstream file ( validator.py ), immediately writes a local patch before inspecting downstream consumers ( settlement.py and statement.py ), and triggers a cascade of cross-module schema mismatches.
This is the exact failure mode that inspired Plan Mode ( Shift+Tab ) in Claude Code and two-phase exploration gates in production coding agents: physically disable all Write tools during Phase 1 until the agent has inspected every affected module and locked a cross-module impact plan, then unlock Write tools in Phase 2 for a single, coordinated execution pass.
We tested this head-to-head inside isolated VM VM230 on the 3-module enterprise payment settlement pipeline ( validator.py ➔ settlement.py ➔ statement.py ):
Mode A stalled at 17 / 20 (85.0%) after 3 turns ( 43,300 cumulative input tokens), missing extra key filtering ( item = dict(raw_item) ) and $0 authorizations ( cents <= 0 ). Mode B achieved a 20 / 20 (100%) pass in 1 turn, cutting LLM calls by -66.7% ( 3 ➔ 1 ), cumulative input tokens by -94.8% ( 43,300 ➔ 2,262 tokens—a 19.14x reduction), API cost by -82.2% ( $0.0430 ➔ $0.0076 ), and running 2.22x faster ( 29.27s ➔ 13.16s, -55.1% ).
+-------------------------------------------------------------------------+ | Proxmox Isolated VM230 (0 NICs, InaccessiblePaths, grader labjudge26) | | Target Task: 3-Module Enterprise Payment Settlement Pipeline | | validator.py ➔ settlement.py ➔ statement.py | | | | +-------------------------------------------------------------------+ | | | Mode A: InterleavedReadWriteRunner (Write Unlocked From Turn 1) | | | | - Turn 1 (1,655 in): Calls `interleaved_premature_write` before | | | | inspecting downstream consumers (38,748c) | | | | - Turn 2 (14,063 in): Calls `stage_rework_patch` ➔ partial 2-file| | | | edit leaves statement desynced (38,402c) | | | | - Turn 3 (27,582 in): Final submit misses `item = dict(raw_item)`| | | | extra-key drop & `cents <= 0` $0 auth | | | | --> 3 calls | 43,300 in | $0.0430 | 29.27s | 17/20 (3 FAILED) | | | +-------------------------------------------------------------------+ | | | | +-------------------------------------------------------------------+ | | | Mode B: TwoPhaseReadOnlyPlanLockRunner (Phase 1 Lock ➔ Phase 2) | | | | - Phase 1 [Read-Only Enforcement]: Write tools physically locked | | | | until all 3 modules & cross-module contracts are mapped into | | | | `TWO_PHASE_READONLY_PLAN_LOCK_MD` (+607 tokens) | | | | - Phase 2 [Write Unlocked, Turn 1 (2,262 in)]: | | | | Executes `unlock_plan_and_submit_bundle` across all 3 files | | | | --> 1 call | 2,262 in | $0.0076 | 13.16s | 20/20 (100% PASS) | | | +-------------------------------------------------------------------+ | +-------------------------------------------------------------------------+ Enter fullscreen mode Exit fullscreen mode 3. Drop-In Implementation Recipe: TwoPhasePlanLockMiddleware Asking an LLM in the system prompt "Please read all files before editing" is a soft instruction that models routinely ignore when they think a fix looks obvious. Instead, enforce the two-phase boundary deterministically in your tool dispatcher: