Appearance
date: 2026-06-04 tags: [claude-code, hooks, session-start, context-injection] status: active graduated_to:
A SessionStart hook injects context via stdout/additionalContext — ours writes only to stderr, so it injects nothing
Symptom — a proposed "orient the agent at session start" feature (surface recent learnings) was dismissed as mechanically impossible — "SessionStart output never reaches the model." That premise was wrong, and nearly entered a decision (and this store) as fact.
Root cause — Claude Code does add a SessionStart hook's stdout to the model's context (an explicit exception to the usual "stdout → debug log only" rule), and also supports hookSpecificOutput.additionalContext. Our .claude/hooks/session-start.sh writes everything via log() { echo … >&2; } (stderr) and exits 0 — and on exit 0, stderr goes to the debug log only, never the model. So the hook injects nothing by its own design, not because SessionStart can't.
Fix — none shipped; this records the correction so the false premise can't shape a future call. To inject per-session orientation: print to stdout (or return hookSpecificOutput.additionalContext) from session-start.sh — not "use UserPromptSubmit instead." Verified against the Claude Code hooks docs (code.claude.com/docs/en/hooks).
Guard — this entry. When weighing a session-start context feature: SessionStart can inject (stdout / additionalContext); the only constraint is that our current script is stderr-only provisioning. Also a meta-guard: verify a hook/runtime claim against the docs before it becomes a learning — find-learnings now vets candidates (incl. truth-check) before surfacing.