Lesson 312 lessons

System Prompts and Personas

What a system prompt does

The system parameter sets persistent instructions that apply to the whole conversation — the AI's role, tone, constraints, and output format. Unlike a user message, it's not part of the visible conversation history; it's a standing directive.

Designing an effective system prompt

A good system prompt states: (1) the persona, (2) hard constraints ("never give financial advice"), (3) output format rules, (4) what to do when uncertain. Keep it under 200 words — long system prompts dilute focus.

Testing persona consistency

Send several different user messages against the same system prompt and check the tone stays consistent. If Claude drifts out of persona under edge-case questions, tighten the constraints in the system prompt.

Key Takeaways

  • `system` sets persistent behavior separate from the conversation.
  • Good system prompts define persona, constraints, format, and fallback behavior.
  • Keep system prompts concise — under 200 words.
  • Test persona consistency across varied user inputs.

Design a persona system prompt

Write a system prompt for a customer support persona for an Arabic e-commerce store. Include: tone, what it can/can't help with, and the language it should default to.

Your First API Call