System prompt
The behind-the-scenes instructions that configure an AI's role, persona, constraints, and behavior before the conversation begins. In Claude Code's architecture the CLAUDE.md file acts as a form of persistent system context: it is injected into every session so Claude always has your project's background. When you build your own agents on top of the Claude API, you write a system prompt explicitly to define how the agent behaves, what tools it can use, and what it should refuse to do.
A system prompt is the set of instructions that configures an AI's role and behavior before a single user message arrives. It defines who the assistant is supposed to be, what it is allowed to do, the constraints it must respect, and the tone it should take. Where a regular prompt is a request inside the conversation, the system prompt is the frame around the whole conversation - it is always in effect, shaping every response.
In Claude Code you usually do not write a raw system prompt by hand, because the tool ships with a carefully designed one that makes Claude a capable, safe coding agent. What you do control is the persistent context layered on top of it: your CLAUDE.md files act as standing, system-level instructions that are injected into every session, so your project's stack, conventions, and rules are always part of the frame. In practice, editing CLAUDE.md is how most builders shape Claude Code's behavior without ever touching the underlying system prompt.
When you graduate from using Claude Code to building your own agents on the Claude API, the system prompt becomes something you write explicitly. There you decide the agent's job, the tools it can call, the format of its output, and - just as importantly - what it should refuse to do. A clear, well-scoped system prompt is the foundation of a reliable agent: it is the difference between a focused assistant that stays on task and a vague one that drifts. Writing good system prompts is a natural next step once you are comfortable with everyday prompting.
Related terms
Put it to work
Learn it by building it
Definitions get you oriented. The club gets you shipping. Join Claude Code Club for $9/month.
Related: the full glossary, the learn hub, and our guides.
