You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -114,6 +117,142 @@ Some workflows use [Model Context Protocol (MCP)](https://modelcontextprotocol.i
114
117
115
118
MCP servers are configured in Claude Code settings, not in this repository.
116
119
120
+
## Hooks
121
+
122
+
Hooks are shell commands that run in response to Claude Code events. They can block actions, validate inputs, or add context. Hooks are configured in `settings.json` and scripts live in `.claude/hooks/`.
123
+
124
+
### How Hooks Work
125
+
126
+
1. Claude triggers an event (e.g., about to read a file)
127
+
2. Matching hooks receive event data as JSON on **stdin**
128
+
3. The hook runs and returns an **exit code**:
129
+
130
+
| Exit Code | Meaning | Effect |
131
+
|-----------|---------|--------|
132
+
|`0`| Success | Action proceeds normally |
133
+
|`2`| Block | Action is prevented, stderr shown to Claude |
134
+
| Other | Non-blocking error | Action proceeds, stderr shown in verbose mode |
135
+
136
+
### Current Hooks
137
+
138
+
| Hook | Event | Matcher | Purpose |
139
+
|------|-------|---------|---------|
140
+
|`read_hook.js`|`PreToolUse`|`Read\|Grep`| Blocks reading `.env` files to protect secrets |
0 commit comments