claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

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

Open dimitrieh opened this issue 6 months ago • 0 comments

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

dimitrieh avatar Jun 28 '25 10:06 dimitrieh