Why your agent writes too much
An agent left to its own judgement solves a small task with a big diff, and you pay for every extra line twice.
Ask an agent for a date field and it can install a picker library, write a wrapper component and add a stylesheet. The task took thirty seconds to describe and now you own forty lines plus a dependency. You pay once in tokens, then again every time that code needs reading or fixing.
Ponytail is a plugin for Claude Code, built by Dietrich Gebert and published free under the MIT licence. It loads a ruleset that forces the agent to walk a ladder of cheaper options, in order, before any new code is written.
The project's own benchmark, twelve feature tasks on a real FastAPI and React repository run with and without the plugin, reports 54% fewer lines of code, 22% fewer tokens, 20% lower cost and 27% less time. Those are measured results from that one benchmark, run at n=4 on Haiku 4.5. Your tasks and your codebase will move the numbers.
Setup takes under five minutes and needs nothing beyond Claude Code itself.
Install it
Each command goes in as its own message. Sending them together is the one way this install fails.
Add the Ponytail marketplace
1 minuteOpen Claude Code and send /plugin marketplace add DietrichGebert/ponytail as a message on its own.
Why this matters
A marketplace is a catalogue Claude Code can install plugins from. This command registers Dietrich Gebert's catalogue so the next command can find the plugin inside it.
Install the plugin
1 minuteSend /plugin install ponytail@ponytail as a second, separate message.
Note. The repository is explicit that the two commands must be sent as two separate prompts. Pasting both in one message breaks the install.
Reload plugins
When Claude Code reports the plugin changed, send /reload-plugins so the ruleset activates in your current session.
Why this matters
Without the reload, the plugin sits installed but inactive until your next session, and the agent keeps its old habits in this one.
Confirm it is on
CheckpointSend /ponytail with no argument. It replies with the current level, which starts at full.
Pick your level
Send /ponytail lite, /ponytail full or /ponytail ultra to change intensity, or /ponytail off to disable it for the session.
Why this matters
Full is the default and the right starting point. Judge the levels on your own tasks for a day before moving: the difference shows in the size of the diffs, and only your work can tell you which setting earns its keep.
Copy the commands
The full install sequence in order. Send each line as its own message in Claude Code.
Ponytail install sequence
/plugin marketplace add DietrichGebert/ponytail
/plugin install ponytail@ponytail
/reload-plugins
/ponytailThe ladder it climbs before writing code
- Does this need to exist at all? If no, skip it.
- Does the codebase already have it? Reuse it rather than rewriting it.
- Does the language's standard library do it? Use that.
- Does the platform do it natively, like a built-in browser control? Use that.
- Does an already-installed dependency cover it? Use that before adding a new one.
- Can it be one line? Then it is one line.
- Only after all six: write the minimum code that works.
The date picker, twice
The repository's own worked example, reproduced here because it shows the whole idea in one artefact.
Without Ponytail
The agent installs flatpickr, writes a wrapper component, adds a stylesheet, and opens a discussion about timezones.
With Ponytail
A one-line HTML input with type="date", plus a comment noting the browser already has one.
Why it changed. The browser ships a working date control, so the ladder's native-platform rung catches the task before any new code exists.
The best code is the code you never wrote.
Controls worth knowing
- Check the level
- /ponytail with no argument reports the current setting, and the mode-change text confirms every switch.
- Set a default
- The PONYTAIL_DEFAULT_MODE environment variable, or ~/.config/ponytail/config.json, fixes the level every session starts at.
- Turn it off cleanly
- /ponytail off disables it for the session. Useful when you genuinely want the agent to scaffold something big.
What it never cuts
The ruleset is lazy about solutions, never about safety. Trust-boundary validation, error handling that prevents data loss, security and accessibility stay in scope at every level. Genuinely custom work still gets custom code; the plugin only stops the agent reaching for new code first.
Confirm it took
- /ponytail replies with a level instead of an unknown-command error.
- Ask for a small feature and watch the agent check existing code before proposing new files.
- Compare the diff to the ask: a one-line request now gets a one-line answer or a reason why not.
- Confirm validation and error handling still appear where the task genuinely needs them.