この記事でできること
- Ponytail はモデルではなく、「まだ書かない」ための判断階段。新規ファイルや依存より既存コードを優先する。
- Claude Code はマーケットプレイスで 2 回の
/plugin。Cursor はcursor-hooks.js install(rules と二重にしない)。 - OpenCode などは
AGENTS.mdまたはskills/ponytail/SKILL.mdをリポジトリに置く。 - 解法は怠けても、信頼境界の検証・データ損失防止・セキュリティ・アクセシビリティは削らない。
- 第三者テストでは変更行が減り既存ヘルパーを再利用しやすい一方、読み取りが増え小タスクのトークンが高くなることもある。
必要なのは賢いモデルではなく、リポジトリを読んでから手を動かすエージェント。
Claude Code・Cursor・OpenCode が「少し多め」に書く理由
キャッシュと言うと cache.py と設定を足すのは、既に memoize_rates() があるときの典型例。制約がないと既存実装に合わせるより能力を見せる方が楽。
過剰実装のコストはレビューと保守に出る。OpenCode と Claude Code の実コスト でも、ライセンス 0 円でも diff は膨らむ。Ponytail は変更の形—依存・抽象・再利用—を抑える。
Ponytail とは:階段(理解したあとで登る)
ponytail.dev のイメージは「長い髪のシニアが 50 行を 1 行にする」。触るコードを読んでから、新規ファイルや npm install の前に階段を上る。詳細は GitHub。
Claude Code:手順どおりインストール
INSTALL.md では2 つの別メッセージが必須:
/plugin marketplace add DietrichGebert/ponytail /plugin install ponytail@ponytail
/ponytail lite|full|ultra|off で切替。料金は Claude Code プラン のまま。
Cursor:Hooks か .cursor/rules か
cursor-hooks 手順:
git clone https://github.com/DietrichGebert/ponytail node ponytail/scripts/cursor-hooks.js install
.cursor/rules/ponytail.mdc があると Hooks は注入しない。どちらか一方。子 Agent・クラウド Agent は sessionStart が弱いので AGENTS.md をコミットする。
OpenCode:同じ階段を AGENTS.md で
プラグインがないエージェントは AGENTS.md のコピーがインストールそのもの。モデル自由な OpenCode では「先に rg で既存ヘルパーを探す」をプロンプトに明記。ファイル隔離 と併用。
lite / full / ultra の選び方
lite=文言・単一ファイル修正。full=日常開発の既定。ultra=横断リファクタのみ。小タスクで ultra は読み取りコストが逆転。
誤解と受け入れチェック
行数だけを見ない。新規依存・重複ヘルパー・レビュー時間を見る。PR では package.json の無説明な追加がないか確認。
| 阶 | 问题 | 动作 |
|---|---|---|
| 1 | 这事必须做吗? | 能删需求、改文案、用配置开关就别写代码。 |
| 2 | 仓库里已经有了吗? | 先搜函数、hook、util;复用比新建文件便宜。 |
| 3 | 标准库够吗? | 内置模块、平台 API 优先于新依赖。 |
| 4 | 已安装的包能搞定吗? | 别为一个小函数再 npm install。 |
| 5 | 能写成一行吗? | 在可读的前提下压到最小。 |
| 6 | 最后才写新代码 | 写最少、能过测试、标出刻意简化的上限。 |
| 工具 | 推荐安装 | 注意 |
|---|---|---|
| Claude Code | 两条 /plugin 命令装市场插件 | Hooks + 斜杠命令;子 Agent 可注入规则 |
| Cursor | cursor-hooks.js install | 会话级注入;子 Agent / Cloud Agent 有缺口 |
| OpenCode 等 | 复制 AGENTS.md 或装 Skill | 无官方插件时靠项目规则文件 |
FAQ
Cursor の minimize scope と競合する?
方向は同じ。Ponytail は探索と階段が厚い。文脈に 1 本にまとめる。
clone は必須?
Cursor Hooks は checkout パスが必要。Claude Code は不要。OpenCode は AGENTS.md だけでも可。
Summary
Claude Code はプラグイン、Cursor は Hooks または rules、OpenCode は AGENTS.md。Ponytail はモデル選定の代替ではなく、依存と新規ファイルの癖を抑える層。
寝ない Mac で長い Agent セッション
Ponytail は 1 回の diff を細くするが、リポジトリ探索とテストには安定したディスクとスリープしないシェルが要る。クラウド Mac mini は OpenCode / Claude Code のリモート作業向き。
PR checklist (ja)
Before merge, scan the agent diff the same way a senior would:
- Unexplained new entries in
package.json,go.mod, or lockfiles? - New files that duplicate an existing helper, hook, or util?
- Trust-boundary validation still present on external input?
- Error paths that prevent silent data loss?
- Security-sensitive code paths unchanged or tightened?
- Accessibility requirements for UI touched by the patch?
- Agent stated what it skipped (no new dep, reused module X)?
- Deliberate simplifications tagged with ceiling + upgrade path?
- Hooks vs
ponytail.mdc— only one active mechanism? - Subagent / cloud run covered by committed
AGENTS.md?
- lite: copy, CSS, one-file fixes.
- full: default feature work.
- ultra: cross-module refactors only.
- Do not stack Ponytail with three other “minimalism” user rules.
- MCP is fine; do not add adapter layers just to call a tool.
- Benchmark posters are directional; measure your repo.
- Reading the repo costs tokens; reuse savings show up in review time.
- OpenCode: explicit “search before install” in the task prompt.
- Claude Code: send marketplace commands in two separate messages.
- Cursor: keep the ponytail clone path; re-run install after moving it.
- Team repos: commit
AGENTS.mdso cloud agents inherit the ladder. - Spike with
/ponytail off; re-enable before merge. - Compare against ponytail.dev when upstream changes.
When in doubt, prefer reusing a tested helper over a shorter but duplicate implementation.