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 startAgent responseAgent completeSession end
git addpre-commitgit pushpre-push
HookTriggerWhat it does
g-hk-pre-session-traceSession startInjects .gald3r/ context — mission, active tasks, constraints, WPAC inbox — before every agent session begins
g-hk-agent-completeAgent completeFires after every agent response. Captures session state, checks for incomplete TODOs, offers memory capture
g-hk-pre-commitPre-commitValidates commit message format, checks for unresolved BUG annotations, enforces subsystem tagging
g-hk-pre-pushPre-pushFinal sanity check before git push — no secrets, no untracked task references, clean state
g-hk-graph-updatePost-commitRefreshes the Muninn codebase knowledge graph indexes (Python + TypeScript) after every commit
g-hk-wpac-inbox-checkSession startSurfaces WPAC inbox items — conflicts gate task claiming; INFO/SYNC auto-actioned; ORDERS surface for review
g-hk-post-session-traceSession endArchives session transcript, computes token/cost summary, appends to session log
g-hk-ggo-stop-detectAgent completeDetects premature @g-go pipeline stops and restarts the pipeline with resume context
g-hk-claude-chat-loggerAgent completeCaptures agent transcripts to structured JSONL log for memory and analysis
g-hk-component-tag-checkPre-commitVerifies every new .gald3r_sys/ component file has required subsystem_membership tagging
g-hk-encoding-normalizePre-commitNormalizes file encoding to UTF-8; prevents encoding drift in cross-platform repos
g-hk-nightly-learnScheduledNightly: crawls stale platform docs, refreshes vault index, captures session insights