Ponytail cut Claude Code’s output tokens by a quarter on real backend work, with every run passing. Its tests were weaker, and it missed a security hole. What we measured and the setup we use now.

We tested Ponytail for Claude Code on real backend work before letting it near a client project. It did what it promises: about a quarter fewer output tokens and a quarter lower cost than plain Claude Code, and every run passed its tests.
It also wrote weaker tests, and on a security fix it missed a hole that plain Claude Code closed. Adding one rule, write the tests first and watch them fail, closed the test gap. It did not close the security gap.
So we now use the tests-first version for everyday build work, keep anything that decides who can see what on plain Claude Code, and keep code review plain. Below are the numbers, the prompt we use, and a recipe for running the same test on your own codebase in an afternoon.
Ponytail is an open-source rule file for coding agents, released under the MIT licence, that tells the agent to act like “a lazy senior developer”. Before writing anything, the agent works down a ladder: does this need to exist, is it already in the codebase, does the standard library do it, does an installed dependency do it, can it be one line. Only then does it write the minimum code that works.
The author’s benchmark is striking. The README reports “-53% code · -41% time · -26% cost · -45% tokens” across 39 tasks on Opus 5.5, five runs each, and says “98% of risky logic ships with a test. Without Ponytail: 68%.”
Those are the author’s numbers, on the author’s tasks. We wanted our own, on code we know well, before changing how our engineers work. We did not install the plugin. We pinned one version of its rule file and added it to Claude Code’s system prompt, which is what the plugin’s start-up hook does.
The fairest test is work you have already finished, because you know what a good answer looks like. We took three backend changes from a production multi-tenant SaaS our team builds, on Postgres with row-level security:
Every run started from a copy of the code as it was before the change, with no git history, so the agent could not find the answer we shipped. Each got the same written brief, the same project rules and the same list of allowed commands, and ran unattended on Claude Opus 5.5.
We graded every run the same way:
We compared four setups:
That came to 23 agent runs across two rounds, plus the 3 shipped fixes graded the same way as a reference. All 23 runs passed the hidden tests, the full suite and the safety checks. The differences are in what that green tick does not show.
Averaged across the three tasks, with each task weighted equally, Ponytail against plain Claude Code looked like this:
The savings held on every task, not just on average. On the cleanup-job fix, where we ran each setup three times, the ranges did not overlap: Ponytail used 12,000 to 16,000 output tokens per run, plain used 18,700 to 24,600.
In the first round, our first judge also scored Ponytail’s code the simplest and most readable of the three setups. If the story stopped at the green tick, this would be an easy yes.
The privacy feature is where it went wrong. We planted 12 bugs in the shipped version and ran each setup’s own tests against them. Ponytail’s tests let 2 through:
Plain Claude Code’s tests caught 12 of 12 in two runs and 11 of 12 in the third. On this task Ponytail wrote 29% fewer test lines than plain, and the missing lines were the ones that mattered.
In this benchmark the hidden tests caught everything anyway. In real work there are no hidden tests. The agent’s own tests and a code review are the whole safety net, so a weaker test suite ships its gaps.
Critics of Ponytail argue that its savings come from simply asking for less code. Our control setup tested that with one sentence.
It saved nothing consistently. On the cleanup job it used 5% more output tokens than plain. On the privacy feature it used 16% fewer. On the security fix it used 16% more and wrote 254 lines of production code against plain’s 158, rewriting two existing security functions from an old copy, which both judges flagged as a regression risk.
The structure in Ponytail is doing the work, not the request for brevity. A ladder of questions changes how the agent plans. A single “be brief” line does not.
If an agent already writes code for your product, the useful question is what checks its work before it reaches your users. In a free website audit we look at your site with you and point out where the risks sit.
Ponytail’s own rule asks for “one small test” for non-trivial logic. We replaced that with a tests-first section: read the code, write a plan, write a test for every requirement, run the tests and watch each one fail for the expected reason, and only then write the smallest code that makes them pass. Claude Code’s own best practices point the same way: “write a failing test that reproduces it, then fix it”, and “Give Claude something it can run that comes back pass or fail.”
On the privacy feature, Ponytail plus tests-first caught 12 of 12 planted bugs in all three runs. One run went further on the cleanup job without being asked: it added a check that the test really reproduced the bug, and reverted half its own fix to prove the test caught that too.
The savings shrank, as you would expect when the agent writes and runs tests before any code:
Task by task, tests-first used 8 to 18% fewer output tokens than plain and wrote 15 to 37% less production code. It is the leanest code of any setup, with tests close to plain’s. It is not faster.
Averages per run. Runs per setup varied by task, so the single-run rows show a direction, not a spread.
On the cleanup job, the existing test suite already catches 7 of the 8 planted bugs. The one it misses is the real bug, and every setup’s tests caught that one, so there is no meaningful test gap on that task.

