npx claudepluginhub psychquant/psychquant-claude-plugins --plugin lean-proverDefined in hooks/hooks.json
{
"PostToolUse": [
{
"hooks": [
{
"type": "command",
"command": "FILE_PATH=$(echo \"$CLAUDE_TOOL_INPUT\" | jq -r '.file_path // empty'); if [[ \"$FILE_PATH\" == *.lean ]] && [[ \"$FILE_PATH\" != *.lake/* ]]; then DIR=$(dirname \"$FILE_PATH\"); while [[ \"$DIR\" != \"/\" ]]; do if [[ -f \"$DIR/lakefile.toml\" ]]; then cd \"$DIR\" && BUILD=$(lake build 2>&1); SORRY=$(echo \"$BUILD\" | grep -c \"uses .sorry.\" || true); ERROR=$(echo \"$BUILD\" | grep -c \"error:\" || true); if [[ $ERROR -eq 0 ]]; then echo \"lake build ok — $SORRY sorry remaining\"; else echo \"lake build failed ($ERROR errors)\"; echo \"$BUILD\" | grep -A 2 'error:' | head -20; fi; break; fi; DIR=$(dirname \"$DIR\"); done; fi"
}
],
"matcher": "Edit"
},
{
"hooks": [
{
"type": "command",
"command": "FILE_PATH=$(echo \"$CLAUDE_TOOL_INPUT\" | jq -r '.file_path // empty'); if [[ \"$FILE_PATH\" == *.lean ]] && [[ \"$FILE_PATH\" != *.lake/* ]]; then DIR=$(dirname \"$FILE_PATH\"); while [[ \"$DIR\" != \"/\" ]]; do if [[ -f \"$DIR/lakefile.toml\" ]]; then cd \"$DIR\" && BUILD=$(lake build 2>&1); SORRY=$(echo \"$BUILD\" | grep -c \"uses .sorry.\" || true); ERROR=$(echo \"$BUILD\" | grep -c \"error:\" || true); if [[ $ERROR -eq 0 ]]; then echo \"lake build ok — $SORRY sorry remaining\"; else echo \"lake build failed ($ERROR errors)\"; echo \"$BUILD\" | grep -A 2 'error:' | head -20; fi; break; fi; DIR=$(dirname \"$DIR\"); done; fi"
}
],
"matcher": "Write"
}
]
}"Runs check-artifact.sh script after PostToolUse for Write|Edit tool calls to check generated files, performing file writes."