Claude Certified Architect – Foundations Practice Question 94: SessionStart Hook Context
Claude Certified Architect, Foundations · Test 10 · question 4 of 10
A team wants every Claude Code session to begin already knowing the current git branch, the issues assigned to the developer, and the latest deploy status. These values change daily, so they cannot live in a static CLAUDE.md. The team also wants the same information re-supplied after a conversation is compacted. Which configuration achieves this?
Show answer and explanation
Answer:
C is correct. SessionStart fires when a session begins or resumes, and for it Claude Code adds plain text the hook command writes to stdout to Claude's context, so a script that runs git and queries the issue tracker gives fresh context each time. The matcher for this event is the source (startup, resume, clear, compact, or fork), and the hooks guide shows a SessionStart hook with a compact matcher to re-inject critical context after compaction.
A is wrong because PostToolUse fires after every tool call, not at session start, so it adds noise and repeated output to context. B is wrong because an @path import is only as fresh as the file, and regenerating it by hand is the manual step the team wants to remove. D is wrong because a PreToolUse hook is for allowing or blocking tool calls, and it makes the developer do the work the hook should automate.
Reference: Automate actions with hooks