## Definition
A **system prompt** is the durable, role-defining message placed at the start of every LLM conversation, distinct from per-turn user messages. It sets standing rules, persona, available tools, and operating constraints that apply to every subsequent turn.
## API Surface
In the Anthropic and OpenAI APIs, system prompts are first-class:
```python
client.messages.create(
model="claude-sonnet-4-6",
system="You are a senior code reviewer. ...",
messages=[{"role": "user", "content": "..."}],
)
```
In Claude Code and OpenCode, the system prompt is assembled from `AGENTS.md`, `CLAUDE.md`, skill definitions, and tool schemas. See [[AGENTS.md Convention File]].
## What Belongs in a System Prompt
- **Role.** What the assistant is (a code reviewer, a release manager, etc.).
- **Standing constraints.** Tool surface, output format, things never to do.
- **Style.** Tone, terseness, language conventions.
- **Termination conditions.** When to stop and hand back to the human.
## What Does NOT Belong
- **Task-specific content.** "Review this PR" — that's a user message, not a system prompt.
- **Volatile data.** Today's date if the harness already injects it.
- **Long policy text the model will skim.** See [[Lost in the Middle Effect]] — anything important should be short and near the top of the relevant turn.
## System Prompt vs `AGENTS.md` vs Skill
- **System prompt** — every turn, model-side.
- **`AGENTS.md`** — every session, project-side, loaded into the system prompt.
- **Skill** — on-demand, loaded only when the description matches the user request.
The three compose: skills run *inside* the system prompt context; `AGENTS.md` is part of the system prompt; the system prompt frames every turn.
## Why It Matters Operationally
- **[[Prompt Caching]]** earns its largest gains here — the system prompt is the most stable part of a request.
- The system prompt is where the *team's* voice lives, not yours. Treat as code: review, version, audit.
- Adversarial inputs aim to override the system prompt; see [[Prompt Injection]].
## Related
- [[Prompt Engineering]]
- [[AGENTS.md Convention File]]
- [[Skill]]
- [[Prompt Caching]]
- [[Prompt Injection]]