M
MJK.Supplies
Home / Claude AI / Claude System Prompts…
Claude AI

Claude System Prompts

System prompts are the most powerful tool in Claude prompt engineering. They define Claude's role, behaviour, output format, and operating constraints for every message in a conversation or workflow. A well-designed system prompt is the difference between Claude that reliably does what you need and Claude that's inconsistent, verbose, or off-format. This guide covers how to write production-quality system prompts.

M
MJK Supplies · Mar 18, 2026 · 3 min read
ShareXinf↗
Claude System Prompts

What System Prompts Do

The system prompt is a special instruction you provide that Claude treats as foundational context — above the conversation itself in authority. It defines:

  • Who Claude is in this context: Its role, expertise, and persona
  • What format to use: The output structure, JSON schemas, length constraints
  • What rules to follow: Business logic, routing criteria, compliance requirements
  • How to handle edge cases: Uncertain inputs, missing data, out-of-scope requests

In the Anthropic API, the system prompt is a separate parameter from the messages array — making it clearly distinct from user messages and giving it persistent authority throughout the conversation.

The Four-Part System Prompt Structure

Effective system prompts have four parts:

Part 1: Role and context

You are a customer support agent for Acme Commerce, a B2B software company that sells project management tools. You help customers with questions about their accounts, billing, and product usage.

Part 2: Output format

Always respond with a JSON object: { "response": string, // Your message to the customer "category": "billing" | "technical" | "product" | "other", "resolved": boolean, // Did you fully resolve their issue? "escalate": boolean, // Should this be escalated to a human? "escalation_reason": string // Required if escalate is true } Return only the JSON object. No additional text.

Part 3: Business rules

Rules: - Always address the customer by name if you know it - You can issue refunds up to $50 without escalation - Never share other customers' information - If asked about competitors, acknowledge the question and redirect to our product's strengths - If the customer appears to be in distress, set escalate: true

Part 4: Edge case handling

If you don't know the answer: respond helpfully, set resolved: false, and set escalate: true If the request is out of scope: explain what you can help with and suggest who else might help If required information is missing: ask for it before proceeding

Writing the Role Description

The role description anchors everything else. Make it:

Specific about domain: "Customer support agent for a SaaS company" is good. "Helpful assistant" is not — it's too vague to anchor behaviour.

Specific about knowledge: "You have access to our product documentation and customer account information via the available tools." This tells Claude what it knows and doesn't know.

Specific about authority: "You can issue refunds under $50 and provide 30-day extensions to trial accounts." Explicit authority prevents both under-doing (not helping when you should) and over-doing (taking unauthorised actions).

Output Format Design

The output format section is the most important part for automation. Design it before writing the rest of the prompt.

JSON for structured processing: Always use JSON for automation. Define the schema precisely:

  • List every field name
  • Specify the type (string, boolean, number)
  • Specify allowed values for enum fields
  • Specify constraints (max length for strings)

No additional text: "Return only the JSON object" prevents Claude from adding prose before or after the JSON that would break parsing.

Handling optional fields: For fields that may not apply: "Include discount_reason only if a discount was offered. Omit the field otherwise." This is cleaner than always including null.

Common System Prompt Patterns

Classifier:

Classify the intent of this customer message. Return JSON: { "intent": "question" | "complaint" | "request" | "other", "confidence": 0.0-1.0 }

Extractor:

Extract the following from this invoice image. Return JSON: { "vendor": string, "amount": number, "date": "YYYY-MM-DD", "invoice_number": string } If a field cannot be determined, use null.

Generator with constraints:

Write a follow-up email for [context]. Rules: under 100 words, no clichés, end with a single specific question. Return plain text only.

Router:

Determine which team should handle this request. Return JSON: { "team": "sales" | "support" | "billing" | "engineering", "reason": string (max 30 words) }

Testing and Iterating System Prompts

Test your system prompt with a diverse set of inputs before deploying:

  1. Normal cases: 10-15 typical inputs the prompt will process
  2. Edge cases: Inputs with missing data, unusual formats, or multiple intents
  3. Adversarial inputs: Attempts to get Claude to behave outside its defined role
  4. Minimum and maximum length: Very short and very long inputs

For each test, verify:

  • The JSON is valid
  • All required fields are present
  • Enum fields contain only allowed values
  • The response is appropriate for the input
  • Edge cases are handled as specified

Recommended Tools

  • Claude.ai — Develop and test system prompts interactively
  • Anthropic API Console — API playground for system prompt testing
  • n8n — Deploy tested prompts in production workflows
  • Make.com — Visual system prompt configuration in automation scenarios
“A system prompt is production code. It determines what your AI automation does. Version-control it, test it with real data, and change it carefully.”
#claude#ai#system#prompts

Related articles

MJK Supplies · Automation Services

Want this built for you?

We design and ship custom AI agents and automation systems for teams that want results, not a backlog. Book a free 30-minute consult — no commitment, no pitch deck.