-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathhooks.json
More file actions
98 lines (98 loc) · 3.02 KB
/
Copy pathhooks.json
File metadata and controls
98 lines (98 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"_comment": "Distributable hooks config for claude-code-mastery. Run install.ps1 to install, or manually merge into ~/.claude/hooks/hooks.json",
"hooks": {
"SessionStart": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "pwsh -NoProfile -ExecutionPolicy Bypass -File \"{{HOOKS_DIR}}/mcp-health/health-check.ps1\"",
"timeout": 15000
}
],
"description": "Check MCP server health on session start"
}
],
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "pwsh -NoProfile -ExecutionPolicy Bypass -File \"{{HOOKS_DIR}}/quality-gates/git-safety.ps1\""
}
],
"description": "Block dangerous git operations (--no-verify, force push, reset --hard)"
},
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "pwsh -NoProfile -ExecutionPolicy Bypass -File \"{{HOOKS_DIR}}/quality-gates/dev-server-block.ps1\""
}
],
"description": "Block dev server commands that would hang the session"
},
{
"matcher": "Edit|Write|MultiEdit",
"hooks": [
{
"type": "command",
"command": "pwsh -NoProfile -ExecutionPolicy Bypass -File \"{{HOOKS_DIR}}/quality-gates/config-protection.ps1\""
}
],
"description": "Block modifications to linter/formatter configs — fix code, not rules"
},
{
"matcher": "tool == \"Edit\" || tool == \"Write\"",
"hooks": [
{
"type": "command",
"command": "pwsh -NoProfile -ExecutionPolicy Bypass -File \"{{HOOKS_DIR}}/strategic-compact/suggest-compact.ps1\""
}
],
"description": "Suggest manual compaction at logical intervals"
}
],
"PreCompact": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "pwsh -NoProfile -ExecutionPolicy Bypass -File \"{{HOOKS_DIR}}/memory-persistence/pre-compact.ps1\""
}
],
"description": "Save state before context compaction"
}
],
"PostToolUse": [
{
"matcher": "Edit|Write|MultiEdit",
"hooks": [
{
"type": "command",
"command": "pwsh -NoProfile -ExecutionPolicy Bypass -File \"{{HOOKS_DIR}}/quality-gates/console-warn.ps1\"",
"timeout": 5000
}
],
"description": "Warn about console.log statements after file edits"
}
],
"Stop": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "pwsh -NoProfile -ExecutionPolicy Bypass -File \"{{HOOKS_DIR}}/memory-persistence/session-end.ps1\""
}
],
"description": "Persist session state on end"
}
]
}
}