{"version":"2.1.284","anchor":"new-claude-code-append-prompt-head-env-var-moves-a-verified","canonical_anchor":"new-claude-code-append-prompt-head-env-var-moves-a-verified","heading":"New appendSystemPromptHead option moves a verified start of the appended system prompt into the cached part, in remote sessions","tier":"use","area":"System Prompt","url":"https:\/\/changelogs.core-directive.com\/v\/2.1.284\/e\/new-claude-code-append-prompt-head-env-var-moves-a-verified","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.284","markdown":"### New appendSystemPromptHead option moves a verified start of the appended system prompt into the cached part, in remote sessions\n\nRemote sessions can move a hash-verified opening of --append-system-prompt text into the cached system prompt via CLAUDE_CODE_APPEND_PROMPT_HEAD\n\n**Unclear.** It is not clear which cloud session launcher sets this variable, or whether any does yet.\n\n**What**\n\nThe 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.\n\n- `CLAUDE_CODE_APPEND_PROMPT_HEAD` is 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.\n\n- It only has an effect in remote sessions, meaning when `CLAUDE_CODE_REMOTE` is set.\n\n- Its value must have the form `v1:<length>:<sha256>`. The first `<length>` bytes of the `--append-system-prompt` text, 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.\n\n- The verified head is passed from startup through headless and print mode as `appendSystemPromptHead`, and the headless tool context forwards it too.\n\n- 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.\n\n- The variable was added to the lists of environment variables that are passed through to bridge and child processes.\n\n- Separately, the UI bridge gained a `composer` hook.\n\nNothing in Claude Code itself sets this variable. Whatever launches the remote session has to supply it.\n\n**Why**\n\nThe 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.\n\n- Area: System Prompt\n- Names: `CLAUDE_CODE_APPEND_PROMPT_HEAD`, `CLAUDE_CODE_REMOTE`\n- Tier: Use it now\n- Useful: 4\/5\n- Signal: 4\/5"}