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
| Hook | Purpose |
|---|---|
initialize-session.ts | Check Claude version, initialize session state |
load-core-context.ts | Inject CORE skill as system-reminder |
capture-all-events.ts | Log event to JSONL |
health-morning-pull.ts | Pull Oura Ring health data |
UserPromptSubmit
| Hook | Purpose |
|---|---|
context-reminder.ts | Inject TARS context reminder |
update-tab-titles.ts | Set terminal tab title |
capture-all-events.ts | Log event to JSONL |
Stop / SubagentStop
| Hook | Purpose |
|---|---|
stop-hook.ts | Capture session summary to history/ |
stop-hook-voice.ts | Voice notification on completion |
health-alert-check.ts | Check health alerts |
SessionEnd
| Hook | Purpose |
|---|---|
capture-session-summary.ts | Final session summary |
learning-synthesis.ts | Extract learnings from session JSONL → MEMORY/Learning/ + Postgres |
Hook Libraries (hooks/lib/)
| Library | Purpose |
|---|---|
postgres.ts | Neon Postgres client (projects, learnings, signals, activity) |
coordination-db.ts | Legacy SQLite client (being retired) |
session-classifier.ts | Deterministic JSONL session classifier |
learning-extractor.ts | Heuristic learning extraction (no LLM) |
learning-writer.ts | Dual-write to markdown + Postgres |
metadata-extraction.ts | Extract metadata from hook payloads |
observability.ts | Dashboard WebSocket integration |
prosody-enhancer.ts | Voice 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.
Linked from (3)
- Memory System
infrastructure
Overview
TARS memory operates across three layers: file-based narrative storage, …
- Skills System
infrastructure
Overview
Skills are self-contained capability modules. Each skill has a SKILL.md …
- TARS Architecture Overview
infrastructure
System Architecture
TARS is a Personal AI Infrastructure built on Claude Code …