今天上午扫 GitHub Trending,看到一个叫 ponytail 的项目挂在那,单日又涨了快两千颗星,总量 17 万。它的 README 第一句话是这样的:让你的 AI agent 像房间里最懒的资深开发一样思考——你从没写过的代码,就是最好的代码。
17 万星是什么概念?react 当年也就这个量级。而 ponytail 的本体说出来你可能不信:一个 3.2KB 的 Markdown 文件。没有任何运行时,什么都不执行,MIT 协议,装进 Claude Code 或者 Cursor 之后,它就是塞给模型的几百个 token 的指令。
它火不是没有理由的。README 里摆了一组相当硬的 benchmark(数字都挂在 README 和项目主页上,可以去核):同一个 agent 分三组各跑一遍——不带规则、挂上一版 v4.13.0、挂最新的 Ponytail 5——39 个任务每组 5 次,585 个真实的 Claude Code 会话,结果代码量降 53%,成本降 26%,耗时降 41%。而且不是无脑砍——6 个安全任务的 30 次运行全部通过,带测试的风险逻辑占比 98%(不带规则只有 68%)。 我看到这组数据的时候其实是信了一半的。疑心在脚注里:这 585 个会话,全部跑在 Opus 5.5 上。Claude 家最贵的模型。 而我平时干活用的是 deepseek-flash 这种几分钱一次的便宜货。问题就变成:这套规则的效果,是 Opus 专属,还是规则本身的功劳?换到便宜模型上还灵不灵? 官方没做这个实验,我打算自己做。预算 2 毛钱。
这条规则到底让模型干什么
先把规则本体说清楚,不然后面的实验看不懂。 ponytail 的核心是一架"决策阶梯",模型写任何代码之前要先往上爬,停在第一级能用的台阶上: 这段要求其实很朴素——先问这功能需不需要存在(YAGNI),再看看代码库里是不是已经有了,然后是标准库、平台原生特性、已装依赖,最后才是"能不能写成一行"。全部失败,才写"能跑通的最小代码"。
光看这个会觉得它就是逼模型偷工减料。但规则里还有一条"never cut"清单:信任边界的输入校验、防止数据丢失的错误处理、安全、无障碍、用户点名要的东西——这些永远不许砍。另外每段非平凡逻辑必须留一个小测试,每次回复的结尾必须交代"我跳过了什么、有什么风险"。
它的靶子其实很明确:不是"想要更少代码"的人,是被 AI 的过度工程折磨过的人。你让它加个缓存,它给你一个 CacheManager 类加一套配置项;你让它写个日期解析,它给你引入一个 dateparser 依赖。规则要治的就是这个病。
三个任务,两组,各跑一遍
实验设计很简单:3 个任务,都挑了"过度工程的经典诱惑"场景;每个任务用同一个模型跑两遍,一遍不带规则(bare 组),一遍把 ponytail 的规则全文塞进系统提示(pony 组)。温度 0.7,其他参数一致。 三个任务分别是:
- 给一个已有的行情脚本加 TTL 缓存——上下文里故意留了一把现成的锁,看它会不会复用;
- 解析同事在工单里随手写的中文日期("3天后"、"下周二");
- 把用户上传的 CSV 导进 SQLite——这是安全任务,专测"never cut"是不是真的。
每个任务只跑一次。官方每组跑 5 次取中位数,我这种样本量说好听点叫冒烟测试,说难听点就是买个彩票。但 2 毛钱的预算摆在这,能验证方向就够了。
省下来的行数,换成了自检
第一个任务是加缓存。这题两边的安全下限都很高,bare 组写出了教科书式的双检锁:先查缓存,没命中就拿 symbol 锁,拿到后再查一次,防止等锁期间别人已经拉完了。40 行,没毛病。
pony 组 41 行。行数居然没降,我第一反应是规则没生效。逐行看完才发现不对:
bare 组管锁用的是 8 行的辅助函数,配上注释;pony 组一行 setdefault 干完了同一件事,然后把省下来的篇幅花在了一个 __main__ 自检上——起一个 8 线程的线程池并发拉同一个 symbol,断言上游只被打了一次,再断言第二次调用走缓存:
with concurrent.futures.ThreadPoolExecutor(8) as pool:
assert list(pool.map(get_price, ["BTC"] * 8)) == [1.5] * 8
assert calls == ["BTC"], calls # 8 个并发只打一次接口
这是规则里"非平凡逻辑必须留一个小测试"的直接执行。bare 组三个任务下来,测试数量是零。
回复结尾,pony 组还按规则交代了跳过清单:不做缓存淘汰、不做负缓存、不跨进程共享,并提醒 requests.Session 的线程安全在改动前就存疑,"本次没有改变"。这些交代 bare 组一句都没有。
最意外的是它把决定权还给我
第二个任务,中文日期解析,是三道题里分差最大的一道:bare 组 46 行,pony 组 20 行。
行数砍半我预料到了,没预料到的是两边对同一个边角问题的处理方式。工单里同事写"这周五",如果今天是周日怎么办?bare 组自作主张做了个决定——写进 docstring:"如果本周五已经过去,则顺延到下一个周五,避免生成过去日期"。听起来贴心,但它替我选了业务语义,而且这个决定藏在一堆代码中间,评审的时候很容易漏过去。
pony 组按字面意思返回自然周的周五,然后留了一行规则规定的 shortcut: 注释:
# shortcut: 「这周五」按自然周算,可能落在今天之前;要自动顺延到下周再说
结尾补了一句"要不要顺延你定"。 同一道题,bare 组替用户拍板,pony 组把拍板权还回来,只留下标记。写业务代码的人应该懂这差多少——被 AI 静默决定过的语义,最后都是靠线上事故回顾才发现的。
141 行周到和 49 行够用
第三个任务是全场戏。用户上传的 CSV 导 SQLite,文件是外部用户传的,"别信它"。
bare 组这次跑了 92 秒,思考 token 吃了 1.7 万,最后交出 141 行。我得先说句公道话:它的安全下限没问题。参数化 SQL、Decimal 拒收 NaN 和负数、表头严格校验、文件大小限制、SAVEPOINT 整批回滚,该有的全有。
多出来的 92 行,全是"没人要求的周到":一个 35 行的 _LimitedTextReader 类用来限流读取,一个 20 行的 _to_text_stream 探测传进来的是文本流还是二进制流,SAVEPOINT 的申请、回滚、释放手工管理了三处 try/except,插入还按 500 行分了批。
这些设计单独看每一个都说得通,合起来就是那种"拿到手先叹口气"的代码。万行以内的导入,with conn 一行事务加 executemany 一次插完,行为完全等价。
pony 组交了 49 行,其中还包括自检——6 个坏样本(缺表头、非数字价格、负数、NaN、三列、缺列)逐个断言抛 ValueError,最后断言失败导入不在库里留半截数据。校验清单跟 bare 组对了一遍:参数化、Decimal、表头、上限、事务,一样没少。安全任务上,"never cut"清单是真的在工作。 砍掉的东西,回复末尾也交代了:"不去重、不支持列顺序调换、全量读进内存,1 万行上限内够用,超过再改流式加分批。"这句话信息量比 92 行周到代码大——它告诉我边界在哪,超出边界该干什么,而我不用读代码猜。
汇总
token 降幅比行数更大。bare 组的思考 token 占比高得离谱——CSV 那次 1.9 万输出里 1.7 万是 reasoning。便宜推理模型的问题是它想太多:探测流类型、设计限流类、分批插入,每个"周到"都是思考成本堆出来的。规则把"没人要求的周到"禁了,思考直接瘦身,省的钱比省的行数多。
对了,账单是 7 次调用算出来的,不是 6 次——CSV 那题的 bare 组第一遍把思考预算撑到顶格,正文一个字没吐出来,我把输出上限调大重跑了一遍。这个插曲挺说明问题:不挂规则的那组,连"想太多"都能把自己撑爆。两次实验加起来,花了不到 2 毛钱。
留下来的理由,和一个保留意见
样本量先自首:3 个任务、每组 1 次、1 个模型,跟官方 585 会话没得比,数字只看方向不看精度。deepseek-flash 的结果也不能直接外推到 GPT 系或者 Gemini,这是这套 prompt 类工具的天然局限——效果跟着模型走。 但方向我已经信了。3 个任务里,pony 组的行为变化是全一致的:自作主张消失,自检出现,跳过清单出现,安全校验没打折。它省的不是代码,是替用户做的决定。
用法上我不会绕弯子:新项目、原型期、自己玩的小工具,直接挂 full 档,尤其是让便宜模型干活的场景——它治"想太多"有奇效。接手别人的老项目、团队有严格规范,用 lite 档,它只会在结尾提醒一句"有个更省的写法",不动手。ultra 档会反过来质疑你的需求本身,纯属自己找刺激,别开。
安装是两行命令,Claude Code 里 /plugin marketplace add DietrichGebert/ponytail 然后 /plugin install ponytail@ponytail;其他 agent 走 npx skills add DietrichGebert/ponytail@ponytail。不想要了删掉一个目录就行,毕竟它只是个文本文件。
这条规则我已经塞进自己的项目了。就 3KB,不好用一句话就删,先跑两周再看。反正被 AI 的"周到"折磨过的人,应该不止我一个。
本文由 AI图鉴自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
Sweeping GitHub Trending this morning saw a project called Ponytaiil hanging there, rising by 2,000 stars a day, totalling 170,000. And the first sentence of its README is this: Let your AI angent think like the most lazy senior development in the room -- the best code you've ever written.
What is the concept of 170,000 stars? That's the size of the year. And the body of Ponytail says you may not believe: a 3.2KB Markdown file. No running time, no doing anything, MIT protocol, post-Claude Code or Cursor, it's a command for hundreds of tokens to the model.
It doesn't have no reason to fire. README has a very hard set of benchmarks (the numbers are posted on README and the project home page, which can be logged): the same angent runs in three groups - without rules, with the previous version v.43.0, with the latest Ponytail 5-39 missions five times each, 585 real Claude Code sessions, resulting in a 53% reduction in code volume, a 26% reduction in cost and a 41% reduction in time. And it's not brain-cut - 30 operations with six security missions were fully passed, with a risk logic of 98 per cent with tests (only 68 per cent without rules). When I saw this set, I actually believed in half. Doubt in footnote: These 585 sessions, all on Opus 5.5. Claude's most expensive model. And I usually work with deepseek-flash, a little cheap. The question then becomes: the effect of the rule is Opus exclusive, or the credit of the rule itself? How's that for a cheap model? The official didn't do the experiment. I was going to do it myself. Budget 2 gross.
What exactly does this rule make a model?
Let's get the rules straight, or we can't understand the rest of the experiment. At the heart of Ponytaiil is a decision-making ladder, which must climb up before any code is written, and stop on the steps that can be used at the first level: this is a simple request -- to ask whether this function needs to exist, to see if it is already in the vault, and then to see if it is in the standard library, the original characteristics of the platform, the built-up dependence, and finally, "can we write a line?" All failed to write "the smallest code that runs through."
Just looking at this would make it look like it's trying to make a model cut. But there's also a list of "never cut" in the rules: trusting the border with input verification, error-processing to prevent data loss, security, accessibility, user-named things — never cut. And every extraordinary logic must leave behind a small test, and each response must end with "What have I jumped and what are the risks?"
It's a clear target: not someone who wants less code, but someone who's been tortured by Al's overwork. You add it to a cache, it gives you a CacheManager class and a set of configurations; you make it write a date resolution, it introduces you a dateparser dependency. The rule is to cure this disease.
Three missions, two teams, one run each.
The experimental design is simple: three missions, all of which have chosen the "classic temptation of overwork" scene; each mission runs twice with the same model, once without rules (bare group), and once with the full text of the Ponytail rule inserted into the system hint (pony group). Temperature 0.7, other parameters are consistent. The three tasks are:
- A live lock was deliberately left in an existing script with TTL cache-context to see if it would be reused;
- The date written by a colleague in Chinese ( "three days later" and "second week");
- Bring the user's uploaded CSV into SQLite -- this is a security mission, and "never cut" is not real.
Each mission only runs once. The official group ran five times to take the median, and my sample measure said it's better to call it smoke test, or to buy a lottery ticket. But 2 of the gross budget is here, which is enough to verify direction.
Saved the number of lines.
The first task was to add cache. The security floor on both sides of this question is very high, and the bare group wrote a double-check lock in textbook form: check cache first, take the symbol lock in case of a hit, get it and check again to prevent others from pulling it out. Okay, fine.
Pony group 41. The number of lines didn't drop. My first reaction was that the rules didn't work. It's a line-by-line thing to find out.
The bare tube locks are an 8-line auxiliary function, accompanied by a comment; the pointy group completes the same thing, and then spends the saved space on a main self-check - starting an 8-wire line pool and pulling the same symbol, asserting that only once was struck upstream, and again that the second call to cache:
with concurrent.futures.ThreadPoolExecutor(8) as pool:
assert list(pool.map(get_price, ["BTC"] * 8)) == [1.5] * 8
Assert calls = ["BTC"], calls #8 simultaneous only once
This is the direct execution of the rule that "unusual logic must leave a small test". The bare group of three missions down and the number of tests is zero.
At the end of the reply, the pony group also gave the skip list in accordance with the rules: no cache phase-out, no negative cache, no process sharing, and reminded requests.SESSION that the thread security was in doubt before the change, "this time no change." None of these accounts were given to the bare group.
The most unexpected thing is that he gave me my decision back.
The second task, date resolution in Chinese, is the one with the greatest difference between the three questions: bare group 46 rows, pony group 20.
Half the lines I expected, but not both sides of the same corner. What if it's Sunday? The bare group made a decision on its own behalf — by writing: "If this Friday is over, postpone it to the next Friday, so as to avoid the generation of past dates." It sounds sweet, but it chose business syntax for me, and this decision was hidden in the middle of a bunch of codes that could easily be missed during the evaluation.
Pony group returns literally Friday of natural week and leaves a line of rules shortcut: Note:
# Shortcut: "Friday" is natural week, probably before today; it's automatically postponed until next week
At the end of the sentence, "Do you want to defer?" On the same question, the bare team boarded the users, and the pony team returned the board rights, leaving only a mark. People who write business codes should know how much less -- the semantics that AI has decided to do in silence, and finally they find out by online accident reviews.
141 good and 49 good enough.
The third task is the whole scene. The user uploads the CSV guide SQLite, the file is sent by an outside user, "Don't believe it."
The bare group ran for 92 seconds, thinking token ate 17,000 and finally handed over 141 lines. I have to be fair: its safety threshold is fine. Parametric SQL, Decimal Refusal of NAN and Negative Numbers, Strict Header Validation, Document Size Limit, SAVEPOINT Round-up, all of them.
The extra 92 lines, all "no-one-requested": a 35-line LimitedTextReader class is used for rate limit reading, a 20-line to text stream detects text flows or binary flows coming in, SAVEPOINT applications, rollbacks, release manual management of three try/excepts, and inserts a 500-line split.
It makes sense to see each and every one of them alone, and it's the kind of code that says, "Get your hands out first." Imports within a million lines, with a line line line plus executemany plugged in at a time, with a full equivalent.
Pony joined 49 rows, which also included self-inspection - 6 bad sample (missing tableheads, non-digital prices, negative numbers, NAN, three columns, missing columns) tossing ValueError, concluding that the failed import did not leave half of the data in the library. The checklist was compared to the bare group: parameterization, Decimal, watch, cap, transaction. On a security mission, the "never cut" list is really working. The cut-off thing, and the end of the answer, says, "No weight, no column change, full reading memory, enough within the 10,000 line limit, more than re-routed, more." That's a lot of information than 92 lines to code -- It tells me where the border is, what to do beyond it, and I don't have to read code.
Summary
Token has a larger decrease than the number of lines. The bare group's thinking token-- the CSV-- 17,000 out of 19,000 output is resoning. The problem with the cheap reasoning model is that it's thinking too much: the type of detection stream, the design of the rate limit class, the insertion in batches, and every "weekly" is thinking about the cost. The rules keep "no one asks for it" off, thinking straight down, saving more than the provincial line.
By the way, the bill came out seven times, not six times -- the bare group on the CSV went up to the top for the first time, didn't spit a word in the text, and I turned the output ceiling again. This episode is a good one: the group that doesn't have rules, even "think too much" can blow itself. Two experiments combined cost less than two cents.
Reason for staying, and a reservation
sample Quantities turn themselves in: 3 missions, 1 model per group, 1 model, no comparison with the official 585 sessions, with numbers looking at direction without precision. The result of deepseek-flash cannot be directly extrapolated to the GPT system or Gemini, which is the natural limit of this prompt-type tool -- the effect follows the model. But I believe in the direction. In all three missions, the behaviour of the Pony group is uniform: self-advocacy disappears, self-censorship occurs, the list skips and the security check is not compromised. It saves not code, but decisions for users.
I don't know how to bend around: new projects, prototypes, little tools to play on my own, just full-time, especially the scene where cheap models work -- it works "too much." Take over someone else's old project, the team has strict rules, it's in the lite file, and it's only gonna end with a reminder, "There's a more economical way of writing," and don't do it. The ultra file, in turn, questions your needs per se. It's just a little stimuli.
The installation is a two-line command, Claude Code / pugin marketplace add dietrichGebert/ponytail and then /plugin install penytail@penytail; others go npx skills add dietrichGebert/penytail@penytail. If you don't want to delete a directory, it's just a text file.
I've put this rule into my own project. Just 3KB, it's hard to delete it in one sentence and run for two weeks. I'm not the only one who's been tortured by the AI.
Auto-fetched and translated by AI Atlas. All rights belong to the original author.