Ponytail - the lazy gentleman inside your AI agent
Ponytail is an open set of rules for AI agents that forces them to write less code. Not “better quality”, not “more architectural”, but precisely less: exactly as much as the task needs, and not a line more. Project author Dietrich Gebert describes the idea this way: “The best code is the one you didn’t write.” The repository on GitHub has collected more than two hundred thousand stars, the code is distributed under the MIT license.
The name refers to a familiar image to everyone: long ponytail, oval glasses, has been with the company longer than the version control system has existed. You show him fifty lines, he looks silently, says nothing and replaces them with one. Ponytail infuses this person into your agent.
The problem it solves
Modern agents tend to overcomplicate by default. Ask to add a date picker - you will receive either a new dependency library or a self-written calendar of three hundred lines with your own logic for switching months. The request “make a cache” turns into a one hundred and twenty line class with TTL, metrics and an eviction strategy, although a dictionary and one check were enough.
The reason is not the stupidity of the model, but the teaching style: there are many “complete, production-ready solutions” on the Internet and few examples where an adult honestly admits that the problem can be solved in one line. Ponytail rules just that.
How it works
The main mechanism is a seven-step staircase. Before writing the code, the agent stops at the first stage, which holds:
- Should this even exist?
- Maybe this is already in this project?
- Maybe the standard library can do this?
- Maybe the platform itself can do this?
- Maybe an already installed dependency can do this?
- Can this fit on one line?
- And only now - the minimum that works, plus one small test, if it has logic.
An important detail: the staircase is turned on after the agent has understood the task, and not instead. It first reads the code affected by the change and traces the actual data flow, and only then looks for what it might not need to write. Lazy to solve, but not lazy to read.
DRY and KISS
In essence, the ladder is the same old principles, only spoken out loud and in the correct order.
DRY - Don't Repeat Yourself - is responsible for steps from the second to the fifth. Before writing something new, the agent looks for something that already exists: in this project, in the standard library, in platform capabilities, in installed dependencies. The example with date selection is exactly about this: do not repeat what has already been written, but reuse the project component and the built-in browser mechanism. Hence the metric in the Claude Code strip: how often the agent reused the code instead of writing a new one.
KISS - Keep It Simple, Stupid - is responsible for the sixth and seventh steps. If a problem can be solved in one line, it can be solved in one line. If it cannot be solved, the minimum working version is taken, and not the “correct architecture for the future.” The same one-hundred-and-twenty-line cache class with metrics and eviction strategy does not pass KISS when a dictionary and one check are enough.
This also includes YAGNI - You Aren't Gonna Need It - the first stage: “should this even exist?” The three principles in Ponytail are not a declaration in a rules file, but a sequence of decisions that the agent goes through on each task. The difference is precisely this: most prompts ask to “write cleanly,” but Ponytail asks for a specific order of questions on which cleanliness rests.
Laziness as a discipline
The word “laziness” here should be taken literally, but with a clarification: we are not talking about “I don’t want to work,” but about the principle that is attributed to Steve Jobs. A line of code that you didn't write doesn't create bugs that you have to fix later.
The logic is simple. Each written line has a price: it needs to be read for review, covered with tests, supported during the next refactoring, and sooner or later debugged. An unwritten line has no price at all. Therefore, in the date selection example, the savings are not in three hundred and twenty-five lines as such, but in three hundred and twenty-five places where an error could settle - and in the evenings that do not have to be spent debugging.
Jobs was known for the cult of refusal: pride is not in what you added, but in what you managed not to add. “I’m as proud of what we didn’t do as what we did,” he said. In code, it works exactly the same way: every uncreated class, unconnected dependency, and uninvented flag is minus one point of failure. This is exactly the thought that Ponytail tries to put into the agent, which by default tends to add.
What it doesn't cut
The most common objection to such rules is “so it will cut out validation and error handling for me.” This is explicitly prohibited in Ponytail. Lazy does not mean careless: trust boundary checking, data loss handling, security and availability are never cut.
Code with branching, looping, parser, money or security leaves behind one small test. Each answer ends with a list of things that were missed or untested and risks to be aware of. That is, volume is reduced, not transparency.
Numbers
The author provides measurements on Claude Code: the same agent with and without a skill, thirty-nine tasks, including a real repository on FastAPI and React, Opus 5.5 model, five runs per task. Ponytail 5 result regarding work without skill:
- −53% lines of code;
- −41% agent time;
- −26% of cost;
- −45% of output tokens.
At the same time, the quality does not decrease, but increases. Ninety-eight percent of risky logic passes with the test, without skill - sixty-eight percent. The agent's own tests catch sixty-six percent of introduced bugs versus forty-six percent without the skill. Six security tasks—SQL injection, path traversal, token spoofing, query rate limiting, broken CSV rows, caching—passed all thirty runs.
The author himself emphasizes: the rule never sounded like “the smallest number of tokens.” It sounds like “write only what the task needs.” The code is small because it is needed, not because it was trimmed. Saving money and time is a side effect.
Example before and after
Task: add a date picker on the frontend. Without the skill, the agent either installs a date picker library or draws a calendar by hand - about three hundred thirty-five lines. With Ponytail, it first looks at what's already there: the project has an Input component, and every browser has a built-in date picker. It connects one thing to another - ten lines in one file, and the browser itself brings the calendar.
Other examples of such “surviving” solutions are in the examples directory of the repository.
Commands
In addition to the persistent mode, Ponytail adds several commands. They are not available everywhere: you need a host who knows how to work with skills - Claude Code, Codex, OpenCode, Gemini, Devin CLI, Qoder, Grok Build and others.
- /ponytail [lite | full | ultra | off]—set the intensity or turn it off. Without an argument, enables the default mode or reports the current level.
- /ponytail-review - analysis of the current diff as from a senior who will be raised at night if everything falls down: bugs, security, real load, risky code without a test, slow places and what can be cut. The goal can be specified with the words: uncommitted, staged, branch or a link to a pull request.
- /ponytail-audit - the same check for the entire repository, the most important thing at the top.
- /ponytail-debt - collects shortcut: notes left in the code into one list so that “later” does not become “never”.
- /ponytail-gain - shows the measured effect according to benchmark data.
- /ponytail-help - brief help on commands.
The default level is set by the PONYTAIL_DEFAULT_MODE environment variable or the defaultMode field in the configuration file. By default, full is enabled. The ultra level exists for cases where the codebase has personally offended you.
A special mention to /ponytail-review and /ponytail-audit in version 5: they no longer only look for things that can be removed. The review reads the code affected by the change, not just the diff, and for each finding it reports what this code does, what goes wrong, how to fix it, and what will happen if it is not fixed. The audit first builds a map of the project - entry points, data movement, expected load - and then ranks what is found.
Installation
In OpenCode, which is where I mostly work, it all comes down to one command:
opencode plugin add @dietrichgebert/ponytail
Or an entry in the opencode.json project:
{
"plugins": ["@dietrichgebert/ponytail"]
}
The plugin inserts a set of rules into each request at the selected level and adds /ponytail commands. By the way, OpenCode automatically picks up AGENTS.md from the root of the Ponytail repository, so the rules work even without a plugin - but without switching levels.
In Claude Code, installation consists of two separate requests:
/plugin marketplace add DietrichGebert/ponytail
/plugin install ponytail@ponytail
In Codex, two commands in the terminal and confirmation of two lifecycle hooks:
codex plugin marketplace add DietrichGebert/ponytail
codex plugin add ponytail@ponytail
For all other agents there are two universal paths. The first is to copy AGENTS.md into the project: it is read by Cursor, Windsurf, Cline, Copilot, Kiro, Amp, Jules and many others. The second is to ask the agent to set skills/ponytail/SKILL.md as a skill. Detailed steps for each host are collected in INSTALL.md.
The Claude Code and Codex plugins require Node.js in the PATH: two small hooks run on it. Without it, the skills will continue to work, but each call to the hook will show a harmless error.
Stripe and board
In Claude Code, starting with version 5.3, Ponytail shows a bar above the input line: how much the current task costs, how many tokens and agent time were spent, how often he reused existing code instead of writing new one, whether tests passed after the last edit. Buttons on the strip switch the level, launch /ponytail-review or /ponytail-audit, copy the task into Markdown, and collapse the strip into one line. The /ponytail band command hides it and brings it back.
Nearby there is a board - a local page with all the tasks for your projects: cost, agent time and tokens by day, each session with test results, active days and series. By default, everything stays on your machine, in the Ponytail configuration directory. The /ponytail band import command adds past Claude Code sessions there, along with their cost and token consumption.
What to pay attention to
The first and most important thing is the source. The author directly warns: you should install Ponytail only from the DietrichGebert/ponytail repository on GitHub or the @dietrichgebert/ponytail package in npm. The project never ships .exe or .dll files, and the copy that contains them is not its own. For a tool that inserts text into every model query, this is reasonable paranoia.
Second, this is not a silver bullet. The rules change the style, but do not eliminate the need to read diffs. Commands are not available on all hosts, and lifecycle hooks are not supported everywhere, so in some editors, levels are not saved between sessions.
Third, the ladder requires discipline from the agent himself. A model that does not follow instructions well may get carried away and start saving where it is not necessary. This is why the author insists: the reduction in scope does not apply to validation, security and availability, and every answer ends with a list of what was missed.
Instead of output
Ponytail solves not a technical problem, but a behavioral one. Agents learned to write code faster than people could read it, and the main deficit was not the amount of writing, but the amount of understanding. The rule “first look at what already exists” saves not only tokens and money, but also time for review - and with it the number of places where something can break.
The code you didn't write scales infinitely: zero bugs, zero vulnerabilities, one hundred percent uptime since time immemorial. This is a joke from the FAQ, but there is more truth in it than we would like.
Repository:
https://github.com/DietrichGebert/ponytail
Project website: