System Prompt
Status Fixed / completed
Maintainer reply None cached
Activity 8 comments · opened Mar 8, 2025 · closed Mar 10, 2025
Hey team, how do I include a system prompt with claude code?
I've been looking at the docs, I didn't see it, and I could have just missed it.
thx
R
8 Comments
You can't include a system prompt in the traditional sense, but CLAUDE.md files essentially work as system prompts. If you add a CLAUDE.md file to the root of the project that you are running Claude Code in, then it will get automatically pulled in as context. (You can also run /init in the Claude Code REPL, which will cause claude to create a CLAUDE.md file based on the codebase). You can also add CLAUDE.md files to sub directories with instructions scoped to those specific folders that get automatically pulled in when Claude reads/edits a file from that folder.
I believe you can also add a ~/.claude/CLAUDE.md file for a more global system prompt with user-specific instructions you want to exist across projects.
Outstanding!! Thank you this tool is outstanding.
is there a system message in claude code? I am just trying to figure out, if I have to be careful with the content in CLAUDE.md files, to not cause any ambiguities?!
!Image
It’s in the docs, it’s only available in the non-interactive mode. But you can easily script a set of subprocesses with
-p —system-prompt —continueto give you a similar interface to the REPL while overriding the system prompt if you really think that helps.As an additional note you should run away from ambiguity like it’s the devil, both with Claude and with humans.
@rodat-dev can you elaborate?
Edit: Asked AI 😅:
---
Some context:
GEMINI_SYSTEM_MD (Gemini CLI):
CLAUDE.md (Claude Code):
Think of it like:
Important distinctions:
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.
---
I'll open up a new issue: https://github.com/anthropics/claude-code/issues/2692
Yep, but I don't see why you'd want to replace the system prompt built by Boris and all the people working to build Claude as a coding agent. It's their job to know the ins and outs of the model. You don't buy a Ferrari and your first thought is "but can I put my Volkswagen engine in it?". Not an attack, I'm no better, but I think supplementing what these guys have built is inevitably going to be the best option. They've done a phenomenal job with Claude Code.
@agentmish I fully agree with you. The usecases for completely replacing it with a "Volkswagen engine" 🙃 would be for an occasional niche "not-coding-agent" usecase.
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.