CLAUDE_CODE_SYSTEM_PROMPT_FEATURE_FLAG
Updated by Alex Sorokoletov
CLAUDE_CODE_SYSTEM_PROMPT_FEATURE_FLAG is a Claude Code environment variable: In remote mode, names the feature flag whose non-empty string value replaces the default system prompt. Added between v2.1.321 and v2.1.323 and still present in v2.1.324. It is not in the official reference.
| Status | Present in v2.1.324 |
|---|---|
| Added | Added between v2.1.321 and v2.1.323 |
| Category | Other |
| Official docs | Not listed |
How to set it
For one session, export it in the shell that starts Claude Code:
export CLAUDE_CODE_SYSTEM_PROMPT_FEATURE_FLAG=<value>
claudeTo apply it to every session, add it to the env object of a settings file:
// ~/.claude/settings.json
{
"env": {
"CLAUDE_CODE_SYSTEM_PROMPT_FEATURE_FLAG": "<value>"
}
}Related variables
CLAUDE_CODE_SYSTEM_PROMPT_GB_FEATURE: Names a GrowthBook feature flag whose value overrides the system prompt — but only when CLAUDE_CODE_REMOTE is set.CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT: Switches to a reduced system prompt, stripping out the non-essential guidance sections that bulk up the default prompt.CLAUDE_CODE_APPEND_PROMPT_HEAD: Designates a prompt-head string that is validated for integrity before use and then cleared after a single read; an invalid value is ignored.CLAUDE_CODE_EMIT_USER_PROMPT_SUBMIT_HOOK_EVENTS: When set, enables emitting start and end hook events for user prompt submission; the value is read once and then cleared.CLAUDE_CODE_FLAG_FETCH_WAIT_MS: Milliseconds to wait for the feature-flag fetch to return before giving up; defaults to 3000.CLAUDE_CODE_MESSAGES_PROMPT_CACHE_TTL: Set to 5m to force the messages prompt cache to a five-minute lifetime.CLAUDE_CODE_MID_CONVERSATION_SYSTEM: Inject a system message mid-conversation.CLAUDE_CODE_MORNING_BRIEF_PROMPT: Set a custom prompt for the morning brief; used when its trimmed length was within bounds, otherwise the default prompt applied.
Frequently asked questions
What does CLAUDE_CODE_SYSTEM_PROMPT_FEATURE_FLAG do?
In remote mode, names the feature flag whose non-empty string value replaces the default system prompt.
Which Claude Code version has CLAUDE_CODE_SYSTEM_PROMPT_FEATURE_FLAG?
Added between v2.1.321 and v2.1.323 and still present in v2.1.324.
How do I set CLAUDE_CODE_SYSTEM_PROMPT_FEATURE_FLAG?
Export it before starting Claude Code (export CLAUDE_CODE_SYSTEM_PROMPT_FEATURE_FLAG=value), or add it to the "env" object in ~/.claude/settings.json to apply it to every session.
All variables, searchable: Claude Code environment variables.