Skip to content

Session start hook

sync-wiki edited this page Sep 6, 2026 · 1 revision

Generated from the repo's README by scripts/sync-wiki.sh. Edit the README, not this page.

Session-start hook

SessionStart → hooks.json (timeout 15) → hooks/scripts/session-start.sh
  ├─ word-counts ~/.claude/CLAUDE.md + <project>/CLAUDE.md (-ef guard: CLAUDE.md/claude.md are one file on macOS)
  ├─ validates ~/.claude/settings.json (stderr warning only; skipped without python3)
  ├─ stdout → EMPTY, or LTX rows only for files over threshold (stdout is injected into Claude's context)
  └─ stderr → human warning: ⚠ TOKEN SAVER [WARNING]: CLAUDE.md is 753 words (~978 tokens) …

Thresholds: warn ≥ 600 words, critical ≥ 1000; tokens = words × 1.3.

To customize thresholds, edit hooks/scripts/session-start.sh:

readonly WARN_WORDS=600    # yellow warning
readonly CRIT_WORDS=1000   # red critical

Clone this wiki locally