System prompt
The instructions sends before your conversation. See what it is, how it works, how it is used and what to watch for, with pictures and examples.
What it is
The is the set of instructions puts in front of your conversation on every request. It tells how to use tools, how to act safely and how to format answers. You never type it yourself, but it shapes every reply. By default, Claude Code builds it once on the first request of a conversation and keeps using that recorded copy until the conversation is compacted.
How it works
-
You start Claude Code
-
Claude Code builds the default
-
Your flags add or replace text
-
Every request sends it first
How to use it
-
--append-system-promptadds your text to the end of the default prompt, for example
claude --append-system-prompt "Always use TypeScript". -
--append-system-prompt-fileadds the contents of a file, good for long rules.
-
--system-promptreplaces the whole default prompt, for an that is not a assistant.
-
--system-prompt-snapshot offrebuilds the prompt on every request while you test new wording across
--continueruns.
Watch out
Replacing the prompt drops the default tool guidance and safety instructions, so you must add back what your task still needs. Appending is the safer choice when Claude should stay a coding assistant. CLAUDE.md and output style instructions are not inside the system prompt; they reach Claude as system reminders.
Related terms
Original and official docs
This page explains the term in plain words. The original is the authority: if they differ, follow the original.