Cc Pre Tool Use Hook Judge — Development skill for Claude Code
Claude CodeのPreToolUseフック用のバリデーター・判定システム.
How to install Cc Pre Tool Use Hook Judge
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open syou6162/cc-pre-tool-use-hook-judge and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Cc Pre Tool Use Hook Judge does
Claude CodeのPreToolUseフック用のバリデーター・判定システム。Claude Agent SDKを使用して、ツール実行前に安全性を判断し、適切な許可決定を返します。
Alternatives in Development
- Pre Mortem — Run pre-mortem risk analysis on PRDs and launch plans 7.8k ★
- Nonstop — Autonomous work mode for Claude Code 263 ★
- Extraction Judge.Prompt — Extraction Judge — Fact Durability Rubric 189 ★
README
cc-pre-tool-use-hook-judge
Claude CodeのPreToolUseフック用のバリデーター・判定システム。Claude Agent SDKを使用して、ツール実行前に安全性を判断し、適切な許可決定を返します。
概要
このツールは、Claude Codeの[PreToolUseフック](https://docs.claude.com/en/docs/claude-code/hooks)として動作し、以下の機能を提供します:
- ツール実行前の安全性チェック
- Claude Agent SDKを使った高度な判断ロジック
- JSON Schemaによる入出力の厳密な検証
- リトライ機能付きのエラーハンドリング
- デフォルトでdenyの安全優先設計
特徴
- 型安全: mypy strict モードでの完全な型チェック
- スキーマ検証: JSON Schemaによる入出力の厳密な検証
- カスタム例外: 型ベースのエラー分類で保守性向上
- セキュリティ優先: デフォルトで拒否、明示的な許可のみ通す設計
- リトライロジック: スキーマ検証失敗時の自動リトライ(SDK内部で管理)
使い方
Claude Codeのデフォルトフックとして使う
GitHubリポジトリから直接実行する最もシンプルな方法です:
BigQueryバリデータ
# .claude/hooks.json
{
"hooks": [
{
"eventName": "PreToolUse",
"command": "uvx --from git+https://github.com/syou6162/cc-pre-tool-use-hook-judge cc-pre-tool-use-hook-judge --builtin validate_bq_query"
}
]
}
この設定では、全てのツール実行前にBigQueryバリデータが動作します。
**動作例:**
安全なクエリ(ALLOW):
bq query "SELECT * FROM dataset.table LIMIT 100"
# → permissionDecision: "allow"
# → 理由: 純粋なSELECT、読み取り専用操作
危険なクエリ(DENY):
bq query "DROP TABLE dataset.old_table"
# → permissionDecision: "deny"
# → 理由: DDL操作でデータを削除
bq query "INSERT INTO dataset.table VALUES (1, 'test')"
# → permissionDecision: "deny"
# → 理由: DML操作でデータを変更
Codex MCPバリデータ
# .claude/hooks.json
{
"hooks": [
{
"eventName": "PreToolUse",
"command": "uvx --from git+https://github.com/syou6162/cc-pre-tool-use-hook-judge cc-pre-tool-use-hook-judge --builtin validate_codex_mcp"
}
]
}
この設定では、MCP経由でCodexツールを実行する際の安全性をチェックします。
**動作例:**
安全な設定(ALLOW):
# sandbox=read-only(または未指定)、cwdが未指定
mcp__codex__codex(prompt="テストを実行して")
# → permissionDecision: "allow"
# → 理由: 読み取り専用モードで安全
# approval-policy=untrusted
mcp__codex__codex(prompt="ファイルを作成して", sandbox="read-only", approval_policy="untrusted")
# → permissionDecision: "allow"
# → 理由: 承認ポリシーが適切
危険な設定(DENY):
# sandbox=danger-full-access
mcp__codex_
Related Skills
The Docket
the-docket is a Claude Code plugin that keeps a repo's decisions from being undone. A hook prints what governs
A B Copy
Use when you want a marketing-copy A/B — spawns two writer sibling sessions via CCC that draft the SAME messag
Quant Router Judge
This just a example for prompt. We use quantclaw.json to build prompt inside code.
Bench Run All
Agent-driven bench round for one size — drive the 2 variant folders + judge + capture, hands-off
Fable Eval
Run the fable-mode eval suite (probes → pairwise judge → report). Costs tokens — runs headless claude many tim
Skill Evaluations Bottom 10
Bottom 10 Skills: Skill-Judge Evaluations with TDD Improvements
Related Agents
Sb Judge
Blind judge for strictlybetter. MUST BE USED by /strictlybetter:run for every promoted experiment before confi
Harness UI Reviewer
UI reviewer — two modes: pre-build, judge whether DESIGN.md is a sound contract; post-build, adversarially aud
Civitai Reuse Review
Reviews a feature segment in the main Civitai Next.js app (src/) for code that was rebuilt when it already exi