The security fix’s brief listed five ways an outsider could learn something about another account from an error message. Every setup fixed all five, and every hidden test passed.
Then we probed one path the brief did not name: a signed-in member writing to a table through their own account area’s ID, while naming somebody else’s account in the same row. If the answer differs depending on whether that other account is blocked, the database is leaking account status.
Four of six candidate fixes leaked. Ponytail, control and both tests-first runs answered “read-only” for a blocked account and “not allowed” for an active one. Plain Claude Code and the fix we shipped gave the same answer either way.
The pattern is worth knowing even if you never use an AI agent. A common way to fix this kind of leak is to let your own members through early and refuse everyone else:
-- Members pass straight through; everyone else gets one fixed refusal.
if new.tenant_id in (select my_tenant_ids()) then
return new; -- the next check now answers about whoever the member named
end if;
raise exception 'not allowed' using errcode = '42501';That early exit is the leak. Once a member is through, the next check answers a question about a third party, and the answer differs. Where no user should ever write a table directly, the safer fix refuses every direct write, member or not.
Why did the lean setups miss it? They did exactly what the brief asked, which is what Ponytail tells them to do: “Skip features, options and flexibility nobody asked for.” Plain Claude Code went looking for adjacent holes the brief did not mention.

The more uncomfortable finding was about review. When each judge reviewed a tests-first solution on its own, neither flagged the leak. When the same judges ranked all the solutions side by side, both caught it. Comparison surfaced what a single-diff review did not.
The judges also disagreed with each other often. The fix we actually shipped, after our own review, ranked 3rd of 11 with one judge and 9th of 11 with the other on the cleanup job. An AI review score is an opinion. Planted bugs and probes are evidence. We now weigh them that way.
This is the section we add after Ponytail’s rules. It replaces Ponytail’s “one small test” line:
## Tests first (this overrides "one small test")
Before you change production code:
1. Read the code the change touches. Say in 3-5 lines how it works now,
then give the plan: files, order, and what could break.
2. Write the tests first. Write at least one assertion for each requirement
in the task, including every refusal and every "must not change". Run
them, and confirm each one fails on today's code for the reason you
expect. A test that passes before the fix proves nothing, so fix the test.
3. Then write the smallest code that makes them pass, and run the related
suite again.
If something is unclear, ask instead of guessing. If you cannot ask, take
the safer reading and list it as an assumption.
Lean code, complete tests: never cut a test to make the diff shorter.Ponytail itself is released under the MIT licence, so you can pin a version, read it and combine it the same way.
You do not need our codebase to repeat this. You need a few changes you have already shipped.
Budget for the judging. Our runs cost about $94 at list price, the two judges about $110, and a pilot $6: about $210 in all. Reviewing every solution twice, with two models, cost more than writing them.
For build work, yes, with tests-first added and the rules kept out of your shared instruction files. On our numbers it writes the leanest code with tests that hold up, at a modest saving.
Ponytail alone is cheaper still, and fine for small changes your existing tests already cover. We would not use either for security or permission work, and we would not let lean rules anywhere near the agent that reviews the code.
We use AI coding agents every day, and we measure them before we trust them. Every engineer on client work is part of our in-house team, and the people you meet are the people who build your product. If you want to see how our web design team approaches builds, or how we think about agents touching a live site, start with our seven questions to ask before an AI agent touches your website and the work we have shipped.
If you are planning a web app or SaaS product and want it built by people who check the machine’s work, tell us about it.
Ready when you are