How we make AI coding more cost efficient without sacrificing task quality
GitHub Copilot cut agent costs by optimizing for whole-task outcomes rather than per-tool-call token counts, after finding that aggressive shell-output compression (RTK) made agents reread or rerun commands and raised end-to-end cost. Four changes were validated with offline benchmarks and online A/B tests. They were selective output compression that preserves source-like output such as git diff and keeps a recovery path (5.5%), removing line-number prefixes from the view tool (3.1%), a meta-prompted task-tool prompt saving about 1,300 tokens per turn (2.9%), and batching background-task completion results to avoid retrieval turns (2.3%). The prompt rewrite initially serialized parallel agents, which shows that prompt behaviour needs regression tests and that savings must be measured in each workflow where a change ships.
Related posts
- Everything We Talked About at O11yDay London 2026
Honeycomb mediumAdeptAcross ten sessions at O11yDay London, the recurring bottleneck was not writing code but reviewing it, operating agents in production, and proving the spend is worth it. Speakers described instrumenting AI agents like any other production system: OpenTelemetry pipelines repaired to expose hidden Claude Agent SDK subagents, per-conversation Agent Timelines showing tokens and cost (about $1.70 and seven minutes for one review), and anomaly detection that tied a failure spike to a switch from per-PR to per-commit review. Concrete findings include roughly 80% of merged PRs at Honeycomb having no human-driven changes (prompting a rule that two developers must participate, one of whom may be a machine), Fin's measured wins from enforcing Claude Code configuration (brief mode cut output tokens ~20%, a hard nudge to cheaper models saved 7.4%), and HelloFresh seeing restores 20% faster but over 10% of investigations stalling. Corey Quinn closed by treating AI cost as an observability problem: put cost, price at time of request, and whether the result was accepted on every span, share one request ID across retries, use the OpenTelemetry GenAI semantic conventions, and enforce spend limits outside the agent loop.
- Does it matter how you feed an agent its context?
OLX Tech mediumAdeptHow context is packaged for a coding agent (one big prompt, handoff notes pointing to files, staged ICM pipeline) barely changed cost, speed or quality on a realistic 18–20 file change across three mature codebases. A bounded team of specialist sub-agents behind a thin dispatcher was about 30% cheaper and fastest (~19 minutes per run). Its output was merge-ready only one time in three because no agent owned the lint gate. Making every specialist responsible for formatting and lint fixed that, and the main cost driver turned out to be how many sub-agents get spawned, with one Default run spawning eleven and costing $13.22.
- Better tools made Copilot code review worse. Here’s how we actually improved it.
GitHub Engineering mediumAdeptSwapping Copilot code review's bespoke exploration tools for the shared Copilot CLI tools (grep, glob, view) initially raised review cost and reduced useful comments, because the tool instructions encouraged broad, repo-browsing behavior instead of diff-anchored investigation. Benchmark traces exposed the browsing loop, and rewriting tool guidance around a reviewer's workflow (form questions from the diff, narrow with grep/glob, batch discovery, view only known ranges, recover from failed searches with simpler queries or glob) cut average review cost about 20% in production without a quality regression. The same focused instructions did not help the interactive CLI, so tool prompting must match the product's job.
- Designing the hf CLI as an agent-optimized way to work with the Hub
Hugging Face mediumAdeptHugging Face rebuilt its hf CLI to serve both humans and coding agents. It detects agents via environment variables like CLAUDECODE and CODEX_SANDBOX and switches to untruncated, ANSI-free TSV output, sends hints and errors to stderr, fails fast instead of prompting, and supports idempotent retries, --dry-run and consistent resource+verb commands. In a benchmark of ~1,000 graded runs across 18 Hub tasks on Claude Code (Sonnet 4.6) and Codex (GPT-5.5), agents hand-rolling curl or the Python SDK used 1.3-1.8× more tokens overall, and up to 6× on multi-step tasks. On Sonnet they also succeeded less often (84% vs 94%) and falsely reported success more often. A generated skill file covering the full command surface adds a further small reduction in tool calls.
- Is it agentic enough? Benchmarking open models on your own tooling
Hugging Face mediumAdeptA benchmarking harness measures not just whether a coding agent solves a task with a library, but how much work it took: turns, tokens, time, errors, and behavior "markers" such as whether it used a CLI or the pipeline API. Using transformers as the case study, open models driven by the pi coding agent run across models × revisions × tasks × three tiers (bare install, cloned source, packaged Skill), with each run on Hugging Face Jobs. Adding a CLI and Skill cut time for large models like Kimi-K2.6, GLM-5.1 and MiniMax-M2.7. In the clone tier it raised median input tokens from about 4k to 6.4k, because agents read the new CLI code. Small models such as Qwen3-4B sometimes did worse, since they lean on memorized API patterns, so library changes aimed at agents should be measured against the models expected to use them.