项目文件夹

文件
kazuki dbdf861e45 feat(hooks): implement v5 hook set (session-restore, confidence-gate, session-summary, reflexion, tab-title)
- session-restore.sh (SessionStart, command): emits TASK.md head, git
  branch/status/log, and probes mindbase on :18002/:18003 with 1s
  timeout; every probe degrades silently, always exits 0. Replaces
  session-init.sh (its git summary folded in; banner text dropped).
- confidence-gate (PreToolUse Write|Edit, prompt): enforces
  confidence-check skill criteria before non-trivial new
  implementations; trivial edits and test fixes exempt.
- session-summary (Stop, prompt): 2-3 bullet outcome summary, stored
  via mindbase_store when available.
- reflexion-trigger (Stop, prompt): applies pm-reflexion
  failure-reflexion when a session hit real errors.
- tab-title.sh: ported from airis-tab-title.sh, opt-in via
  SUPERCLAUDE_TAB_TITLE=1, silent no-op otherwise; wired to
  SessionStart/UserPromptSubmit/PreToolUse/PostToolUse/Notification/
  Stop to keep the idle/running/waiting/stop state machine working.
- statusline.sh: genericized statusline asset (not wired into
  hooks.json; users reference it from settings).

Hook schema verified against code.claude.com/docs/en/hooks:
type=command and type=prompt confirmed; timeout is in seconds.
2026-06-12 11:30:55 +09:00

103 行
3.1 KiB
JSON

{
"description": "SuperClaude v5 hooks: session-restore, confidence-gate, session-summary, reflexion-trigger, opt-in tab-title",
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/session-restore.sh",
"timeout": 10,
"statusMessage": "Restoring session context"
},
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/tab-title.sh",
"args": ["idle", "🏃", "✋", ""],
"timeout": 5
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/tab-title.sh",
"args": ["running", "🏃", "✋", ""],
"timeout": 5
}
]
}
],
"PreToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "prompt",
"prompt": "If this Write/Edit begins a non-trivial NEW implementation, the confidence-check skill criteria must already have been applied: no duplicate implementation exists, the change fits the architecture, official docs were verified, and the root cause is known. Trivial edits and test fixes are exempt. If the criteria were skipped, apply them before proceeding."
}
]
},
{
"matcher": "AskUserQuestion|ExitPlanMode",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/tab-title.sh",
"args": ["waiting", "🏃", "✋", ""],
"timeout": 5
}
]
}
],
"PostToolUse": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/tab-title.sh",
"args": ["running", "🏃", "✋", ""],
"timeout": 5
}
]
}
],
"Notification": [
{
"matcher": "permission_prompt|elicitation_dialog",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/tab-title.sh",
"args": ["waiting", "🏃", "✋", ""],
"timeout": 5
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "prompt",
"prompt": "If this session did substantive work, summarize the outcome and remaining work in 2-3 bullets. If mindbase MCP tools are available, store the summary via mindbase_store; if not, skip storage silently. If nothing substantive happened, do nothing."
},
{
"type": "prompt",
"prompt": "If this session hit a real error or a wrong-direction attempt, apply the pm-reflexion skill's failure-reflexion before finishing. Otherwise do nothing."
},
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/tab-title.sh",
"args": ["stop", "🏃", "✋", ""],
"timeout": 5
}
]
}
]
}
}