What
The system prompt is the set of instructions Claude Code sends ahead of your conversation on every request. You can add to it with --append-system-prompt, and that added text used to always go at the very end. A new internal option, appendSystemPromptHead, can now move the opening part of that appended text further up, into the part of the prompt that stays the same between requests.
CLAUDE_CODE_APPEND_PROMPT_HEADis a new environment variable (a setting passed to a program when it starts). Claude Code reads it at startup and then removes it straight away.- It only has an effect in remote sessions, meaning when
CLAUDE_CODE_REMOTEis set. - Its value must have the form
v1:<length>:<sha256>. The first<length>bytes of the--append-system-prompttext, followed by a blank line, must match that sha256 hash. If they do not match, or the value is malformed, or there is no appended text, nothing is moved. - The verified head is passed from startup through headless and print mode as
appendSystemPromptHead, and the headless tool context forwards it too. - When the system prompt is put together and a cache scope exists, that head is moved out of the appended text to just before the point where the changing part of the prompt begins. If there is no cache scope, no such boundary, or the head cannot be found, the text stays where it was.
- The variable was added to the lists of environment variables that are passed through to bridge and child processes.
- Separately, the UI bridge gained a
composerhook.
Nothing in Claude Code itself sets this variable. Whatever launches the remote session has to supply it.
Why
The prompt cache stores prompt text that was already processed so repeat requests can reuse it. Keeping a fixed, verified opening of an appended prompt in the stable, cached region means that text does not have to be treated as new each time. Everyday users will not see this directly; it matters to whoever launches cloud sessions with an appended system prompt.
The instructions Claude Code sends ahead of your conversation on every request, covering how Claude uses tools, behaves safely, and formats its responses. You can add to the system prompt with `--append-system-prompt` or replace it with `-…see the edit
It is not clear which cloud session launcher sets this variable, or whether any does yet.
--append-system-prompt on Glossary
New in this build: CLAUDE_CODE_APPEND_PROMPT_HEAD