@vikingmute: 发现这个 Ponytail 和 Codex 是绝配了https://github.com/DietrichGebert/ponytail… GPT 写兜底代码上瘾了,没有明确指示总是写一大堆防御性代码,看的想哭。 它的核心理念是 “The…
摘要
Ponytail是一个AI代理技能,通过强制代理先检查是否需要写新代码来大幅减少过度工程,声称能减少80-94%的代码量和42-75%的成本。作者推荐与Codex搭配使用,并已在GitHub上开源。
查看缓存全文
缓存时间: 2026/06/17 16:02
发现这个 Ponytail 和 Codex 是绝配了https://github.com/DietrichGebert/ponytail…
GPT 写兜底代码上瘾了,没有明确指示总是写一大堆防御性代码,看的想哭。
它的核心理念是 “The best code is the code you never wrote.”通过强制 agent 先检查是否真的需要写新代码,来大幅减少 over-engineering。
官方数据说:80-94% less code, 42-75% less cost, and 3-6× faster than a no-skill agent,
今天安装上试试看是否好用,stars 数已经很多了。
DietrichGebert/ponytail
Source: https://github.com/DietrichGebert/ponytail
Ponytail
He says nothing. He writes one line. It works.
80-94% less code · 3-6× faster · 42-75% cheaper
Per-task code, latency, and cost on the Claude API, not your plan's quota. Median across Haiku, Sonnet, and Opus (10 runs for code and latency, 30 for the re-verified cost). Results vary by model and prompt: the ruleset re-injects each turn, so on a short prompt or a terse reasoning model that overhead can outweigh the savings. Reproduce it yourself.
You know him. Long ponytail. Oval glasses. Has been at the company longer than the version control. You show him fifty lines; he looks at them, says nothing, and replaces them with one.
Ponytail puts him inside your AI agent.
Before / after
You ask for a date picker. Your agent installs flatpickr, writes a wrapper component, adds a stylesheet, and starts a discussion about timezones.
With ponytail:
<!-- ponytail: browser has one -->
<input type="date">
More survivors in examples/.
Numbers
Five everyday tasks (email validator, debounce, CSV sum, countdown timer, rate limiter), three models, three arms: no skill, the caveman skill, and ponytail. Ten runs per cell, median reported.
80-94% less code, 42-75% less cost, and 3-6× faster than a no-skill agent, on every Claude model. Every shortcut ponytail takes is marked in the code with a ponytail: comment naming its upgrade path. Reproduce it yourself: npx promptfoo eval -c benchmarks/promptfooconfig.yaml. Method and raw numbers: benchmarks/. Production-grade tasks, where an unconstrained agent bloats far more, are written up in benchmarks/results/.
That is the byproduct, not the pitch. These are Claude numbers, and they vary by model. Capable instruction-following models follow the ladder and write far less, cheaper and faster. Terse reasoning models can go the other way: the ladder is a deliberation step, so the model spends thinking tokens working through the rungs before it saves any output, and together with the always-on ruleset that can cost more than the shorter code saves. On GPT-5.5 it does. And all of this is single-shot, one prompt in and one answer out: a real agent session re-injects the ruleset and runs the ladder every turn, which this benchmark does not measure, so per-session cost can land either way. The rule was never “fewest tokens.” It is: write only what the task needs, and never cut validation, error handling, security, or accessibility. The code ends up small because it is necessary, not golfed, and that is the part that stays maintainable. Lower cost and latency are a side effect on the models that follow it.
How it works
Before writing code, the agent stops at the first rung that holds:
1. Does this need to exist? → no: skip it (YAGNI)
2. Stdlib does it? → use it
3. Native platform feature? → use it
4. Installed dependency? → use it
5. One line? → one line
6. Only then: the minimum that works
Lazy, not negligent: trust-boundary validation, data-loss handling, security, and accessibility are never on the chopping block.
Install
The most effort ponytail will ever ask of you:
The Claude Code and Codex plugins run two tiny Node.js lifecycle hooks, so node needs to be on your PATH (note for Nix/nvm users: it must be on the non-interactive shell’s PATH). If it isn’t, the skills still work, the always-on activation just stays quiet instead of erroring on every prompt.
Claude Code
/plugin marketplace add DietrichGebert/ponytail
/plugin install ponytail@ponytail
Codex
codex plugin marketplace add DietrichGebert/ponytail
codex
Open /plugins, select the Ponytail marketplace, and install Ponytail. Then
open /hooks, review and trust its two lifecycle hooks, and start a new thread.
This same install also covers the Codex desktop app: restart the app after installing and it picks up the plugin.
GitHub Copilot CLI
copilot plugin marketplace add DietrichGebert/ponytail
copilot plugin install ponytail@ponytail
In an interactive Copilot CLI session, use the slash equivalents:
/plugin marketplace add DietrichGebert/ponytail
/plugin install ponytail@ponytail
Copilot CLI namespaces plugin commands by plugin name. For example:
/ponytail:ponytail ultra
/ponytail:ponytail-review
Pi agent harness
pi install git:github.com/DietrichGebert/ponytail
OpenCode
Run OpenCode from a checkout of this repo (the plugin reuses its hooks/ and skills/), and add to opencode.json:
{ "plugin": ["./.opencode/plugins/ponytail.mjs"] }
Injects the ruleset every turn at the active level; adds the /ponytail commands (see Commands). OpenCode also auto-loads this repo’s AGENTS.md, so the rules hold even without the plugin. The plugin adds the lite/full/ultra/off levels.
The ./ path resolves against your project’s opencode.json; to share one checkout across projects, point it at the absolute path of the .mjs instead (it finds its hooks/ and skills/ relative to its own file).
Gemini CLI
gemini extensions install https://github.com/DietrichGebert/ponytail
Loads the ruleset as always-on context every session and registers the /ponytail commands; the skills/ ship too, activated when a task needs them.
Antigravity CLI
Google is renaming Gemini CLI to Antigravity CLI (the agy binary); the same extension installs there:
agy plugin install https://github.com/DietrichGebert/ponytail
It reuses this repo’s gemini-extension.json. One difference: Antigravity converts the /ponytail commands into skills, so you type them into the chat (e.g. /ponytail-review as a message) instead of picking them from a slash menu. Until the migration completes (around June 18, 2026), gemini extensions install still works too. To run it as an always-on rule instead, drop the ruleset into .agents/rules/.
OpenClaw
clawhub install ponytail
Installs ponytail as an OpenClaw skill from ClawHub; the review, audit, debt, and help skills install the same way (clawhub install ponytail-review, and so on). OpenClaw applies it on coding tasks and also exposes it as a /ponytail command. Without ClawHub, copy .openclaw/skills/ponytail into ~/.openclaw/skills/.
That was it. He’d be proud. He won’t say it.
Active every session, with a handful of commands (see Commands). /ponytail ultra exists for when the codebase has wronged you personally. Startup and mode-change text shows the current mode.
Set the level for every new session with the PONYTAIL_DEFAULT_MODE env var (lite/full/ultra/off), or a defaultMode field in ~/.config/ponytail/config.json (%APPDATA%\ponytail\config.json on Windows). The default is full.
Cursor, Windsurf, Cline, GitHub Copilot (editor), Aider, Kiro: copy the matching rules file from this repo (.cursor/rules/, .windsurf/rules/, .clinerules/, .github/copilot-instructions.md, AGENTS.md, .kiro/steering/).
Kiro: copy .kiro/steering/ponytail.md to ~/.kiro/steering/ (global) or .kiro/steering/ in your project.
GitHub Copilot CLI fallback (instruction-only mode): it reads AGENTS.md and .github/copilot-instructions.md in a project, or copy the rules into ~/.copilot/copilot-instructions.md to run ponytail in every project. This path keeps always-on guidance, but does not add plugin mode switches or hooks.
VS Code with the Codex extension reads AGENTS.md, which this repo ships, so it works from the repo root with no setup (~/.codex/AGENTS.md makes Codex global).
Which files map to which agent: Agent portability.
Commands
| Command | What it does |
|---|---|
/ponytail [lite | full | ultra | off] | Set the intensity, or turn it off. No argument reports the current level. |
/ponytail-review | Review the current diff for over-engineering, hands back a delete-list. |
/ponytail-audit | Audit the whole repo for over-engineering, not just the diff. |
/ponytail-debt | Harvest the ponytail: shortcuts you’ve deferred into a ledger, so “later” doesn’t become “never”. |
/ponytail-help | Quick reference for the commands above. |
Commands need a skill-capable host (Claude Code, Codex, OpenCode, Gemini, pi). In Codex they’re skills, invoke with @ (@ponytail-review). The instruction-only adapters (Cursor, Windsurf, Cline, Copilot, Kiro, Antigravity) load the always-on ruleset without the commands.
Development
When changing the compact rule text, keep the agent copies aligned:
node scripts/check-rule-copies.js
npm test
The OpenClaw skill package (.openclaw/skills/) is generated from skills/; rerun node scripts/build-openclaw-skills.js after changing a skill, the test suite fails if it is stale.
The correctness benchmark spawns Python for email and CSV checks; python3 is tried before python. CSV checks need pandas installed locally.
FAQ
Does it need a config file?
No. An optional ~/.config/ponytail/config.json or PONYTAIL_DEFAULT_MODE env var can set the default level, but nothing is required.
What if I really need the 120-line cache class? You don’t. Insist anyway and he’ll build it. Slowly. Correctly. While looking at you.
Does it scale? The code you never wrote scales infinitely. Zero bugs, zero CVEs, 100% uptime since forever.
Why “ponytail”? You know exactly why.
License
MIT. The shortest license that works.
相似文章
@goan999999: Codex 5.6 装上这个 Skill,能少写 90% 废代码 很多人用 Codex,需求一丢进去,AI 就开始给你堆组件、装依赖、写一大堆根本用不到的代码。token 越烧越多,代码反而越难维护。 这个 GitHub 项目叫 pony…
这篇文章介绍了一个名为ponytail的GitHub项目,它可以作为Codex的插件,强制AI在编码前判断是否真的需要写代码,从而减少90%的无用代码,降低token消耗并提高代码质量。
DietrichGebert/ponytail
Ponytail 是一款开发者工具,可与AI代理集成,在保持安全性的同时显著减少代码输出、成本和执行时间,正如与 Claude Code 进行的基准测试所展示的那样。
@0xQiYan: 兄弟们,听我说。 Fable 5是最强代码模型,也是最贵的。 它多写一行,你多付一行钱。 Ponytail,把你的AI变成资深懒鬼。 写代码前先问自己: → 这玩意需要吗? → 代码库里有了吗? → 标准库能搞定吗? → 浏览器自己能做吗…
Fable 5 是目前最强的代码模型,免费开源,可减少 94% 代码量、降低 20% 账单并提升 27% 速度。搭配 Ponytail 工具引导开发者写出最精简的代码。
@apivixtls: 今天看到个 Codex5.5 的破限开源项目,思路还挺直接的。它就是通过 model_instructions_file 给 GPT-5.5 塞了一套无限制指令,让 Codex CLI 直接跑 [MODE: UNRESTRICTED] 模…
一个名为 Codex5.5 的开源项目通过修改 model_instructions_file 绕过 GPT-5.5 的安全限制,支持 SQL 注入测试等敏感操作,但存在封号风险,建议用小号尝试。
@Easycompany333: Open AI 曾官方点名的Codex 视频 值得收藏,不到 2 小时,把 Codex + GPT-5.5 这套组合讲得很实: - 技能怎么配。 - 插件怎么用。 - 自动化工作流怎么搭。 - 多任务怎么并行跑。 - 以及最关键的,怎么把…
推荐一个OpenAI官方点名的Codex视频教程,详细讲解如何配置技能、使用插件、搭建自动化工作流,将Codex变成持续工作的开发系统。