hooks.json 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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 -C * commit *)",
  49. "asyncRewake": true,
  50. "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:",
  51. "rewakeSummary": "Commit 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(git push:*)",
  57. "asyncRewake": true,
  58. "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:",
  59. "rewakeSummary": "Push 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(git -C * push*)",
  65. "asyncRewake": true,
  66. "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:",
  67. "rewakeSummary": "Push 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 create:*)",
  73. "asyncRewake": true,
  74. "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:",
  75. "rewakeSummary": "Commit security review found issues"
  76. },
  77. {
  78. "type": "command",
  79. "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/sg-python.sh\" \"${CLAUDE_PLUGIN_ROOT}/hooks/security_reminder_hook.py\"",
  80. "if": "Bash(gt modify:*)",
  81. "asyncRewake": true,
  82. "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:",
  83. "rewakeSummary": "Commit security review found issues"
  84. },
  85. {
  86. "type": "command",
  87. "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/sg-python.sh\" \"${CLAUDE_PLUGIN_ROOT}/hooks/security_reminder_hook.py\"",
  88. "if": "Bash(gt submit:*)",
  89. "asyncRewake": true,
  90. "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:",
  91. "rewakeSummary": "Push security review found issues"
  92. }
  93. ],
  94. "matcher": "Bash"
  95. }
  96. ],
  97. "Stop": [
  98. {
  99. "hooks": [
  100. {
  101. "type": "command",
  102. "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/sg-python.sh\" \"${CLAUDE_PLUGIN_ROOT}/hooks/security_reminder_hook.py\"",
  103. "asyncRewake": true,
  104. "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:",
  105. "rewakeSummary": "Background security review found issues"
  106. }
  107. ]
  108. }
  109. ],
  110. "SubagentStop": [
  111. {
  112. "hooks": [
  113. {
  114. "type": "command",
  115. "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/sg-python.sh\" \"${CLAUDE_PLUGIN_ROOT}/hooks/security_reminder_hook.py\"",
  116. "asyncRewake": true,
  117. "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:",
  118. "rewakeSummary": "Background security review found issues"
  119. }
  120. ]
  121. }
  122. ]
  123. }
  124. }