Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/mh4gf/claude-code/improvegit clone --depth 1 https://github.com/MH4GF/claude-codeWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00033 | $0.01760 |
| Opus 5 | $0.00016 | $0.00880 |
| Sonnet 5 | $0.00007 | $0.00352 |
| Haiku 4.5 | $0.00003 | $0.00176 |
Grade B, and why
improve scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
- **グローバル** (`~/.claude/settings.json`, `~/.claude/CLAUDE.md`): cwds のユニークなリポジトリルートが 3 以上 or 非リポジトリパス (/tmp 等) How it starts
The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.
ref: https://martinfowler.com/articles/harness-engineering.html
Step 1: データ取得
bash "${CLAUDE_PLUGIN_ROOT}/scripts/aggregate-hook-logs.sh" --since ${ARGUMENTS:-14} --format json
Step 2: スキップ判定
以下は改善不要。件数のみカウントして先頭で報告:
ask_flowがuser_allowed / user_deniedのみで、current_settings.ask_bash_prefixesにマッチ → 意図的 askpermission_modes == ["plan"]のみ → plan mode 仕様count < 3→ ノイズ(ただし危険パターンや error は低頻度でも拾う)
Step 3: 根本原因の分析
IMPORTANT: シグナルから直接アクションに飛ばない。まず「なぜこのパターンが発生しているか」を分析する。
各グループについて、以下を問う:
- なぜ
user_allowedが多いのか? — 本当に allow すべきか、それともそもそも Claude がそのコマンドを使う必要がないのでは?代替ツール(Read, Grep 等)で済むなら CLAUDE.md でガイドする方が正しい - なぜ
deniedが繰り返されるのか? — CLAUDE.md にルールがないのか、あるのに守れていないのか。後者なら表現を変える必要がある - なぜ複雑な one-liner が生まれるのか? — 既存のツールやスキルで代替できないか。スクリプト抽出は最終手段
- なぜ危険コマンドが通過しているのか? — permission mode が bypassPermissions だったのか、prefix マッチの抜け穴か
各グループについて根本原因を1行で要約してから Step 4 の分類に進む。
Step 4: 分類
各グループを以下のカテゴリに分類する(複数該当可 — 例: deny 追加 + CLAUDE.md ルール追加のように、センサーとガイドの二重防御が適切な場合がある)。
IMPORTANT: プロジェクト対応は案内のみ。Claude 自身は cd しない。
(1) フィードフォワード改善 — ガイドの追加・修正
Claude の行動を事前に操舵するガイドを改善する。
CLAUDE.md ルール追加:
- シグナル: 同一 cmd_prefix で
auto_deniedまたはuser_deniedが繰り返される → Claude が禁止行動を学習できていない - 例:
git add -Adenied ×5 → 「ファイルを個別に add」/cat頻発 → 「Read ツールを使え」
(2) フィードバック改善 — 権限・センサーの調整
権限ルールと hook バリデータを調整する。
allow 追加 (摩擦削減):
- シグナル:
user_allowedが多い +current_settings.allow_bash_prefixesに該当なし - pattern が近い既存 allow があれば拡張を提案
スクリプト抽出 → allow (摩擦削減):
- シグナル:
example_commandsに 200+ char の one-liner や複合シェル構文 (&&,|,for,$(...)) でuser_allowedが繰り返される - →
.claude/scripts/<name>.shに抽出しBash(bash ~/.claude/scripts/<name>.sh*)で allow
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 118 lines · 33 tokens per session scan B 12206f347bed
improve is a command published in the GitHub repository MH4GF/claude-code (2 stars, last pushed 2d ago), licensed MIT. It adds 33 tokens to every session and 1,760 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.
implement
Execute the implementation plan by processing and executing all tasks defined in tasks.md.