---
title: HOOKS — Inventory aller systemd Timer und Claude Hooks
type: system
tags: [hooks, systemd, claude, schedule, infrastructure]
date: 2026-05-08
status: aktiv
related: [[brain/CLAUDE]], [[HEARTBEAT]], [[02-Wissen/aria-architektur-tief-2026-05-08]]
---

# HOOKS — Aria's Trigger-Inventory

> Übersicht aller automatisierten Trigger im Aria-Stack. Quelle für „was sollte gerade triggern"-Diagnose.
> Stand: V5 Sprint 1 (08.05.2026).

## 1. systemd Services (langlebig)

| Service | Zweck | Restart | Owner-Skript |
|---|---|---|---|
| `aria.service` | Hauptprozess: Claude Code in tmux + Telegram-Plugin | always (30s) | `wrapper.sh` |
| `aria-control.service` | Token-Auth Dashboard (HTTP) | always | `aria-control.py` |
| `aria-dashboard.service` | Restart+Debug UI für Tester-VPS | always | `aria-dashboard.py` |
| `aria-health.service` | HTTP-Endpoint `localhost:9090/health` | always | `aria-health.py` |
| `aria-api.service` | HTTP-API für n8n | always | `aria-api.py` |
| `aria-chat-logger.service` | Chat-Log nach Supabase | always | `chat-logger.py` |
| `aria-chat-logger-sqlite.service` | Chat-Log nach lokaler SQLite | always | `chat-logger.py` --sqlite |

## 2. systemd Timers (zeitgesteuert)

| Timer | Schedule | Triggert | Owner-Skript |
|---|---|---|---|
| `aria-watchdog.timer` | Boot+60s, dann alle 2 min | `aria-watchdog.service` | `aria-watchdog.sh` |
| `aria-git-sync.timer` | Boot+2min, dann alle 15 min | `aria-git-sync.service` | `aria-git-sync.sh` |
| `aria-db-cleanup.timer` | OnCalendar `04:00:00` täglich | `aria-db-cleanup.service` | `aria-db-cleanup.py` |
| `aria-memory-curator.timer` | OnCalendar `Sun 03:30` (V5 Sprint 1, NEW) | `aria-memory-curator.service` | `aria-memory-curator.sh` |
| `aria-user-update.timer` | OnCalendar `Sun 04:00` (V5 Sprint 2) | `aria-user-update.service` | `aria-user-update.sh` |
| `aria-compaction-watch.timer` | OnCalendar `*:0/60` (V5 Sprint 6) | `aria-compaction-watch.service` | `aria-compaction-watch.sh` |
| `aria-linear-liveness.timer` | OnCalendar `*-*-* 07:00 UTC` (Paperclip-Pattern, 10.05.2026) | `aria-linear-liveness.service` | `aria-linear-liveness.py` |
| `aria-akp-ingest.timer` | OnCalendar `*-*-* 00,06,12,18:30 UTC` (KAR-74, 12.05.2026) | `aria-akp-ingest.service` | `aria-akp-ingest.py` |
| `aria-akp-triage.timer` | OnCalendar `*-*-* 05:00 Europe/Berlin` (KAR-74) | `aria-akp-triage.service` | `aria-akp-triage.py` |
| `aria-akp-deep.timer` | OnCalendar `*-*-* 06:00 Europe/Berlin` (KAR-74) | `aria-akp-deep.service` | `aria-akp-deep.py` |
| `aria-akp-briefing.timer` | OnCalendar `*-*-* 07:30 Europe/Berlin` (KAR-74) | `aria-akp-briefing.service` | `aria-akp-briefing.py` |
| `aria-radar-fetch.timer` | OnCalendar `*-*-* 06:30 Europe/Berlin` (KAR-38 Sprint B, 13.05.2026 modular Replace) | `aria-radar-fetch.service` | `aria-radar-fetch.sh` (in `scripts/ai-radar/`, 8 Plattformen) |
| `aria-radar-auto-watchlist.timer` | OnCalendar `Sun *-*-* 04:30 Europe/Berlin` (KAR-117, 13.05.2026) | `aria-radar-auto-watchlist.service` | `aria-radar-auto-watchlist.py` (Cross-Platform-Author-Discovery, weekly Brain-Inbox) |
| `aria-brain-embed.timer` | OnCalendar `*-*-* 07:45 Europe/Berlin` (KAR-595, 24.05.2026) | `aria-brain-embed.service` | `aria-brain-embed.py incremental` (pgvector-Index frisch halten — neue Notes embedden) |

