Add SessionEnd hook for automatic session summarization #1

Closed
will wants to merge 0 commits from feature/session-summarization-hook into main
Owner

Implements automatic memory extraction when Claude Code sessions end:

  • Add SessionEnd hook to hooks.json with 120s timeout
  • Create session-end.sh wrapper that parses hook input and runs summarizer
  • Create summarize-transcript.py that:
    • Loads transcript from Claude's storage
    • Skips trivial sessions (<3 user messages)
    • Extracts paths/facts via heuristics
    • Uses Claude CLI (subscription auth) for decisions/preferences
    • Saves to memory files with deduplication
    • Updates history index with summarized flag

Uses claude -p --model haiku for LLM extraction, leveraging
existing subscription credentials instead of requiring API key.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

Implements automatic memory extraction when Claude Code sessions end: - Add SessionEnd hook to hooks.json with 120s timeout - Create session-end.sh wrapper that parses hook input and runs summarizer - Create summarize-transcript.py that: - Loads transcript from Claude's storage - Skips trivial sessions (<3 user messages) - Extracts paths/facts via heuristics - Uses Claude CLI (subscription auth) for decisions/preferences - Saves to memory files with deduplication - Updates history index with summarized flag Uses `claude -p --model haiku` for LLM extraction, leveraging existing subscription credentials instead of requiring API key. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
will added 1 commit 2026-01-04 20:27:19 +00:00
Implements automatic memory extraction when Claude Code sessions end:
- Add SessionEnd hook to hooks.json with 120s timeout
- Create session-end.sh wrapper that parses hook input and runs summarizer
- Create summarize-transcript.py that:
  - Loads transcript from Claude's storage
  - Skips trivial sessions (<3 user messages)
  - Extracts paths/facts via heuristics
  - Uses Claude CLI (subscription auth) for decisions/preferences
  - Saves to memory files with deduplication
  - Updates history index with summarized flag

Uses `claude -p --model haiku` for LLM extraction, leveraging
existing subscription credentials instead of requiring API key.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
will closed this pull request 2026-01-04 20:29:20 +00:00
will deleted branch feature/session-summarization-hook 2026-01-04 20:41:39 +00:00

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: will/claude-code#1