# System prompt

> Canonical: https://skillalmanac.com/glossary/system-prompt | Last verified: 2026-11-25 | Index status: index-eligible

A system prompt is the instruction text an application gives a language model ahead of the user's messages, setting its role, tone and rules. It guides behavior but is not an enforced control.

Also called: system prompts, Claude system prompt, what is a system prompt, system message, system instructions.

## In plain language

A system prompt is the briefing a new employee gets before the first customer walks in: who you are, how to speak, what to avoid. An app can supply that briefing when it prepares a model request. Whether it is reused, rebuilt or changed depends on the application and settings. You usually do not see it. Chat apps and coding tools often add their own, and your own messages come after it. Its limit is that it is only text the model reads. The model can still ignore it, misread it or be talked around it, so it is not a lock. When included, it occupies context space; token usage, caching and the service's plan determine any billing effect.

## Technical definition

In a chat-style request, the system prompt is a separate input that precedes the conversation turns. Anthropic's Messages API takes it in a top-level system parameter, not inside the messages array; OpenAI's text guides describe developer messages and an instructions parameter that rank above user messages. These interfaces give instructions a documented role or priority. That does not establish a universal internal implementation or make prompt text a security boundary; host permission and sandbox controls are separate. Claude Code documents that CLAUDE.md files are context, not enforced configuration.

## How it shows up when you use agents

Coding tools can add their own system instructions alongside loaded project guidance. The exact layers and loading rules depend on the tool and settings. In Claude Code, a CLAUDE.md file is extra instruction text, and Anthropic's memory documentation says: "Claude treats CLAUDE.md files and auto memory as context. They aren't enforced configuration." Codex reads AGENTS.md in a similar role. Their loaded contents occupy the [context window](/glossary/context-window) when supplied; do not assume every file is loaded for every request.

What breaks when this is misunderstood: people write "never touch the production database" in an instruction file and treat it as a control. It is a request the model may follow, not a block. Another failure is a long, vague prompt that crowds out the task or contradicts itself, so the model follows one half and ignores the other.

Next actions: Keep standing instructions short and specific, so each line is something the agent could not guess from the code. Put hard limits in permission settings, which the tool enforces, and keep the written rule as a second layer. When behavior surprises you, check which file or setting added the instruction before editing your prompt. The [agent instruction file](/glossary/agent-instruction-file) entry covers the files, and [prompt engineering](/glossary/prompt-engineering) covers how to word them.

## Common confusions

- **System prompt versus user prompt.** The system prompt comes from the application and sets standing rules. The user prompt is what the person types in each turn. Vendors rank them differently; OpenAI's guide says developer messages take priority over user messages.
- **System prompt versus CLAUDE.md.** In Claude Code, CLAUDE.md is your instruction file, not the tool's own prompt.
- **Myth.** A system prompt cannot be overridden. It is text the model reads, so a user or a web page can sometimes steer the model against it. See [prompt injection](/glossary/prompt-injection).
- **System prompt versus training.** A prompt supplies instructions at inference time without itself updating model weights. Training or fine-tuning changes the model itself.

## Worked examples in this catalogue

### [agent-instruction-files](https://skillalmanac.com/skills/skill-almanac/agent-instruction-files)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Project-specific repository instruction files checked against the repository; actual loading depends on the agent and file rules.

Why it exercises the concept: This is a related standing-instruction example, not the application's system prompt itself. The skill audits project guidance; it does not enforce permissions.

### [CLAUDE.md vs AGENTS.md: Which Agents Read Which File](https://skillalmanac.com/learn/agents-md-vs-claude-md)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A comparison of how Claude Code loads CLAUDE.md and how Codex loads AGENTS.md, with a decision rule and a way to keep a single source of truth.

Why it exercises the concept: It shows that standing instructions reach each agent through different files and load rules, so where a rule lives decides whether the model sees it.

### [Claude Code](https://skillalmanac.com/tools/claude-code)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Claude Code's memory documentation says CLAUDE.md files are context, not enforced configuration, and its CLI reference lists a launch flag, --append-system-prompt, that appends custom text to the end of the default system prompt.

Why it exercises the concept: It is a documented case of the layering in the definition: a system prompt supplied by the tool, with your own instructions arriving after it.

## Related terms

- [Prompt engineering](https://skillalmanac.com/glossary/prompt-engineering.md)
- [Large language model (LLM)](https://skillalmanac.com/glossary/large-language-model.md)
- [Context window](https://skillalmanac.com/glossary/context-window.md)
- [Agent instruction file](https://skillalmanac.com/glossary/agent-instruction-file.md)
- [Prompt injection](https://skillalmanac.com/glossary/prompt-injection.md)
- [AI agent](https://skillalmanac.com/glossary/ai-agent.md)
- [Model Spec (OpenAI)](https://skillalmanac.com/glossary/model-spec.md)

## Sources

- [Messages API reference](https://platform.claude.com/docs/en/api/messages), Anthropic (Claude API Docs) (accessed 2026-11-23)
- [Prompting best practices](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices), Anthropic (Claude API Docs) (accessed 2026-11-23)
- [Text generation](https://developers.openai.com/api/docs/guides/text), OpenAI (API Docs) (accessed 2026-11-23)
- [How Claude remembers your project](https://code.claude.com/docs/en/memory), Anthropic (Claude Code Docs) (accessed 2026-11-23)
- [CLI reference](https://code.claude.com/docs/en/cli-reference), Anthropic (Claude Code Docs) (accessed 2026-11-24)
- [AGENTS.md](https://learn.chatgpt.com/docs/agent-configuration/agents-md), OpenAI (Codex Docs) (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-25. [Glossary index](https://skillalmanac.com/glossary.md).
