Total unique visitors
Browse by category Chatbots Image Generation Video Generation Audio & Voice Coding Writing Productivity Research AI Agents Free Tier Table
Home page 問問貓說 AI

Ask CatAI Tool SummaryGitHub Copilot

Shortening Your Agent's Output Can Cost More: GitHub's Four Efficiency Changes, One of Which Was Just Deleting Line Numbers

Article last updated:2026-09-08

If you are trying to make an AI coding agent cheaper, GitHub’s 2026-09-02 engineering post is worth reading in full, because it opens with a counterintuitive result: shortening tool output made the whole task more expensive.

Four changes, each with measured numbers, and one of them failed. Verified 2026-09-08.

1. The counterintuitive one: the local metric trap

The usual move is compressing what each tool returns. GitHub tested that with a utility called RTK and concluded:

We saved tokens locally and spent more globally.

What happened: compression sometimes removed exactly what the model needed, so the model reopened the original output or reran the command. The extra turns and the context carried forward meant more tokens and more time for the task overall.

Portable principle: efficiency is measured per completed task — request to result — not per tool call. Any “be concise” rule you add to your own agent needs to be measured the same way.

2. What worked first: remove formatting before removing information

GitHub’s cleanest optimisation: the file-view tool no longer prefixes every line with a line number.

The reason is mundane — older editing tools used line numbers to target changes, but current tools match surrounding code and never use them. The prefix survived as pure formatting, repeated on every file read.

Measured results:

  • Offline benchmarks: model inference cost down roughly 5%, success rates within normal run-to-run variance, no increase in edit failures
  • Online with Copilot CLI users: average daily inference cost per user down about 3%, with no material regression in tracked quality or satisfaction metrics

GitHub calls it the ideal change: no new instructions for the model, nothing to recover, no extra decision — file contents reach the model unchanged.

Your version of this: audit what you push into context for things that repeat on every call and that nothing consumes — wrapper markup, unparsed headers, duplicated path prefixes. Deleting those is far safer than deleting content.

3. What worked second: compressing prompts — which nearly broke

Guidance for Copilot’s task tool (which launches parallel sub-agents) had accumulated across tool descriptions, schemas, agent definitions and system instructions. A meta-prompting loop, where Copilot iteratively rewrote its own prompt, cut it roughly in half.

Then an online experiment caught a regression the offline evaluations had missed: the rewrite turned cautious parallelism guidance into a hard scheduling policy, so independent custom agents ran sequentially instead of in parallel.

The response is the part worth copying: stop the experiment → write a regression test for the behaviour users exposed → then change the prompt again. The fix replaced an explicit allowlist and denylist with one sentence:

Independent agents can run in parallel; consider side effects.

Shorter, less restrictive, and it hands the parallelism decision back to the model.

Shipped numbers: about 1,300 fewer task-tool prompt tokens per turn, roughly 1.8% fewer total prompt tokens per session and 2.9% lower normalised cost per active hour, with no quality regression detected.

The lesson in GitHub’s words: prompt behaviour needs tests; if a behaviour is not tested, a shorter prompt can remove it without anyone noticing.

4. What worked third: deliver finished background work without a retrieval turn

Agents often run long shell commands or sub-agent investigations in the background. Previously the completion notification did not include the result, so the agent spent another turn asking for something the harness already had — and that detour repeated when several tasks finished together.

Now Copilot batches eligible completions and delivers the results in the existing tool-result format. GitHub stresses that nothing is compressed, summarised or withheld.

Effect: average token-related usage, measured in AI credits, down about 2.3%. Two background tasks used to mean four model calls (ask, then process, twice); now one call handles both.

Portable principle: find the turns where the model is waiting for data rather than thinking. If the harness can complete them deterministically, do not spend a model call.

5. And the caveat: evidence is local to the workload

GitHub records a counterexample: a tighter set of file-tool instructions helped Copilot code review, but raised cost in a Copilot CLI online experiment, so it was not shipped.

The same change, opposite results, different workflow. Do not treat anyone’s published savings — including the ones above — as numbers you will reproduce.

6. Five principles to take away (GitHub’s own list)

  1. Optimise the completed task, not the tool call.
  2. Optimise orchestration, not just model output — eliminate model turns the harness can complete deterministically.
  3. Compress by what the output represents: preserve exact content, prefer lossless transformations, measure how often the recovery path is used.
  4. Prompt rewrites have unintended consequences — validate that intended behaviour survives.
  5. Evidence is local to the workload; re-evaluate everywhere it ships.

Their closing line is worth keeping: none of these changes made the model smarter — they removed work the model never needed to do.

How Copilot credits are consumed: Copilot AI credits explained. Plans: GitHub Copilot tool page.


Source read directly on 2026-09-08: GitHub’s How we make AI coding more cost efficient without sacrificing task quality (Erik Kristensen and Napalys Klicius, 2026-09-02). The 5% / 3% / 1,300 tokens / 1.8% / 2.9% / 2.3% figures are GitHub’s own offline and online results; we have not reproduced them, and GitHub states the evidence holds only for the workflows tested.

What Amo and Pimi think

AMO Amo Finding faults
Don't wag your tail yet, Pimi — as of 2026-06-24, model selection on the Free and Student plans is locked to "Auto" only. Free users get downgraded and can't even choose — you tell me, is that fair?
PIMI Pimi Advantages
Unfair as it may be, you're missing a big point – with student verification, Pro is free, the best student deal on the entire site, bar none!
So, do you need to pay or not?

Students: Pro is free after certification, no reason not to use it. General developers: Free version with 2,000 completions to get started, upgrade to Pro for US$10/month after writing every day. However, it's a fact that free and student plans can only use Auto-select models, so if you mind, you can pay for it.

Let's take a look at these

Go to the official website

Affiliate Links Notice