<!-- llms-explorer concept facts · https://llms-explorer.com/tree/hook-additional-context-injection-into-the-first/ · pack 2026-10-05 · ~907 tokens -->

# Hook additional-context injection into the first message

> additionalContext is wrapped in a system reminder and inserted into the conversation where the hook fired; it never shows as a chat message.

Parent: [Mac local LLMs: Agent clients, context and compaction](https://llms-explorer.com/tree/mac-local-llms-agent-clients-context-and-compaction/) · 1 facets · 19 facts · page: https://llms-explorer.com/tree/hook-additional-context-injection-into-the-first/

## 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: `asserted`
- Plain stdout from SessionStart and UserPromptSubmit hooks is injected the same way, as a system reminder starting with the hook's name. — source: `asserted`
- 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: `asserted`
- When several hooks return additionalContext for one event, Claude receives every value. — source: `asserted`
- 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: `asserted`
- Claude Code does not tell Claude to read the saved file. — source: `asserted`
- 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: `asserted`
- Shell profile output on stdout breaks JSON parsing and the hook JSON has no effect. — source: `asserted`
- A Setup hook's JSON output, including additionalContext, is discarded on every exit code. — source: `asserted`
- UserPromptSubmit hooks default to a 30 second timeout and block model processing until they finish. — source: `asserted`
- 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: `asserted`
- additionalContext is wrapped in a system reminder and added at the point the hook fired, not shown as a chat message — [source](https://code.claude.com/docs/en/hooks)
- Each of additionalContext, systemMessage, initialUserMessage and plain stdout is capped at 10,000 characters, measured per string — [source](https://code.claude.com/docs/en/hooks)
- 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](https://code.claude.com/docs/en/hooks)
- Claude Code does not ask Claude to read the overflow file — [source](https://code.claude.com/docs/en/hooks)
- SessionStart additionalContext is delivered before the first prompt; SessionStart also takes initialUserMessage, watchPaths, sessionTitle and reloadSkills — [source](https://code.claude.com/docs/en/hooks)
- Setup hooks discard JSON output fields including additionalContext on every exit code — [source](https://code.claude.com/docs/en/hooks)
- UserPromptSubmit command hooks default to a 30 second timeout — [source](https://code.claude.com/docs/en/hooks)
- Plain stdout from SessionStart and UserPromptSubmit hooks is injected as a system reminder starting with the hook's name — [source](https://code.claude.com/docs/en/hooks)
