beginnerChapter 1 of 12

Basic Prompt Structure

Messages API formatting · User/assistant roles · System prompts

How Claude Reads Your Prompts

Every interaction with Claude happens through the Messages API. You send a list of messages, each with a role (user or assistant) and content.

{
  "messages": [
    { "role": "user", "content": "Count to three." }
  ]
}

System Prompts

A system prompt sits outside the message list and sets the overall context, personality, or rules for the conversation. Think of it as stage directions for Claude before the curtain goes up.

{
  "system": "You are a concise assistant. Reply in as few words as possible.",
  "messages": [
    { "role": "user", "content": "What is the capital of France?" }
  ]
}

Key Takeaways

  • Claude's behavior is shaped by the system prompt plus the sequence of user and assistant messages.
  • Being explicit about what you want in the very first message sets the tone for the rest of the conversation.
  • The system prompt is the right place for persistent rules, tone, or persona — not the user message.

Exercises