限定

Ponytail チュートリアル:Claude Code・Cursor・OpenCode で過剰実装を抑える

AI コーディング Ponytail · Agent ルール
2026-10-24 約10分

Ponytail は決断の階段。リポジトリを読んでから npm install する。

Claude Code → Cursor → OpenCode の手順と Hooks と rules の使い分け。

この記事でできること

  1. Ponytail はモデルではなく、「まだ書かない」ための判断階段。新規ファイルや依存より既存コードを優先する。
  2. Claude Code はマーケットプレイスで 2 回の /plugin。Cursor は cursor-hooks.js install(rules と二重にしない)。
  3. OpenCode などは AGENTS.md または skills/ponytail/SKILL.md をリポジトリに置く。
  4. 解法は怠けても、信頼境界の検証・データ損失防止・セキュリティ・アクセシビリティは削らない。
  5. 第三者テストでは変更行が減り既存ヘルパーを再利用しやすい一方、読み取りが増え小タスクのトークンが高くなることもある。
必要なのは賢いモデルではなく、リポジトリを読んでから手を動かすエージェント。
Ponytail ルールと冗長な AI パッチを比べる開発者
目的は新規ファイルとパッケージを減らすこと。要件理解を飛ばすことではない。

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 つの別メッセージが必須:

Claude Code
/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 可注入规则
Cursorcursor-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 のリモート作業向き。

Compare · Plans · Start

PR checklist (ja)

Before merge, scan the agent diff the same way a senior would:

  1. Unexplained new entries in package.json, go.mod, or lockfiles?
  2. New files that duplicate an existing helper, hook, or util?
  3. Trust-boundary validation still present on external input?
  4. Error paths that prevent silent data loss?
  5. Security-sensitive code paths unchanged or tightened?
  6. Accessibility requirements for UI touched by the patch?
  7. Agent stated what it skipped (no new dep, reused module X)?
  8. Deliberate simplifications tagged with ceiling + upgrade path?
  9. Hooks vs ponytail.mdc — only one active mechanism?
  10. 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.md so 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.