Skip to content

feat: add SessionEnd hook for session activity logging#27

Open
marcodelpin wants to merge 1 commit intoBayramAnnakov:mainfrom
marcodelpin:feat/session-end-hook
Open

feat: add SessionEnd hook for session activity logging#27
marcodelpin wants to merge 1 commit intoBayramAnnakov:mainfrom
marcodelpin:feat/session-end-hook

Conversation

@marcodelpin
Copy link
Copy Markdown
Contributor

Summary

  • New session_end_log.py hook that fires at session end to capture a structured activity summary (topics covered, tools used, corrections detected)
  • Writes to ~/.claude/session-logs/YYYY-MM-DD-HHMMSS.md by default
  • Optional webhook (CLAUDE_REFLECT_SESSION_LOG_WEBHOOK) and command pipe (CLAUDE_REFLECT_SESSION_LOG_COMMAND) integrations
  • Disable entirely with CLAUDE_REFLECT_SESSION_LOG=false
  • Skips short sessions (< 4 messages) to avoid noise
  • 23 new tests covering all entry points

Note

Split from #20 as requested. This is the largest piece — the new hook type + logging infrastructure.

Test plan

  • Run a session with plugin installed, verify log file created in ~/.claude/session-logs/
  • Set CLAUDE_REFLECT_SESSION_LOG=false, verify no log created
  • Set webhook URL, verify JSON POST on session end
  • Run python -m pytest tests/test_session_end_log.py -v

New session_end_log.py hook fires at session end to capture a structured
activity summary: topics covered, tools used, corrections detected.

- Writes to ~/.claude/session-logs/YYYY-MM-DD-HHMMSS.md by default
- Optional webhook (CLAUDE_REFLECT_SESSION_LOG_WEBHOOK)
- Optional command pipe (CLAUDE_REFLECT_SESSION_LOG_COMMAND)
- Disable with CLAUDE_REFLECT_SESSION_LOG=false
- Skips short sessions (< 4 messages)
- 23 new tests covering all entry points
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant