integrations/claude-code/hooks/session_end.py

#!/usr/bin/env python3 """SessionEnd hook -- cleanup the session's herdr identity KV and scratch dir."""

from future import annotations

import sys from pathlib import Path

sys.path.insert(0, str(Path(file).resolve().parent)) from _common import core # noqa: E402

if name == "main": try: sys.exit(core.run_session_end_hook(sys.stdin)) except Exception: sys.exit(0)