Hooks
Lifecycle scripts that fire automatically on session start, agent complete, pre-commit, and other events. Hooks are PowerShell scripts (Windows) or bash scripts (Linux/macOS) stored in .cursor/hooks/ or .claude/hooks/.
Hook trigger lifecycle
Session start→Agent response→Agent complete→Session end
git add→pre-commit→git push→pre-push
| Hook | Trigger | What it does |
|---|---|---|
| g-hk-pre-session-trace | Session start | Injects .gald3r/ context — mission, active tasks, constraints, WPAC inbox — before every agent session begins |
| g-hk-agent-complete | Agent complete | Fires after every agent response. Captures session state, checks for incomplete TODOs, offers memory capture |
| g-hk-pre-commit | Pre-commit | Validates commit message format, checks for unresolved BUG annotations, enforces subsystem tagging |
| g-hk-pre-push | Pre-push | Final sanity check before git push — no secrets, no untracked task references, clean state |
| g-hk-graph-update | Post-commit | Refreshes the Muninn codebase knowledge graph indexes (Python + TypeScript) after every commit |
| g-hk-wpac-inbox-check | Session start | Surfaces WPAC inbox items — conflicts gate task claiming; INFO/SYNC auto-actioned; ORDERS surface for review |
| g-hk-post-session-trace | Session end | Archives session transcript, computes token/cost summary, appends to session log |
| g-hk-ggo-stop-detect | Agent complete | Detects premature @g-go pipeline stops and restarts the pipeline with resume context |
| g-hk-claude-chat-logger | Agent complete | Captures agent transcripts to structured JSONL log for memory and analysis |
| g-hk-component-tag-check | Pre-commit | Verifies every new .gald3r_sys/ component file has required subsystem_membership tagging |
| g-hk-encoding-normalize | Pre-commit | Normalizes file encoding to UTF-8; prevents encoding drift in cross-platform repos |
| g-hk-nightly-learn | Scheduled | Nightly: crawls stale platform docs, refreshes vault index, captures session insights |
