Skip to content
Vinesh Goyal Vinesh Goyal

AI Engineering

I measured Ponytail, and the saving was not where I expected

A colleague told me it would cut my AI coding bill. It did. So I built the same project twice, once with it and once without, to find out what it was actually doing. I had the mechanism completely wrong.

Polytail post

Ponytail made my AI coding bill smaller. I could not say why. So I built the same project twice, with it and without it. My guess was wrong.

A colleague mentioned Ponytail in passing: it makes AI coding cheaper. I installed it and forgot about it. A few weeks later my bill was lower and the pull requests from my AI sessions were smaller.

Good news twice. But I could not explain what the tool was doing, and for something sitting in the middle of my daily work, that bothered me.

01What I thought it did

I thought it sent less of my code to the AI. It does not. The AI reads exactly as much as before. What changes is how much it writes.

Tools like Serena and Repomix trim what the model reads, and I had filed Ponytail next to them. So had every colleague I asked.

My guess: wrong
AI reads
AI writes
What it really does
AI reads
AI writes

So "token reduction tool" is not quite the right name. The tokens do go down, but only because something else happens first.

02How it works

Before writing anything, the AI walks down seven questions. The first "yes" wins, and it stops there.

Watch a request go down the list

 

  1. 01Does this need to exist at all?
  2. 02Is it already in the codebase?
  3. 03Does the standard library do it?
  4. 04Is there a native platform feature?
  5. 05Is a dependency already installed?
  6. 06Can it be one line?
  7. 07Write the minimum that works.

Example requests, for illustration. Six of the seven answers produce no new code. That is the whole trick.

Programmers have an old name for this: you aren't gonna need it. The rules are not new. What is new is that they get applied every time, by something that never gets tired or decides this one abstraction is worth building.

03The test

Two public benchmarks exist, and they disagree: one says 54% less code, the other 15%. Both can be honest. The tool can only save you something where the AI would have overbuilt, so the number depends on the tasks you pick. That is a reason to test on your own work.

So: one spec for a cricket scoring service, with eleven endpoints and some fiddly rules. Two AI sessions, same model, empty folders, one sentence of instruction each. One with Ponytail, one without. Twenty hidden tests judged both afterwards.

My prediction, written down firstClose to no difference. Two of the seven questions are about reusing existing code, and an empty folder has none.
Replay of both runs
Ponytail off
waiting
0lines
Files
0
Cost
$0.00
Time
0m 00s
Tests passed
 
Ponytail on
waiting
0lines
Files
0
Cost
$0.00
Time
0m 00s
Tests passed
 
Same score. 63% less code. Half the bill. It did not make the AI smarter. It made it stop building things nobody asked for.

The full comparison, graded by the same twenty tests:

■ Ponytail off■ Ponytail on

One paired run, same spec, same model.

Both builds lost one mark on the same unclear line in my spec. Each lost its second mark on a different bug, so the lean build was not just a cut-down copy of the other.

04Where the money really was

Here is the surprise. Writing code is almost none of the bill.

94.1%re-reading code it already saw
3.5%storing code for the next turn
2.4%writing new code

The bill for the run without Ponytail. Ponytail only touches the small rust slice.

So how did the bill halve? Every time the AI takes a turn, it re-reads all the code so far. Less code means cheaper turns, and fewer of them: 13 instead of 24. Re-reading fell by 57%, and re-reading is 94% of the bill.

24 turnsPonytail off
13 turnsPonytail on

One bar per turn. Height is how much the AI re-reads on that turn. The filled area is the bill. A sketch, not to scale.

Less code written today is less code to re-read on every turn after that.

You are not buying cheaper writing. You are buying a smaller thing to carry.

05Three things I had wrong

OneI expected an empty project to show almost nothing. It showed a bigger cut than either public benchmark. The work is done by question one, does this need to exist, not by the reuse questions.
TwoI thought the saving came from shorter answers. It came from fewer turns and less to re-read.
ThreeI expected the lean build to quietly skip things and fail more tests. It scored the same.

06Should you use it?

The money is the least interesting part. 63% less code is 63% less for a person to read, review and maintain for the life of the project.

The danger: lean code and incomplete code look the same. Sometimes "nobody asked for it" is a safety check you forgot to mention. The AI does not know your roadmap, your regulator, or last quarter's incident. So ask one thing first: who checks what the AI produced?

Leave it onEveryday features and internal tools, where a reviewer or real tests will catch a skipped step.
Keep it offPayments, logins, audit trails, or anywhere nothing would catch a missing check.

07How I nearly got the wrong number

Four mistakes almost gave me a confident, wrong answer. If you run this yourself, watch for them.

  1. The logs repeat themselves. One reply is logged on several lines, each with the full usage figures. Adding them up inflated my totals 2.29 times. Count each request once.
  2. One run logged nothing. It was treated as a child session, so no usage was recorded. I threw it away and ran it again.
  3. My grader assumed a file layout. Both builds would have scored zero. Now it starts each build and talks to it over HTTP.
  4. The grader failed silently. It reported zero passes and zero failures. That looks like an answer. It was a bug.

I also checked each finished session's log to confirm Ponytail was really loaded in one and really absent in the other, instead of trusting the settings.

One pair of runs, one task, one language, one model. AI output varies between attempts, so treat 63% as the shape of the result, not a number to quote. What held up is narrower: the tool works on what the AI writes, and the money is in what you never have to re-read.

Comments (2)

Sign in to comment

  1. Varun Suryawanshi ·

    such a wonderful insight, even I used to think that ponytail is just reducing the prompt, but your article has explained in depth what exactly happens.