Skip to content
BENIBIX Learn

SessionStart Hook

AI⌨️ Claude CodeConfiguration

Also known as SessionStart

The event when a session starts. It can load notes for Claude.

Think of it like

It is like a note on the fridge. You read it as the day starts.

Example

Jack's SessionStart hook prints the last five commits. Claude starts each session knowing what changed.

Why it matters

Facts that change each day do not belong in CLAUDE.md. This hook fetches them fresh each time.

Definition

SessionStart is the hook event that fires when Claude Code starts a new session or resumes one. The matcher says how it began: startup, resume, clear, compact or fork. Text the hook prints is added to Claude's context, so it is the place to load today's issues or recent changes. Only command and MCP tool hooks run here.

Example code

bash
#!/bin/bash
# show Claude the last five commits at the start
git log --oneline -5
What this prints becomes context for Claude.

Common mistake

Making it slow. It runs on every start, resume and clear, and Claude's first reply waits for it.

Key takeaways

  1. 1
    Start or resume. Five sources.
  2. 2
    Output is context. Plain text works.
  3. 3
    Keep it fast. Each start.

Compare