Hook additional-context injection into the first message
Parent: Mac local LLMs: Agent clients, context and compaction · Published reference · snapshot 2026-10-05
↓ Facts as markdownall context files
additionalContext is wrapped in a system reminder and inserted into the conversation where the hook fired; it never shows as a chat message.
These notes link each claim to its source. A source may be a research report hosted on this site rather than the primary document. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
Facts
- additionalContext is wrapped in a system reminder and inserted into the conversation where the hook fired; it never shows as a chat message. [source]
- Plain stdout from SessionStart and UserPromptSubmit hooks is injected the same way, as a system reminder starting with the hook's name. [source]
- SessionStart additionalContext is added at the start of the conversation, before the first prompt; SessionStart also accepts initialUserMessage (creates the first user turn in -p mode), watchPaths, sessionTitle and reloadSkills. [source]
- When several hooks return additionalContext for one event, Claude receives every value. [source]
- Cap: additionalContext, systemMessage, initialUserMessage and plain stdout are each capped at 10,000 characters, measured per string. Over the cap, Claude Code saves the text to a file in the session directory and passes the file path plus a preview of up to 2,000 characters. The cap has no setting or environment variable. [source]
- Claude Code does not tell Claude to read the saved file. [source]
- Several hooks each under 10,000 characters can together exceed it, since each string is measured on its own; a local model can still receive tens of thousands of tokens from hooks. [inferred] [source]
- Shell profile output on stdout breaks JSON parsing and the hook JSON has no effect. [source]
- A Setup hook's JSON output, including additionalContext, is discarded on every exit code. [source]
- UserPromptSubmit hooks default to a 30 second timeout and block model processing until they finish. [source]
- Whether the 10,000-character cap applies to hook text injected through the memory-central style per-prompt hooks used here; the size per prompt is not measured. [source]
- additionalContext is wrapped in a system reminder and added at the point the hook fired, not shown as a chat message [source]
- Each of additionalContext, systemMessage, initialUserMessage and plain stdout is capped at 10,000 characters, measured per string [source]
- Over the cap Claude Code writes the text to a session-directory file and passes the path plus a preview of up to 2,000 characters; the cap has no setting [source]
- Claude Code does not ask Claude to read the overflow file [source]
- SessionStart additionalContext is delivered before the first prompt; SessionStart also takes initialUserMessage, watchPaths, sessionTitle and reloadSkills [source]
- Setup hooks discard JSON output fields including additionalContext on every exit code [source]
- UserPromptSubmit command hooks default to a 30 second timeout [source]
- Plain stdout from SessionStart and UserPromptSubmit hooks is injected as a system reminder starting with the hook's name [source]
Children
- No children recorded.