{"slug": "ponytail-the-ai-coding-skill-that-makes-your-agent-write-less-code", "title": "Ponytail: the AI coding skill that makes your agent write less code", "summary": "Ponytail, an open-source skill for AI coding agents, aims to reduce code bloat by enforcing a 'ladder' of rules that prioritize reuse and minimal code. The project, created by Dietrich Gebert, works with Claude Code, Codex, Cursor, and other agents, and includes commands like /ponytail-review to audit diffs for over-engineering. The original benchmark claimed 80-94% less code, though a GitHub issue raised questions about the methodology.", "body_md": "You ask your AI agent for a date picker.\n\nIt 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.\n\nThe senior dev sitting two desks over would have written this:\n\n```\n<input type=\"date\">\n```\n\n[Ponytail](https://github.com/DietrichGebert/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.\n\nPonytail 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:\n\n``` php\n1. Does this need to exist?   -> no: skip it (YAGNI)\n2. Already in this codebase?  -> reuse it, don't rewrite\n3. Stdlib does it?            -> use it\n4. Native platform feature?   -> use it\n5. Installed dependency?      -> use it\n6. One line?                  -> one line\n7. Only then: the minimum that works\n```\n\nThat's basically it. Everything else in the repo is packaging: adapters for twenty-odd agents, a few slash commands, and a benchmark harness.\n\nTwo things about the ladder that matter more than they look:\n\n**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.\n\n**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.\n\nPick your agent. For Claude Code, two prompts (they have to be sent separately):\n\n```\n/plugin marketplace add DietrichGebert/ponytail\n/plugin install ponytail@ponytail\n```\n\nCodex:\n\n```\ncodex plugin marketplace add DietrichGebert/ponytail\ncodex plugin add ponytail@ponytail\n```\n\nCopilot CLI:\n\n```\ncopilot plugin marketplace add DietrichGebert/ponytail\ncopilot plugin install ponytail@ponytail\n```\n\nGemini CLI:\n\n```\ngemini extensions install https://github.com/DietrichGebert/ponytail\n```\n\nFor 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/`\n\n, `.windsurf/rules/`\n\n, `.clinerules/`\n\n, and so on). Several agents also auto-load `AGENTS.md`\n\nfrom the project root, and the repo ships one, so those work with zero setup from a checkout.\n\nThe Claude Code and Codex plugins run two small Node lifecycle hooks, so `node`\n\nneeds to be on your PATH. If it isn't, the skills still work; you just lose the always-on activation.\n\n| Command | What it does |\n|---|---|\n| `/ponytail [lite\\ | full\\ |\n{% raw %}`/ponytail-review`\n|\nReviews your current diff for over-engineering, hands back a delete-list. |\n`/ponytail-audit` |\nSame, but across the whole repo instead of the diff. |\n`/ponytail-debt` |\nCollects the `ponytail:` shortcuts you deferred into a ledger. |\n`/ponytail-gain` |\nShows the measured impact scoreboard. |\n`/ponytail-help` |\nQuick reference. |\n\n`/ponytail-review`\n\nis 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.\n\nCommands need a skill-capable host. The instruction-only adapters (Cursor, Windsurf, Cline, Copilot Chat, Kiro) get the always-on ruleset but not the commands.\n\nThis 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.\n\nThe original benchmark claimed 80-94% less code. Someone opened [issue #126](https://github.com/DietrichGebert/ponytail/issues/126) and made four fair criticisms:\n\nAgainst that fairer baseline:\n\n| vs no-skill baseline | LOC | tokens | cost | time | safe |\n|---|---|---|---|---|---|\n| ponytail | -54% | -22% | -20% | -27% | 100% |\n| caveman (terse prose) | -20% | +7% | +3% | +2% | 100% |\n| \"YAGNI + one-liners\" prompt | -33% | -14% | -21% | -30% | 95% |\n\nThe per-task numbers are more useful than the average:\n\n| task | baseline | ponytail |\n|---|---|---|\n| date picker | 404 | 23 |\n| color picker | 287 | 23 |\n| file dropzone | 251 | 95 |\n| multi-step wizard | 571 | 312 |\n| search items by title | 44 | 44 |\n| export items as CSV | 36 | 33 |\n| count user's items | 21 | 17 |\n\nThe shape is clear. Where there is an over-build trap, the cut is enormous, because the agent reaches for `<input type=\"date\">`\n\ninstead 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.\"\n\nThe 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.\n\nOn the path-joining task, the bare one-liner prompt wrote the fewest lines (6) and let a `../../`\n\nfilename 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.\"\n\nTwo 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.\n\n**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.\n\n**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.\n\nYes, with a caveat about which \"yes\" this is.\n\nThe 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.\n\nRepo: [github.com/DietrichGebert/ponytail](https://github.com/DietrichGebert/ponytail)\n\nBenchmark writeup and reproduction steps: [benchmarks/results/2026-06-18-agentic.md](https://github.com/DietrichGebert/ponytail/blob/main/benchmarks/results/2026-06-18-agentic.md)", "url": "https://wpnews.pro/news/ponytail-the-ai-coding-skill-that-makes-your-agent-write-less-code", "canonical_source": "https://dev.to/arshtechpro/ponytail-the-ai-coding-skill-that-makes-your-agent-write-less-code-29l3", "published_at": "2026-08-28 11:12:26+00:00", "updated_at": "2026-08-28 11:19:13.640111+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "ai-agents"], "entities": ["Ponytail", "Dietrich Gebert", "Claude Code", "Codex", "Cursor", "Gemini CLI", "Copilot", "Windsurf"], "alternates": {"html": "https://wpnews.pro/news/ponytail-the-ai-coding-skill-that-makes-your-agent-write-less-code", "markdown": "https://wpnews.pro/news/ponytail-the-ai-coding-skill-that-makes-your-agent-write-less-code.md", "text": "https://wpnews.pro/news/ponytail-the-ai-coding-skill-that-makes-your-agent-write-less-code.txt", "jsonld": "https://wpnews.pro/news/ponytail-the-ai-coding-skill-that-makes-your-agent-write-less-code.jsonld"}}