Ponytail

2026-06-21 · page · source ↗ · source summary

A multi-platform AI coding agent plugin that forces the simplest solution that actually works. It's a "lazy senior dev" persona injected as system prompt context — the agent climbs a decision ladder before writing any code: YAGNI → stdlib → native platform → installed dep → one line → minimum code. Ships as a Claude Code plugin with adapters for 14+ coding agent hosts. Thoroughly benchmarked: on real headless Claude Code sessions editing a real FastAPI+React repo, it cuts 54% of code (mean across 12 feature tasks) without dropping a single safety guard.


Architecture

Ponytail is ruleset injection, not a framework. It doesn't wrap API calls or intercept tools — it augments the system prompt with a specific decision heuristic.

Core layers

Host adapters (hooks/)

Three Node.js lifecycle hooks with zero npm dependencies:

File Event What it does
ponytail-activate.js SessionStart Writes flag file, emits ruleset, detects missing statusline
ponytail-mode-tracker.js UserPromptSubmit Parses /ponytail commands, updates flag file
ponytail-config.js (shared) Resolves default mode: env var → config file → 'full'

Mode persistence uses a simple flag file (.ponytail-active) rather than a config key — the statusline reads it without JSON parsing, and multi-host adapters share the same state.

Mode filtering

The three intensity levels (lite/full/ultra) come from a single SKILL.md file. filterSkillBodyForMode() in ponytail-instructions.js strips rows whose mode label doesn't match the active level. Non-mode-specific rules (the ladder, safety boundaries) are always present. One source of truth, programmatic filtering — no three separate rule files.

Host abstraction

ponytail-runtime.js detects the host via environment variables (CLAUDE_PLUGIN_ROOT, PLUGIN_DATA, COPILOT_PLUGIN_DATA) and emits host-appropriate output: raw text for Claude Code, {systemMessage, hookSpecificOutput} for Codex, {additionalContext} for Copilot.

14+ host adapters

Thin wrappers pointing at the shared core:

Key Techniques

The ladder — a decision tree, not a vibe

The core innovation is a concrete algorithm, not a vague instruction. Before any code: (1) does this need to exist? (2) stdlib? (3) native platform? (4) installed dep? (5) one line? (6) minimum code. Two rungs work → take the higher one and move on. This is why it beats "YAGNI + one-liners" as a plain prompt — the ladder is a consistent procedure; the prompt sometimes lands and sometimes doesn't.

Safety as explicit exclusion

The ruleset enumerates what is NEVER simplified: input validation at trust boundaries, error handling preventing data loss, security, accessibility, hardware calibration. The benchmark verifies this with adversarial test cases — ponytail kept the path-traversal check (the ~3 lines that matter) while the bare "one-liner" prompt dropped it once in four runs.

ponytail: comment convention

Deliberate simplifications are marked: // ponytail: global lock, per-account locks if throughput matters. The comment names the ceiling and the upgrade path. /ponytail-debt greps these into a ledger so deferred shortcuts don't silently rot.

One runnable check

Non-trivial logic leaves ONE check behind — an assert, a __main__ self-check, or one small test file. No frameworks, no fixtures. Verified by the behavior gate.

Over-engineering review

/ponytail-review hunts ONLY complexity, not bugs. Five tags: delete:, stdlib:, native:, yagni:, shrink:. One line per finding. A complementary review dimension — pair with normal correctness review.

Benchmarking rigor

The agentic benchmark (2026-06-18) is unusually honest: - Real headless Claude Code sessions on tiangolo/full-stack-fastapi-template - 4 arms (baseline, ponytail, caveman, yagni-oneliner), n=4, measured by git diff - Published their own contamination bug (SessionStart hook firing on baseline arm) - Shows where ponytail does NOT win (irreducible backend CRUD is near-identical) - Gain skill refuses to compute per-repo savings ("the unbuilt version was never written")

Design Decisions

Ruleset injection, not a framework. Pure system prompt augmentation — host-portable, works with any instruction-following model. Trade-off: no programmatic enforcement, model-dependent.

Thin adapters, thick shared core. Every host adapter is ~50 lines of glue around the same ponytail-instructions.js builder and skills/ files.

Filter one file, don't maintain three. Lite/full/ultra derived from a single SKILL.md by filtering mode-tagged rows.

Flag file over config key. Persistence via .ponytail-active rather than settings.json — statusline reads it without JSON parsing, multi-host adapters share state.

Node.js for hooks, zero deps. Lifecycle hooks use pure Node stdlib — no install complexity on the critical session-start path.

AGENTS.md as universal fallback. For hosts that can't run hooks, copying one file gives always-on behavior.

Comparison Notes


Source: Ponytail — Lazy Senior Dev Mode for AI Coding Agents Repository: https://github.com/DietrichGebert/ponytail (MIT, v4.7.0) Last updated: 2026-06-21