Teach AI to Delete Code, Not Add It

After all these years of writing code, we've accumulated a pile of principles: KISS, SOLID, and YAGNI—"You Aren't Gonna Need It," which comes from Extreme Programming (XP): don't add that feature until you actually need it.

AI coding is here, and that doesn't mean we can stop caring about code quality. Quite the opposite: over the past three years of practice, concise code has only become more important.

The problem is that when you ask AI to add a feature, its limited context usually means it only looks at a small patch of code right in front of it, never the whole picture. So it keeps stacking more on top, reinventing wheels, and fighting with capabilities the system already has.

Today's professional coding agents have eased part of this, but they haven't cured it. Since vibe coding took off, "shit mountains" have become more common.

The rules from Ponytail, which I'm introducing today, are exactly the kind of hand-holding constraints they need.

Repo: https://github.com/DietrichGebert/ponytail

Ponytail is an agent skill (a set of rules) that follows the YAGNI principle. Its goal is straightforward: constrain your agent from several angles so it writes less code.

According to the project, it cuts token consumption by about 20%—less code written, fewer tokens spent, fewer pitfalls hit.

Since its release, GitHub stars have climbed fast: 7,000 in three weeks, and close to 14,000 now.

Installation is fairly simple. Claude Code, Codex, Pi Agent, and others can install it from their official skill marketplaces. For other tools, copy the corresponding rules file from the repo—for example, Cursor goes in .cursor/rules/, Qoder in .qoder/rules/.

The commands/Skills it supports:

Command What it does
/ponytail [lite \| full \| ultra \| off] Set the intensity or turn it off; with no argument, it reports the current level
/ponytail-review Review over-engineering in the current diff and hand back a "delete list"
/ponytail-audit Review the entire repo, not just the diff
/ponytail-debt Collect deferred ponytail: shortcuts into a ledger, so "later" doesn't become "never"
/ponytail-gain Show the gains quantified by benchmarks (less code, lower cost, faster)
/ponytail-help A quick reference for the commands above

The commands require a host that supports skills: Claude Code, Codex, Devin CLI, OpenCode, Gemini, pi, Swival, Hermes Agent, Qoder, Grok Build.

Pure instruction-only adapters (Cursor, Windsurf, Cline, Copilot, Kiro, Antigravity) only load the always-on rule set and have no commands.

Red Hat distinguished engineer Max Rydahl Andersen's approach is worth learning from:

"Using Hunk and Ponytail for code review is my favorite prompt for coding agents lately."

In other words, he treats Ponytail as a review tool: let the Agent find and delete over-engineered code, rather than setting it as the default coding mode.

That mindset is very practical—let AI write normally first, then use Ponytail to do a round of "subtraction." Adding features is AI's strong suit; restraint is not, so bring in an external rule to cover that gap.

Ponytail solves a real problem, but it's not a silver bullet:

  • It constrains "how much" gets written, not "whether it's right." Deleting over-engineering doesn't mean the architecture is sound.
  • Its effectiveness depends on whether the agent actually follows the rules, and different hosts will perform differently.
  • Using it as a one-off review step is usually less likely to cause collateral damage than running it as an always-on mode.

If you're also tired of AI handing you a new abstraction layer, a new helper, and a new set of configs every single time, it's worth a try. Think of it as a colleague who says "we don't need that" on your behalf.