Skip to contentllms.txt

context_injection

Whether hooks can inject messages, system prompts, or conversation context into the agent’s active session.

Type: bool Content type: hooks

ProviderSupportedMechanism
claude-code✓Hooks return systemMessage field in JSON output to inject context into agent's active session
cline✓context_modification_output: Cline hooks can inject additional context into the agent's session via hook output
codex✓hook_system_message: Codex hooks can inject a system message into the agent's active session context
crush✓The output envelope's context field accepts a string or an array of strings, appended to what the model sees for the current turn. Across multiple hooks, context values concatenate in config order; empty entries are dropped.
cursor✓Hooks can inject context at session initialization via the sessionStart event, enabling custom context to be added to the agent's active session at startup.
factory-droid✓additionalContext field in PostToolUse, UserPromptSubmit, and SessionStart hook output injects information into the agent session; systemMessage field in JSON output provides session-level injection
pi✓before_agent_start handlers return { message: { customType, content, display } } to inject a persistent message stored in session and sent to LLM; context handlers return { messages } to modify the message array before each LLM call
amp✗Amp hooks cannot inject context into the agent session beyond the pre-execute 'send-user-message' action that cancels the tool call
copilot-cli✗Copilot CLI hooks cannot inject context into the agent session
devin✗Devin Desktop hooks cannot inject context into the agent's active session
gemini-cli✗Gemini CLI hooks cannot inject context into the agent session
kiro✗Kiro hooks cannot inject context into the agent session
opencode✗not documented
roo-code✗not documented
zed✗not documented