The set_model control request accepts an internal system_prompt field that replaces the custom system prompt (the same slot as --system-prompt) starting from the next turn. It applies only if the model change itself is accepted and the value is non-empty; older transports report success without applying it.
@internal Replaces the custom system prompt (the --system-prompt / initialize systemPrompt slot) from the next turn on.
Strings lifted out of the shipped bundle, so the claim above can be checked against them.
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
You can also add a system prompt section listing available tool categories. This gives the agent context about what kinds of tools are available to search for. Pass the text in the `systemPrompt` option of `query()` in TypeScript, or `syst…agent-sdk/tool-search see the edit
| `system_prompt` | `str \| SystemPromptPreset \| SystemPromptFile \| None` | `None` | System prompt configuration. Pass a string for a custom prompt, `{"type": "preset", "preset": "claude_code"}` for Claude Code's system prompt with optio…agent-sdk/python see the edit
| `set_model(model)` | Change the model for the current session. Pass `None` to reset to [Claude Code's default model](/docs/en/model-config) |agent-sdk/python see the edit
If you start Claude Code in [bare mode](/docs/en/headless#start-faster-with-bare-mode), by passing `--bare` or setting `CLAUDE_CODE_SIMPLE=1`, recording stays off unless you pass `--system-prompt-snapshot on`. Before v2.1.268, sessions tha…cli-reference see the edit
* In sessions signed in with a claude.ai or Console account, and other sessions that [fetch feature flags](/docs/en/env-vars#features-that-need-feature-flag-fetching), the resumed conversation keeps the system prompt it started with by def…prompt-caching see the edit
Anthropic's documentation has since written up --system-prompt, on How Claude Code uses prompt caching.