Sponsored Content

DEV Community

Cover image for Ponytail: the AI coding skill that makes your agent write less code
ArshTechPro
ArshTechPro

Posted on

Ponytail: the AI coding skill that makes your agent write less code

You ask your AI agent for a date picker.

It installs flatpickr, writes a wrapper component, adds a stylesheet, sets up a theme override, and then starts explaining timezone handling to you. Four hundred lines later you have a date picker.

The senior dev sitting two desks over would have written this:

<input type="date">
Enter fullscreen mode Exit fullscreen mode

Ponytail is an open-source skill/plugin that tries to put that person inside your coding agent. It works with Claude Code, Codex, Cursor, Gemini CLI, Copilot, OpenCode, Windsurf, Cline, and a long list of others. MIT licensed.

The idea in one screen

Ponytail is not a tool, a library, or a model. It is a ruleset that gets injected into your agent's context every turn. The core of it is a ladder. Before writing any code, the agent stops at the first rung that holds:

1. Does this need to exist?   -> no: skip it (YAGNI)
2. Already in this codebase?  -> reuse it, don't rewrite
3. Stdlib does it?            -> use it
4. Native platform feature?   -> use it
5. Installed dependency?      -> use it
6. One line?                  -> one line
7. Only then: the minimum that works
Enter fullscreen mode Exit fullscreen mode

That's basically it. Everything else in the repo is packaging: adapters for twenty-odd agents, a few slash commands, and a benchmark harness.

Two things about the ladder that matter more than they look:

It runs after understanding, not instead of it. The rules tell the agent to read the code the change touches and trace the actual flow before picking a rung. Lazy about the solution, not about reading the codebase.

Validation is off the table. The rules explicitly protect trust-boundary validation, error handling, security, and accessibility. The stated goal is not "fewest tokens." It is "write only what the task needs." The code comes out small because the extra was never needed, not because it was golfed down.

Installing it

Pick your agent. For Claude Code, two prompts (they have to be sent separately):

/plugin marketplace add DietrichGebert/ponytail
Enter fullscreen mode Exit fullscreen mode
/plugin install ponytail@ponytail
Enter fullscreen mode Exit fullscreen mode

Codex:

codex plugin marketplace add DietrichGebert/ponytail
codex plugin add ponytail@ponytail
Enter fullscreen mode Exit fullscreen mode

Copilot CLI:

copilot plugin marketplace add DietrichGebert/ponytail
copilot plugin install ponytail@ponytail
Enter fullscreen mode Exit fullscreen mode

Gemini CLI:

gemini extensions install https://github.com/DietrichGebert/ponytail
Enter fullscreen mode Exit fullscreen mode

For Cursor, Windsurf, Cline, Kiro, Aider, and Copilot Chat there is no plugin layer, so you copy the matching rules file out of the repo (.cursor/rules/, .windsurf/rules/, .clinerules/, and so on). Several agents also auto-load AGENTS.md from the project root, and the repo ships one, so those work with zero setup from a checkout.

The Claude Code and Codex plugins run two small Node lifecycle hooks, so node needs to be on your PATH. If it isn't, the skills still work; you just lose the always-on activation.

The commands

