System prompt
The instructions you give a language model upfront, before any user message. Sets the model's role, voice, rules and constraints for the whole conversation.
The system prompt is the instructions you give a language model at the start of a conversation, separate from the user’s actual question. It’s where you set the model’s role (“you’re a senior bookkeeper”), voice (“write in Australian English”), and rules (“never invent ATO ruling numbers”).
In Claude Code, the system prompt is largely the contents of your CLAUDE.md file plus the harness’s own system instructions. In Claude.ai, you don’t directly edit it; in the API, you pass it as the system parameter.
Why it matters
A good system prompt shapes every response. A bad one (or no system prompt) lets the model wander.
Common patterns:
- Role. “You’re a tax-advisor’s assistant. You don’t give advice; you draft, classify and summarise for the advisor to review.”
- Voice. “Australian English. AUD. DD/MM/YYYY. No em dashes.”
- Format. “Output as markdown with H2 sections. No more than 600 words.”
- Constraints. “Don’t invent statistics. Don’t claim something is regulated unless you can cite the regulator.”
- Examples. “When asked for a quote, structure like: Scope / Deliverables / Timeline / Investment.”
Cost implications
The system prompt re-enters the context on every turn, but it caches well (Anthropic and OpenAI both cache stable system prompts at ~10% of the normal rate). A long, stable system prompt is fine on cost; a long system prompt that changes mid-session is wasteful.
Keep system prompts under 4k tokens if you can. Beyond that, audit for redundancy.
Where it lives in Claude Code
~/.claude/CLAUDE.md, global, applies to every session<project>/CLAUDE.md, project-specific, layered on top of global<project>/.claude/skills/<name>/SKILL.md, skill-scoped instructions, loaded when the skill is invoked
Claude Code concatenates these intelligently. You don’t need to manage one giant file.
Related terms
Want this built for your business?
Book a free 30-minute AI audit. We'll map your business and show you exactly which systems we'd build first. No pitch deck, no scoping fee.
Book my free AI audit