[BUG] System prompt ignored when using --system-prompt together with --continue/--resume
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When launching a fresh session with --system-prompt, Claude honors the replacement system instructions. However, resuming an existing conversation via claude --system-prompt "<prompt>" --continue or --resume ignores the new system prompt. This makes --system-prompt behave inconsistently depending on whether the session is new or resumed.
What Should Happen?
Using --system-prompt together with --continue or --resume should replace the active session’s system prompt, just like it does for new sessions. That would make the CLI behavior consistent and allow users to change the guardrails of an ongoing conversation without starting over.
If the current behavior is intentional, could you clarify the rationale? Otherwise, supporting this combination would be very helpful.
Error Messages/Logs
None – there are no errors or log entries; Claude simply responds as if the default system prompt were still active.
Steps to Reproduce
- Run
claude --system-prompt "You are restricted to the Java language right now"and ask, “What language are you restricted to?” Claude answers “Java,” confirming it respects the prompt. - Exit the session.
- Run
claude --system-prompt "You are restricted to the Java language right now" --continue(also tried passing the prior prompt as the first argument, same result). - Ask the same question again. This time Claude replies that it has no restrictions and lists multiple languages, showing that the system prompt from step 3 was not applied.
Claude Model
Sonnet (default)
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.0.41
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
This never worked starting from 2.0.14 (--system-prompt was supported).
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