It cut the cost of its internal AI code reviewer by 68% after tracing how repeated context, model selection, and growing conversations were consuming tokens. A high-effort review now averages $0.77, down from $2.43 during the two most expensive weeks before the work began.
Median review time also fell from 4 minutes 9 seconds to 1 minute 32 seconds. Cloudflare attributes about 40% of the savings to code and workflow changes, with the remainder coming from experiments in model routing and reasoning effort.
Before the optimization, the reviewer averaged 16.6 model calls per session. It wrote about 72,000 tokens to prompt cache and read 1.08 million cached tokens because each call resent the growing conversation. Cache writes accounted for 43% of spending, reads for 34%, and output tokens for 23%.
The company also moved the reviewer to OpenCode v2 after shadow tests matched the previous version’s approval decision in 98% of sampled merge requests. The result shows that a high cache-hit rate alone does not control costs when both context size and call count keep growing.