Overview
We need a repeatable process for keeping an up-to-date, accurate knowledge base of how the Claude Code hook system works — including undocumented behaviour, schema changes, best practices, and what the broader ecosystem is doing.
Motivation: Issue #23 (sessionStart advisories not reaching Claude) was discovered through direct experimentation. A systematic intelligence-gathering process would have caught this earlier — the upstream issue was filed by others long before we hit it.
What to Monitor
1. Claude Code GitHub Issues (anthropics/claude-code)
Search for hook-related issues regularly:
- Label:
hooks, hook
- Keywords:
hooks, PreToolUse, PostToolUse, SessionStart, systemMessage, additionalContext, hookSpecificOutput
- Focus on: bugs, behaviour changes, schema clarifications, undocumented fields
Key issues already found:
2. Claude Code Releases (anthropics/claude-code)
Scan each release changelog for hook-related changes:
- New fields added to hook response schema
- Behaviour changes for existing fields
- New event types
- Breaking changes to existing hook contracts
- New hook configuration options
3. Ecosystem Repos to Monitor
4. Official Documentation
Monitor for changes at:
docs.claude.com/en/docs/claude-code/hooks
code.claude.com/docs/en/hooks
- Anthropic blog posts about Claude Code
Process Design
Option A: Periodic Research Skill
A /hooks-research skill that, when run:
- Queries
gh api for new issues in anthropics/claude-code matching hook keywords since last run
- Queries
gh api for new releases in anthropics/claude-code since last run
- Fetches README/docs from ecosystem repos
- Summarises findings and flags anything relevant to this daemon
- Suggests updates to our knowledge base documents
Option B: Knowledge Base Documents
Static documents in CLAUDE/HooksKnowledge/ that are updated manually when research is done:
KNOWN_BEHAVIOUR.md — documented + observed hook behaviour (including undocumented)
SCHEMA.md — current hook response schema with field descriptions
ECOSYSTEM.md — index of relevant external repos and what they do
OPEN_UPSTREAM_ISSUES.md — upstream Claude Code issues relevant to this daemon
CHANGELOG_NOTES.md — hook-relevant notes from each Claude Code release
Option C: Both
Automated skill for discovery + structured knowledge base for storage.
Knowledge Gaps to Fill Now
From issue #23 investigation, we know:
systemMessage = human terminal only
additionalContext (in hookSpecificOutput) = Claude's context window
- These are documented but not prominently
What we still don't know:
- Full list of supported fields for each event type
- Whether
additionalContext concatenation order is guaranteed
- What changed in Claude Code 2.1.0 regarding SessionStart context injection
- Whether
additionalContext works for ALL event types or just some
- Exact behaviour of exit code 2 (stderr → Claude)
Proposed Next Steps
- Create
CLAUDE/HooksKnowledge/ directory with initial documents
- Define the research skill specification
- Do a one-time deep scan of anthropics/claude-code issues and recent releases
- Document findings
- Set a reminder cadence (e.g. monthly) to run the research skill
Related
Overview
We need a repeatable process for keeping an up-to-date, accurate knowledge base of how the Claude Code hook system works — including undocumented behaviour, schema changes, best practices, and what the broader ecosystem is doing.
Motivation: Issue #23 (sessionStart advisories not reaching Claude) was discovered through direct experimentation. A systematic intelligence-gathering process would have caught this earlier — the upstream issue was filed by others long before we hit it.
What to Monitor
1. Claude Code GitHub Issues (anthropics/claude-code)
Search for hook-related issues regularly:
hooks,hookhooks,PreToolUse,PostToolUse,SessionStart,systemMessage,additionalContext,hookSpecificOutputKey issues already found:
2. Claude Code Releases (anthropics/claude-code)
Scan each release changelog for hook-related changes:
3. Ecosystem Repos to Monitor
4. Official Documentation
Monitor for changes at:
docs.claude.com/en/docs/claude-code/hookscode.claude.com/docs/en/hooksProcess Design
Option A: Periodic Research Skill
A
/hooks-researchskill that, when run:gh apifor new issues in anthropics/claude-code matching hook keywords since last rungh apifor new releases in anthropics/claude-code since last runOption B: Knowledge Base Documents
Static documents in
CLAUDE/HooksKnowledge/that are updated manually when research is done:KNOWN_BEHAVIOUR.md— documented + observed hook behaviour (including undocumented)SCHEMA.md— current hook response schema with field descriptionsECOSYSTEM.md— index of relevant external repos and what they doOPEN_UPSTREAM_ISSUES.md— upstream Claude Code issues relevant to this daemonCHANGELOG_NOTES.md— hook-relevant notes from each Claude Code releaseOption C: Both
Automated skill for discovery + structured knowledge base for storage.
Knowledge Gaps to Fill Now
From issue #23 investigation, we know:
systemMessage= human terminal onlyadditionalContext(inhookSpecificOutput) = Claude's context windowWhat we still don't know:
additionalContextconcatenation order is guaranteedadditionalContextworks for ALL event types or just someProposed Next Steps
CLAUDE/HooksKnowledge/directory with initial documentsRelated
CLAUDE/ARCHITECTURE.md— current hooks architecture docsCLAUDE/Code/HooksSystem.md— hooks system documentation