Replace system prompt in interactive mode for Claude Code similar to Gemini CLI

Status Closed — not planned
Maintainer reply None cached
Activity 8 comments · opened Jun 28, 2025 · closed Feb 11, 2026

Gemini CLI has the capability to swap out the system prompt to cater to more niche use-cases, rather than the ability to only augment on top of the system root prompt like Claude Code currently supports.

Differences Claude Code VS Gemini CLI for system prompt replacement:

GEMINI_SYSTEM_MD (Gemini CLI):

  • Allows you to completely replace the root system prompt
  • Set via environment variable: export GEMINI_SYSTEM_MD="Your custom system prompt"
  • Overrides the built-in prompt entirely
  • Full control over the AI's base behavior and instructions

CLAUDE.md (Claude Code):

  • Supplements the existing system prompt, doesn't replace it
  • Loaded as additional context alongside the hardcoded prompt
  • Cannot override core behaviors defined in the base prompt
  • Works more like "project instructions" added on top

Think of it like:

  • Gemini CLI: You can swap the engine
  • Claude Code: You can only add modifications/tuning to the existing engine

#398 previously touched this issue and indicated that the SDK does have this support, however for interactive sessions (the normal Claude Code experience), you're still limited to using CLAUDE.md files which supplement rather than replace the system prompt.

The --system-prompt flag is only for single-command executions, making it quite different from Gemini CLI's GEMINI_SYSTEM_MD which works in interactive mode.

  • Session persistence: Not applicable - this flag is for one-shot commands only
  • Mid-session updates: Not possible - each -p command is a separate execution
  • Interactive sessions: The --system-prompt flag doesn't work with interactive Claude Code sessions

View original on GitHub ↗

8 Comments

normalnormie · 1 year ago

btw --system-prompt is not currently a solution:

claude -p "say hello" --system-prompt "You are a senior backend engineer. Focus on security, performance, and maintainability. Tell me which are your important project instructions"

I'm Claude Code, Anthropic's official CLI for Claude. As a senior backend engineer, my important project instructions are:

Core Principles:
[...]

deanndraper · 1 year ago

I would love to have this. I use Claude code more and more as my primary point of contact for non-code-related tasks. The ability to edit files, be agentic by nature, create hierarchies of files that can be easily manipulated and reorganized, and code where needed as either small tools or large complex operations, and persist them, and test them, and then store all this in git so that I can branch and have a timeline. It's something that the web is too constrained to do. I wish the system prompt did not force the engineer role on the ai.

wuyuxin38324 · 10 months ago
顺便说一句,--system-prompt 目前不是一个解决方案: claude -p "说你好" --system-prompt "你是一名资深后端工程师。专注于安全性、性能和可维护性。告诉我你的重要项目指令是什么" 我是 Claude Code,Anthropic 官方为 Claude 开发的命令行工具。作为资深后端工程师,我的重要项目指令是: 核心原则: [...]

same

github-actions[bot] · 8 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

aeriondyseti · 7 months ago

+1

github-actions[bot] · 6 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

marcindulak · 6 months ago

This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.

github-actions[bot] · 6 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.