SessionEnd hook does not fire with /clear as documentation states.

Resolved 💬 6 comments Opened Aug 24, 2025 by jeremynsl Closed May 28, 2026

Docs say:
SessionEnd

Runs when a Claude Code session ends. Useful for cleanup tasks, logging session statistics, or saving session state.

The reason field in the hook input will be one of:

clear - Session cleared with /clear command
logout - User logged out
prompt_input_exit - User exited while prompt input was visible
other - Other exit reasons

However, I spent a long time testing with --debug and couldn't make SessionEnd fire on /clear command. The SessionStart does fire of course since its a new session after clearing. I'd expect /clear to fire SessionEnd and then SessionStart in succession.

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