**Deaktiviert (V5 Sprint 0)**:
- `aria-heartbeat.timer` + `aria-heartbeat.service` — Skript existierte nicht. Bei Bedarf in V5 Sprint 4 neu konzipieren.

## 3. Claude Code Hooks

<!-- HOOK-MANIFEST:START (auto, aria-hook-manifest.py --update-hooks-md) -->
<!-- AUTO-GENERIERT von aria-hook-manifest.py --render — NICHT manuell editieren -->

### Event: `SessionStart`

| # | Matcher | Hook | Timeout | Zweck |
|---|---|---|---|---|
| 0 | `*` | session-start.sh | — | Brain-Snapshot + Linear + Mode laden |
### Event: `UserPromptSubmit`

| # | Matcher | Hook | Timeout | Zweck |
|---|---|---|---|---|
| 0 | `*` | telegram-log-in.sh | 10s | Inbound-Telegram → Chat-Log |
| 1 | `*` | auto-memory-inject.sh | 5s | Memory/Brain-Auto-Context injizieren (KAR-80) |
| 2 | `*` | telegram-reply-discipline.sh | 3s | Reminder: Telegram-Inbound braucht reply-Tool |
| 3 | `*` | aria-effort-detect.sh | — | Effort-Auto-Eskalation erkennen |
### Event: `PreToolUse`

| # | Matcher | Hook | Timeout | Zweck |
|---|---|---|---|---|
| 0 | `mcp__plugin_telegram_telegram__reply` | pre-output-critic.sh | 5s | Format-Lint vor Telegram-Reply (KAR-65) |
| 1 | `Bash` | pre-tool-safety.sh | 5s | Bash-Safety-Gate (destructive Commands) |
| 2 | `Bash` | `rtk hook claude` (extern) | — | — |
| 3 | `Write|Edit` | tdd-guard.sh | 5s | TDD-Gate vor Write/Edit |
| 4 | `Write|Edit|MultiEdit` | gateguard.sh | 5s | Fact-Forcing-Gate vor Write/Edit (KAR-636) |
### Event: `PostToolUse`

| # | Matcher | Hook | Timeout | Zweck |
|---|---|---|---|---|
| 0 | `mcp__plugin_telegram_telegram__reply` | telegram-log-out.sh | 10s | Outbound-Telegram → Chat-Log |
| 1 | `Write|Edit` | brain-write-validator.sh | 10s | Brain-Frontmatter/Wikilink-Validierung |
| 2 | `*` | post-tool-failure.sh | 5s | Tool-Failure-Diagnose-Hinweis |
### Event: `PreCompact`

| # | Matcher | Hook | Timeout | Zweck |
|---|---|---|---|---|
| 0 | `*` | pre-compact.sh | — | ACTIVE_TASK-Backup + HANDOFF-Stub vor Compaction |
### Event: `Stop`

| # | Matcher | Hook | Timeout | Zweck |
|---|---|---|---|---|
| 0 | `*` | session-stop.sh | — | Session-Wrap-Tasks |

<!-- HOOK-MANIFEST:END -->

