hooks.json 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. "type": "command",
  55. "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/sg-python.sh\" \"${CLAUDE_PLUGIN_ROOT}/hooks/security_reminder_hook.py\"",
  56. "if": "Bash(gt create:*)",
  57. "asyncRewake": true,
  58. "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:",
  59. "rewakeSummary": "Commit security review found issues"
  60. },
  61. {
  62. "type": "command",
  63. "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/sg-python.sh\" \"${CLAUDE_PLUGIN_ROOT}/hooks/security_reminder_hook.py\"",
  64. "if": "Bash(gt modify:*)",
  65. "asyncRewake": true,
  66. "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:",
  67. "rewakeSummary": "Commit security review found issues"
  68. },
  69. {
  70. "type": "command",
  71. "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/sg-python.sh\" \"${CLAUDE_PLUGIN_ROOT}/hooks/security_reminder_hook.py\"",
  72. "if": "Bash(gt submit:*)",
  73. "asyncRewake": true,
  74. "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:",
  75. "rewakeSummary": "Push security review found issues"
  76. }
  77. ],
  78. "matcher": "Bash"
  79. }
  80. ],
  81. "Stop": [
  82. {
  83. "hooks": [
  84. {
  85. "type": "command",
  86. "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/sg-python.sh\" \"${CLAUDE_PLUGIN_ROOT}/hooks/security_reminder_hook.py\"",
  87. "asyncRewake": true,
  88. "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:",
  89. "rewakeSummary": "Background security review found issues"
  90. }
  91. ]
  92. }
  93. ]
  94. }
  95. }