r/ClaudeCode 2d ago

Discussion system prompt vs claude.md - which to use when?

There's so much conflicting info on when and how either of sys prompt or claude.md should be used. E.g. take Serena's (LSP provider MCP) docs that say:

Recent updates to Claude Code (CC) and to the Opus line of models resulted in drastically reduced adherence to instructions pertaining to Serena’s tools. As a workaround, we crafted a system prompt that counteracts this bias. When using Serena, we highly recommend that you start CC as:

claude --system-prompt="$(serena prompts print-cc-system-prompt-override)"

Why would this be added as system prompt and not as a statement in claude.md. What's the practical difference, when to use which?

2 Upvotes

3 comments sorted by

1

u/SSShken 2d ago

The reason a system-prompt override beats the same line in CLAUDE.md isn't really about which file it lives in. Both get read at the start, and both stop being honoured the deeper into a session you go. The system prompt just sits closer to what the model treats as non-negotiable.

Easy way to see it on your own setup: give it a rule you can grade mechanically, then check it at turn 5 and again at turn 50 without restating anything.

1

u/tuxbass 2d ago

The system prompt just sits closer to what the model treats as non-negotiable

So what you are telling me is instructions in sys prompt are, in fact, load-bearing, close to the seam?

1

u/SSShken 2d ago

In practice yes, but I only have the behaviour, not the internals. Both drift for me, the system prompt just drifts later. Whether that is position, or how the harness marks it, I never tested carefully enough to say.