Command What it does
`/ponytail [lite\ full\
{% raw %}/ponytail-review Reviews your current diff for over-engineering, hands back a delete-list.
/ponytail-audit Same, but across the whole repo instead of the diff.
/ponytail-debt Collects the ponytail: shortcuts you deferred into a ledger.
/ponytail-gain Shows the measured impact scoreboard.
/ponytail-help Quick reference.

/ponytail-review is the one I'd reach for first even if you never turn on always-on mode. Pointing it at a diff you already wrote is a low-commitment way to see whether the discipline finds anything real in your codebase.

Commands need a skill-capable host. The instruction-only adapters (Cursor, Windsurf, Cline, Copilot Chat, Kiro) get the always-on ruleset but not the commands.

What the numbers actually say

This is where the project gets more interesting than most GitHub trending entries, and it's worth walking through because the story has a plot twist.

The original benchmark claimed 80-94% less code. Someone opened issue #126 and made four fair criticisms:

  1. A single prompt-completion pair is not how agents are used.
  2. The baseline was a bare chatty model that padded answers with prose and options, so "lines of the answer" was counting commentary, not code.
  3. "Prefer one-liners" might trade away safety.
  4. A seven-word prompt might do the same job as a whole skill.

Against that fairer baseline:

vs no-skill baseline LOC tokens cost time safe
ponytail -54% -22% -20% -27% 100%
caveman (terse prose) -20% +7% +3% +2% 100%
"YAGNI + one-liners" prompt -33% -14% -21% -30% 95%

The per-task numbers are more useful than the average:

task baseline ponytail
date picker 404 23
color picker 287 23
file dropzone 251 95
multi-step wizard 571 312
search items by title 44 44
export items as CSV 36 33
count user's items 21 17

The shape is clear. Where there is an over-build trap, the cut is enormous, because the agent reaches for <input type="date"> instead of building a component. Where the code is already minimal (backend CRUD), every arm converges and ponytail does nothing. The -54% headline is an average across both kinds of task, so treat it as "huge sometimes, zero other times," not "half your code everywhere."

The safety tier is the part I found most convincing. Six tasks seed a starter file, ask for one function, and leave the safety requirement implicit the way a real ticket does. The scorer then executes the produced function against adversarial input: path traversal, SQL injection, a forged token, a malformed CSV row.

On the path-joining task, the bare one-liner prompt wrote the fewest lines (6) and let a ../../ filename escape the directory one run in four. Ponytail wrote about 9.5 lines and held 4/4. The extra three lines were the traversal check. That is the whole argument for using a structured ruleset instead of telling your agent "be brief."

Two more things I'll credit them for. The benchmark writeup has a limitations section that names its own weak points (one model only, n=4, safety is a floor and not a proof). And it documents a contamination bug they found in their own earlier run, where the plugin's SessionStart hook was firing on the baseline arm too, secretly running ponytail against itself. Finding and publishing that is a better trust signal than any number in the table.

Where I'd push back

It's a prompt, not a guarantee. Everything here is instructions in a context window. Models drift, ignore rules under load, and behave differently across vendors. Nothing enforces the ladder.

The gains depend on your agent being bad in a specific way. The wins come from an agent that over-builds. If you're on a stronger model, or you already write tight tickets that say "use a native input," a lot of that headroom is already gone. The README itself notes the effect can invert on some reasoning models that spend extra thinking tokens deliberating the rungs.

Is it worth a try?

Yes, with a caveat about which "yes" this is.

The cost of trying is two commands and a slash command to turn it off. There's no runtime, no dependency in your project, no lock-in, and the uninstall is documented (including a cleanup script for the state it writes outside the plugin folder). At that price, the question is barely worth deliberating.

Repo: github.com/DietrichGebert/ponytail

Benchmark writeup and reproduction steps: benchmarks/results/2026-06-18-agentic.md

Top comments (2)

Collapse
 
max_quimby profile image
Max Quimby

The <input type="date"> opening is painfully accurate — agents default to constructing because the training signal rewards visible effort, and "the platform already does this" is exactly the tacit senior-dev knowledge that doesn't show up as tokens.

What I like about the ladder framing is the ordering: "does this need to exist?" sits above "reuse it," which is the rung most YAGNI advice skips. And the explicit carve-out that validation/security/accessibility are off the table is the detail that makes this safe to actually run — the failure mode of naive "write less code" rules is that the model learns to golf away the error handling too, because that's the code with no happy-path payoff.

The open question for me with any always-injected ruleset is drift under context pressure: on turn 30 of a long session, with the ladder competing against a big diff and tool output for attention, does it still fire? That's usually where these behavioral rules quietly stop being obeyed. Does the benchmark harness in the repo test sustained adherence over a long session, or mostly single-shot tasks? That'd be the number I'd trust most.

Collapse
 
eduzsh profile image
Edu Peralta

The date picker example is painfully familiar. Ask for a small UI piece and the agent reaches for a library, a wrapper, a theme file, and a lecture on timezones before anyone checks whether the platform already ships the control. The ladder that forces reuse and stdlib first, while carving out validation and security as things you do not strip, is the useful split. Curious how often /ponytail-review's delete list catches real overbuild versus arguing with intentional scaffolding the agent cannot see from one file.