DigestOps

How do you keep AI coding costs down?

32 posts, 1 new this week

Playbook

Practitioners reduce AI coding costs by restricting context size, splitting work across cheaper models, and enforcing hard execution limits.

  1. Block large files in pre-commit hooks

    Matt Pocock recommends creating a pre-commit hook that runs only on staged files and blocks any file over 5,000 tokens. The token count is estimated by dividing bytes by 4. The hook skips lockfiles and generated code, and its error message explains how to split the file. 1

  2. Trim rule files and set compaction windows

    Rodrigo Nask cut global CLAUDE.md and skill descriptions from 97,935 to 16,830 characters, moving details into reference files. He set the auto-compaction window to 500k. Over 262,289 calls, median cost per task fell from $2.57 to $1.06, though daily usage rose 46%. 2

  3. Raise clear-and-handoff threshold based on quota weights

    Alex Slobodianiuk measured Opus 5 quota weights, finding output weighs about 850 times as much as a cache read with a 15% error margin. Recalculating from 31 days of logs, he raised the clear-and-handoff threshold from 200k to 300k tokens and let auto-compaction take over. 3

  4. Split models by task phase

    Alex Finn proposes using Fable 5.2 for planning and brainstorming, then switching to Opus 5.5 to execute tasks one by one. Sonnet or Haiku sub-agents are used to run tests. This detailed upfront planning aims to cut token use during execution. 4

  5. Enforce hard limits on execution windows and reads

    Dean Bogdanovic reports that instead of relying on prompts, the team switched to execution windows, intervals between cycles, and read limits. This approach addressed an agent that burned roughly 500 million cached input tokens, costing about $1000, out of total project spending of about $3900. 6

  6. Mine session logs to target high-cost areas

    Craig Merry analyzed 2,914 local session files after hitting weekly limits. Of 9.5 billion tokens, 96% were cache reads and 98% of cost landed on Opus 5.5. Adjustments include stopping rounds based on review evidence, trying Sonnet for mechanical steps, shrinking file loads, and compressing early at about 450,000 tokens. 8

Choosing between approaches

Reducing context size and using cheaper models can increase daily usage or require more frequent handoffs. For instance, cutting rule files led to a 46% rise in daily usage 2, and raising the clear-and-handoff threshold relies on specific quota weight measurements that may have errors 3. Additionally, newer models like Fable 5.2 may offset price cuts with higher token consumption 10.

Not covered yet

The material lacks data on the long-term impact of multi-model workflows on code quality and maintenance, as well as standardized benchmarks for comparing cost-effectiveness across different project scales.

Drawn from the top 10 posts for this question; the numbers match the list below · updated 2026-11-20
Type

Posts

22 more posts to see