AI news and explainers at 7 AM weekdays, plus a Sunday weekly at 8Get it in your inbox

METAL LAB

DietrichGebert/ponytail

110,492+944 todayJavaScript

A ruleset that teaches AI coding agents to say no to writing code

ponytail is a set of rules (shipped as a plugin/skill) that makes AI coding agents like Claude Code and Codex check whether code even needs to be written before writing it. It pushes the agent to reuse existing code, standard libraries, or native platform features before reaching for a new dependency or component. In a real test on a FastAPI+React repo, the same agent with ponytail wrote 54% less code on average while keeping all its safety checks (validation, error handling, security, accessibility) intact.

What it does

  1. The problem: ask an AI agent for a date picker and it installs a library (flatpickr), writes a wrapper component, adds a stylesheet, and starts overthinking edge cases like timezones.
  2. The fix: before writing anything, the agent is made to check a fixed order of questions - does this need to exist, is it already in the codebase, does the standard library do it, does the platform have it natively, is a dependency already installed, can it be one line - and only builds the minimum after all of those fail.
  3. The result: on 12 real feature tickets in the tiangolo full-stack-fastapi-template repo, run with a headless Claude Code session (Haiku 4.5 model, 4 runs each), ponytail cut lines of code by 54% on average (up to 94%) versus the same agent with no skill, cut tokens by 22%, cost by 20%, and time by 27%, while keeping a safety score of 100%.
  4. Comparison: a plain terse-prose control (caveman) and a simple 'YAGNI plus one-liners' prompt were also tested; both did worse on cost/time/tokens or dropped safety to 95%, while ponytail was the only approach that improved every metric without losing safety.
  5. Setup: it installs as a plugin or a copied rules file across more than 20 AI coding tools, including Claude Code, Codex, GitHub Copilot CLI, Cursor, Windsurf, and Gemini CLI.

Why it matters

AI coding agents tend to over-build - adding unnecessary dependencies, components, and complexity - which increases maintenance burden and attack surface; this tool addresses that with plain instruction text rather than retraining any model. It gives teams adopting AI coding agents a concrete, measured way to control both code bloat and the cost/time of agent sessions.

Terms in this repo

  • YAGNI · 'You Aren't Gonna Need It' - a principle against building features before they're actually needed
  • LOC · Lines of Code
  • AGENTS.md · A shared instruction file many AI coding tools automatically read from a project
  • n=4 · Each task was run 4 times to get the measurement
  • Haiku 4.5 · The AI model used for this benchmark

Repository description (English)

Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.

Open on GitHub

Trending repos

All repos →

Latest from METAL LAB