hooks.json 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 committed or pushed changes — address or acknowledge the findings below, then continue with the user's original request or continue waiting for their reply:",
  43. "rewakeSummary": "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 committed or pushed changes — address or acknowledge the findings below, then continue with the user's original request or continue waiting for their reply:",
  51. "rewakeSummary": "Security review found issues"
  52. },
  53. {
  54. "type": "command",
  55. "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/sg-python.sh\" \"${CLAUDE_PLUGIN_ROOT}/hooks/security_reminder_hook.py\"",
  56. "if": "Bash(gt *)",
  57. "asyncRewake": true,
  58. "rewakeMessage": "Background security review of committed or pushed changes — address or acknowledge the findings below, then continue with the user's original request or continue waiting for their reply:",
  59. "rewakeSummary": "Security review found issues"
  60. }
  61. ],
  62. "matcher": "Bash"
  63. }
  64. ],
  65. "Stop": [
  66. {
  67. "hooks": [
  68. {
  69. "type": "command",
  70. "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/sg-python.sh\" \"${CLAUDE_PLUGIN_ROOT}/hooks/security_reminder_hook.py\"",
  71. "asyncRewake": true,
  72. "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:",
  73. "rewakeSummary": "Background security review found issues"
  74. }
  75. ]
  76. }
  77. ]
  78. }
  79. }