hooks.json 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. {
  2. "description": "Security guidance plugin — pattern-based warnings on edits, git-diff-based LLM review on stop",
  3. "hooks": {
  4. "SessionStart": [
  5. {
  6. "hooks": [
  7. {
  8. "type": "command",
  9. "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/sg-python.sh\" \"${CLAUDE_PLUGIN_ROOT}/hooks/ensure_agent_sdk.py\"",
  10. "timeout": 180
  11. }
  12. ]
  13. }
  14. ],
  15. "UserPromptSubmit": [
  16. {
  17. "hooks": [
  18. {
  19. "type": "command",
  20. "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/sg-python.sh\" \"${CLAUDE_PLUGIN_ROOT}/hooks/security_reminder_hook.py\""
  21. }
  22. ]
  23. }
  24. ],
  25. "PostToolUse": [
  26. {
  27. "hooks": [
  28. {
  29. "type": "command",
  30. "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/sg-python.sh\" \"${CLAUDE_PLUGIN_ROOT}/hooks/security_reminder_hook.py\""
  31. }
  32. ],
  33. "matcher": "Edit|Write|MultiEdit|NotebookEdit"
  34. },
  35. {
  36. "hooks": [
  37. {
  38. "type": "command",
  39. "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/sg-python.sh\" \"${CLAUDE_PLUGIN_ROOT}/hooks/security_reminder_hook.py\"",
  40. "if": "Bash(git commit:*)",
  41. "asyncRewake": true,
  42. "rewakeMessage": "Background security review of commit — address or acknowledge the findings below, then continue with the user's original request or continue waiting for their reply:",
  43. "rewakeSummary": "Commit security review found issues"
  44. },
  45. {
  46. "type": "command",
  47. "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/sg-python.sh\" \"${CLAUDE_PLUGIN_ROOT}/hooks/security_reminder_hook.py\"",
  48. "if": "Bash(git push:*)",
  49. "asyncRewake": true,
  50. "rewakeMessage": "Background security review of pushed commits not yet reviewed — address or acknowledge the findings below, then continue with the user's original request or continue waiting for their reply:",
  51. "rewakeSummary": "Push security review found issues"
  52. }
  53. ],
  54. "matcher": "Bash"
  55. }
  56. ],
  57. "Stop": [
  58. {
  59. "hooks": [
  60. {
  61. "type": "command",
  62. "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/sg-python.sh\" \"${CLAUDE_PLUGIN_ROOT}/hooks/security_reminder_hook.py\"",
  63. "asyncRewake": true,
  64. "rewakeMessage": "Background security review feedback — address or acknowledge the findings below, then continue with the user's original request or continue waiting for their reply. This is supplementary, not a replacement for your previous response:",
  65. "rewakeSummary": "Background security review found issues"
  66. }
  67. ]
  68. }
  69. ]
  70. }
  71. }