context_injection
Whether hooks can inject messages, system prompts, or conversation context into the agent’s active session.
Type: bool Content type: hooks
Provider Support
Section titled “Provider Support”| Provider | Supported | Mechanism |
|---|---|---|
| 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 hook JSON response may include an optional context field; this content is injected into the agent context for the current turn. |
| 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 |
| 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 |
| windsurf | ✗ | Windsurf hooks cannot inject context into the agent's active session |
| zed | ✗ | not documented |