Overview

Hooks are TypeScript scripts that fire on Claude Code lifecycle events. They are the nervous system of TARS — capturing activity, injecting context, synthesizing learnings, and tracking costs.

Active Hooks

SessionStart

HookPurpose
initialize-session.tsCheck Claude version, initialize session state
load-core-context.tsInject CORE skill as system-reminder
capture-all-events.tsLog event to JSONL
health-morning-pull.tsPull Oura Ring health data

UserPromptSubmit

HookPurpose
context-reminder.tsInject TARS context reminder
update-tab-titles.tsSet terminal tab title
capture-all-events.tsLog event to JSONL

Stop / SubagentStop

HookPurpose
stop-hook.tsCapture session summary to history/
stop-hook-voice.tsVoice notification on completion
health-alert-check.tsCheck health alerts

SessionEnd

HookPurpose
capture-session-summary.tsFinal session summary
learning-synthesis.tsExtract learnings from session JSONL → MEMORY/Learning/ + Postgres

Hook Libraries (hooks/lib/)

LibraryPurpose
postgres.tsNeon Postgres client (projects, learnings, signals, activity)
coordination-db.tsLegacy SQLite client (being retired)
session-classifier.tsDeterministic JSONL session classifier
learning-extractor.tsHeuristic learning extraction (no LLM)
learning-writer.tsDual-write to markdown + Postgres
metadata-extraction.tsExtract metadata from hook payloads
observability.tsDashboard WebSocket integration
prosody-enhancer.tsVoice prosody for TTS

Configuration

All hooks are registered in ~/.claude/settings.json under the hooks key. Each event maps to an array of matchers, each with an array of hooks.