All 7 hooks run locally on your machine as Node.js scripts. They use Claude Code's hook protocol:
- stdin: Receives a JSON payload with
tool_inputand/ortool_response - stdout: Outputs context to add to Claude's conversation
- exit 0: Allow the action
- exit 1: Warn Claude but allow
- exit 2: Block the action
| Property | Value |
|---|---|
| Trigger | Session begins |
| Input | None (reads files directly) |
| Output | JSON with additionalContext field |
| Exit | Always 0 |
What it does:
- Reads
package.json→ detects project name and Angular version - Reads
upgrade/state.json→ loads upgrade progress - Outputs progress summary into Claude's context
| Property | Value |
|---|---|
| Trigger | Session ends |
| Input | None |
| Output | None (writes to files) |
| Exit | Always 0 |
What it does:
- Updates
upgrade/state.jsonwith session end timestamp - Records git branch and commit SHA
- Appends to
upgrade/logs/session-log.jsonl - Optional desktop notification (cross-platform)
| Property | Value |
|---|---|
| Trigger | Before any Bash command |
| Input | { tool_input: { command: "..." } } |
| Output | Error message (stderr) if blocked |
| Exit | 0 (allow), 1 (warn), 2 (block) |
Blocked patterns:
rm -rf(exceptupgrade/anddist/)git reset --hardgit push --force- Editing
node_modules/*.ts
Warned patterns:
npm installwithout--save-dev(during upgrades, prefer dev deps)
| Property | Value |
|---|---|
| Trigger | Before file edits |
| Input | { tool_input: { file_path: "..." } } |
| Output | Error message (stderr) if blocked |
| Exit | 0 (allow), 2 (block) |
Protected files:
package-lock.json(managed by npm).git/(managed by git)node_modules/(managed by npm)upgrade/state.json(managed by hooks)upgrade/logs/*.jsonl(managed by hooks)
| Property | Value |
|---|---|
| Trigger | After Bash command completes |
| Input | { tool_input: { command: "..." }, tool_response: { stdout, stderr, exit_code } } |
| Output | Error context (stderr) if build failed |
| Exit | 0 (pass), 2 (gate failed) |
What it does:
- Detects
ng build,ng test,ng lintcommands - If exit code ≠ 0: logs blocker to
upgrade/state.json - Appends errors to
upgrade/reports/build-errors.md - Optional desktop notification on failure
- Detects test regressions (compares to baseline count)
| Property | Value |
|---|---|
| Trigger | After .ts file edits |
| Input | { tool_input: { file_path: "..." } } |
| Output | TypeScript error output (stderr, informational) |
| Exit | Always 0 (informational only) |
What it does:
- Runs
npx tsc --noEmit --skipLibCheckon the edited file - Reports TypeScript errors for immediate awareness
- Does NOT block — full build check is done by post-bash-gate
| Property | Value |
|---|---|
| Trigger | When a subagent is spawned |
| Input | { agent_type, agent_id, session_id } |
| Output | None |
| Exit | Always 0 |
What it does:
- Appends entry to
upgrade/logs/agent-audit.jsonl - Records timestamp, agent type, and IDs
| File | Written By | Format |
|---|---|---|
upgrade/state.json |
session-start, session-stop, post-bash-gate | JSON |
upgrade/logs/session-log.jsonl |
session-stop | JSON Lines |
upgrade/logs/agent-audit.jsonl |
subagent-log | JSON Lines |
logs/session-audit.jsonl |
pre-bash-guard | JSON Lines |
upgrade/reports/build-errors.md |
post-bash-gate | Markdown |