DRY helper for adding/removing SessionStart hooks in ~/.claude/settings.json.
Handles missing files, deduplication, malformed JSON, and atomic writes
(.tmp + rename) to prevent corruption on crash or disk-full.
Part of team-install-mode feature (credit: Jared Friedman).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>