| Hook | Trigger | Owner-Skript |
|---|---|---|
| `SessionStart` | Bei jedem Claude-Code-Start | `/root/.claude/hooks/session-start.sh` |
| `SessionStop` | Bei sauberem Session-End | `/root/.claude/hooks/session-stop.sh` |
| `PreCompact` | Vor Context-Compaction | `/root/.claude/hooks/pre-compact.sh` |
| `PreToolUse` (Bash) | Vor jedem Bash-Tool-Call | `/root/.claude/hooks/pre-tool-safety.sh` |
| `PreToolUse` (Bash) | Vor jedem Bash-Tool-Call | `rtk hook claude` (RTK Token-Compression, KAR-137 seit 13.05.2026, Binary `/usr/local/bin/rtk`) |
| `PreToolUse` (Telegram-reply) | Vor jeder Telegram-Reply | `/root/.claude/hooks/pre-output-critic.sh` (KAR-65, seit 11.05.2026) |
| `PreToolUse` (Write/Edit) | Vor Code-Write in opt-in-Repos | `/root/.claude/hooks/tdd-guard.sh` (KAR-292, blockt Prod-Code ohne Test) |
| `PreToolUse` (Write/Edit/MultiEdit) | 1. Edit/Write je Code-Datei pro Session | `/root/.claude/hooks/gateguard.sh` (KAR-636, Fact-Forcing-Gate aus ECC: blockt 1x, fordert Importers/Schema/Anweisung; scoped auf Kadi-v2/private-ops/durrani-*, yolo umgeht, Bypass `ARIA_GATEGUARD_BYPASS=1` / Marker `gateguard:skip`) |
| `PostToolUse` (Write/Edit) | Nach Brain-Note-Write/Edit | `/root/.claude/hooks/brain-write-validator.sh` (KAR-593, Frontmatter+Wikilink-Integritaet → `validators/markdown_{frontmatter,wikilinks}.py`, obsidian-mind) |
| `PostToolFailure` | Nach fehlgeschlagenem Tool-Call | `/root/.claude/hooks/post-tool-failure.sh` |
| `Telegram-Log-In` | Telegram Inbound | `/root/.claude/hooks/telegram-log-in.sh` |
| `Telegram-Log-Out` | Telegram Outbound | `/root/.claude/hooks/telegram-log-out.sh` |

## 4. Cron-Jobs (root crontab)

| Schedule | Skript | Zweck |
|---|---|---|
| `37 9 * * *` | `secret-rotation-reminder.sh` | Daily Secret-Rotation-Reminder |

(Kein direkter Cron für andere Tasks. Aria nutzt systemd-Timer als bevorzugten Mechanismus.)

## 5. Application-internal Triggers

| Trigger | Mechanismus | Effekt |
|---|---|---|
| `wrapper.sh auto_approve` | Background-Loop alle 2s | Drückt Enter bei Permission-Dialogen |
| `wrapper.sh ❯-prompt-detection` | tmux capture-pane Polling, max 60×2s | Sendet Startup-Prompt nach Boot |
| `aria-watchdog.sh` | systemd-Timer (oben) | Health-Check + Restart wenn Claude tot |
| Aria's eigene Cron-Inferences | aktuell nicht implementiert | (Hermes-style commitments — Sprint 4 optional) |

## 6. Sleep-Time Memory-Consolidation (V5 ohne dedizierten Trigger)

`aria-memory-consolidate-night.py` ist als Skript vorhanden, hat aber aktuell **keinen
systemd-Timer**. Wird manuell oder via separater Cron-Konfiguration getriggert.
Empfohlen: `OnCalendar=*-*-* 03:00:00 Europe/Berlin` als Sprint-3+ Item.

## 7. Diagnose-Befehle

```bash
# Alle aria-Services + Timers
systemctl list-units --type=service,timer | grep -i aria

# Aktiv-Status
systemctl --failed | grep aria-

# Letzte Watchdog-Ticks
journalctl -u aria-watchdog.service --since="1 hour ago"

# Letzte Git-Sync-Runs
journalctl -u aria-git-sync.service --since="1 hour ago"

# Hook-Logs (Aria SessionStart, etc.)
tail -50 /root/.claude/hooks/hook.log

# Crontab
crontab -l
```

## 8. Wann updaten

Diese Datei muss aktualisiert werden bei:
- Neuer systemd Service oder Timer angelegt/entfernt
- Neuer Claude Hook installiert
- Watchdog-Schedule geändert
- Memory-Curator-Schedule geändert
- Schedule-Änderungen in HEARTBEAT-Routinen
