Coding-agent costs compound across two axes simultaneously:
$15/1M vs $0.10/1M).Combine three orthogonal layers:
tokendiet_dedup_blocks): Native C++20 block-hash matcher replacing repeated read_file blocks from prior turns with compact 12-token deterministic back-references ([@tokendiet:ref turn=#T sha256=... tokens_saved=...]).ast_skeleton.py): Replaces bodies of unfocused Python functions spanning >= min_elide_lines with pass # [tokendiet: elided N lines sha256=...], always verified via ast.parse round-trip.finops_router.py): Routes mechanical tasks to LOCAL_FLASH ($0.10/1M), multi-file edits (>= 3 files) to BALANCED_CODING ($3.00/1M), and immediately escalates to FRONTIER_REASONING ($15.00/1M) whenever retry_count >= 1 or requires_formal_or_security_proof=True.