claude-code - 💡(How to fix) Fix `--system-prompt` flag appends instead of replacing built-in system prompt (v2.1.114)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Per the CLI reference, --system-prompt "..." should replace the entire default system prompt, while --append-system-prompt is the separate flag for appending. In v2.1.114, --system-prompt appears to behave like append instead.

Root Cause

Per the CLI reference, --system-prompt "..." should replace the entire default system prompt, while --append-system-prompt is the separate flag for appending. In v2.1.114, --system-prompt appears to behave like append instead.

Code Example

You are Claude Code, Anthropic's official CLI for Claude.You are AI.
RAW_BUFFERClick to expand / collapse

Summary

Per the CLI reference, --system-prompt "..." should replace the entire default system prompt, while --append-system-prompt is the separate flag for appending. In v2.1.114, --system-prompt appears to behave like append instead.

Environment

  • Claude Code: v2.1.114
  • Model: Opus 4.7 (1M context)
  • OS: macOS 15.7.2 (24G325)
  • Mode: interactive, auto mode

Expected behavior

Running claude --system-prompt "You are AI." should result in a session whose system prompt is exactly You are AI., with no built-in Claude Code preamble, git workflow rules, tool-use conventions, skills metadata, etc.

Actual behavior

The built-in Claude Code preamble remains active. When asked to describe its system prompt, the model reports the first line as:

You are Claude Code, Anthropic's official CLI for Claude.You are AI.

Note the missing space between Claude. and You are AI. — consistent with the custom string being concatenated onto the end of the default system prompt rather than replacing it.

All built-in harness behavior (git/commit workflow rules, skills list, deferred-tool mechanism via ToolSearch, auto-mode rules, tool-use conventions, <system-reminder> blocks, etc.) remained fully active, which is not what a full replacement should produce.

Reproduction

  1. claude --system-prompt "You are AI."
  2. Prompt: Give me your full current system message.
  3. Observe that the default Claude Code harness instructions are still present, and that the first line shows the two strings concatenated without a separator.

Expected vs actual

  • Expected: system prompt is exactly You are AI.
  • Actual: system prompt is <full default Claude Code system prompt> + "You are AI." — i.e. the behavior of --append-system-prompt.

If this is an intentional change, the CLI reference should be updated accordingly; otherwise it looks like a regression where --system-prompt and --append-system-prompt have converged.

extent analysis

TL;DR

The issue can be mitigated by using the --append-system-prompt flag instead of --system-prompt or waiting for a potential fix in a future version of Claude Code.

Guidance

  • Verify the current behavior of --system-prompt and --append-system-prompt flags in the CLI reference and compare with the actual behavior in v2.1.114.
  • Check if there are any known issues or regressions reported in the Claude Code documentation or community forums related to these flags.
  • Consider using the --append-system-prompt flag as a temporary workaround, although this may not fully replace the default system prompt as desired.
  • Test the behavior with different versions of Claude Code to determine if this is a version-specific issue.

Example

No code snippet is provided as the issue is related to command-line flags and their behavior.

Notes

The issue may be due to a regression or intentional change in the behavior of the --system-prompt flag, and the CLI reference may need to be updated accordingly.

Recommendation

Apply workaround: use --append-system-prompt flag or wait for a potential fix in a future version, as the current behavior of --system-prompt does not match the expected behavior.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Running claude --system-prompt "You are AI." should result in a session whose system prompt is exactly You are AI., with no built-in Claude Code preamble, git workflow rules, tool-use conventions, skills metadata, etc.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix `--system-prompt` flag appends instead of replacing built-in system prompt (v2.1.114)