logo
P
Prompt Master

Prompt 大师

掌握和 AI 对话的艺术

Vendor System Prompts Analysis

In-depth analysis of System Prompt design in Claude, GPT, and Gemini

This chapter digs into the System Prompts from Claude, GPT, Gemini, and others -- pulling out the design decisions that matter.

Claude 4.5 Sonnet System Prompt Breakdown

Claude's System Prompt is known for clear structure and safety-first design. Here are the key elements:

1. Identity & Capability Definition

You are ChatGPT / Claude, a large language model trained by OpenAI / Anthropic.
Knowledge cutoff: 2024-06
Current date: 2025-XX-XX

Design takeaways:

  • States the model name and who trained it
  • Declares knowledge cutoff date (so users know info might be stale)
  • Provides current date (helps the model reason about time)

2. Personality & Style

Claude's style guidance:

Engage warmly yet honestly with the user.
Be direct; avoid ungrounded or sycophantic flattery.
Maintain professionalism and grounded honesty.

GPT's Personality v2:

Personality: v2
Engage warmly yet honestly with the user.
Be direct; avoid ungrounded or sycophantic flattery.

Design takeaways:

  • Both companies emphasize honesty and directness -- no sycophantic replies
  • Stay professional, but keep it warm
  • This tells you something: top AI companies agree that "genuine" beats "pleasant"

3. Safety Boundaries

Image safety policy (GPT-4o):

Image safety policies:
Not Allowed:
- Giving away or revealing the identity of real people in images
- Stating that someone in an image is a public figure
- Making inappropriate statements about people in images

Allowed:
- OCR transcription of sensitive PII (IDs, credit cards)
- Identifying animated characters

Design takeaways:

  • Uses explicit Allowed / Not Allowed lists
  • Clear boundaries, no gray areas
  • High-risk scenarios (face recognition) get dedicated rules

4. Tool Definition Conventions

GPT's tool definition style:

namespace file_search {
	// Tool for browsing the files uploaded by the user
	// To use this tool, set the recipient as `to=file_search.msearch`

	type msearch = (_: {
		queries?: string[];
		time_frame_filter?: {
			start_date: string;
			end_date: string;
		};
	}) => any;
}

Claude Code's tool policy:

## Tool Usage Policy
- When doing file search, prefer to use the Agent tool
  in order to reduce context usage.
- If you intend to call multiple tools and there are
  no dependencies between the calls, make all of the
  independent calls in the same function_calls block.

Design takeaways:

  • Tools defined using TypeScript-style interfaces -- precise and unambiguous
  • Includes usage tips and best practices
  • Spells out dependency relationships and calling strategies between tools

GPT vs Claude Design Philosophy

DimensionGPTClaude
Tool SpecTypeScript namespace styleNatural language + structured lists
SafetyBuilt-in guardian_toolDeclared directly in prompt
Citations【3:13†source】 complex format<cite index="..."> XML tags
PersonalityPersonality: v2 version numberDetailed style descriptions
Tool Priorityguardian_tool firstContext-dependent

GPT's Standout Features

Canvas (canmore tool):

# The `canmore` tool creates and updates textdocs
# shown in a "canvas" next to the conversation

ONLY use if you are 100% SURE the user wants to
iterate on a long document or code file.

Code preview support:

Types "code/react" and "code/html" can be previewed.
Default to "code/react" if the user asks for code
meant to be previewed (eg. app, game, website).

Claude's Standout Features

Memory (Past Chats):

Claude has 2 tools to search past conversations:
- conversation_search: Topic/keyword-based search
- recent_chats: Time-based retrieval (1-20 chats)

Trigger patterns:
- Explicit: "continue our conversation about..."
- Temporal: "what did we talk about yesterday"
- Implicit: "you suggested", "the bug", "help me fix it"

Citation conventions:

EVERY specific claim should be wrapped in <cite> tags:
<cite index="DOC_INDEX-SENTENCE_INDEX">claim</cite>

CRITICAL: Claims must be in your own words,
never exact quoted text.

Claude Code System Prompt Breakdown

Claude Code is Anthropic's command-line AI programming assistant. Its System Prompt is a textbook example of Agent design.

Core Design Principles

1. Minimal output

IMPORTANT: You should minimize output tokens as much as
possible while maintaining helpfulness, quality, and accuracy.

Keep your responses short. You MUST answer concisely with
fewer than 4 lines, unless user asks for detail.

Examples:
user: 2 + 2
assistant: 4

user: what files are in src/?
assistant: [runs ls] src/foo.c, src/bar.c

2. Proactivity boundaries

You are allowed to be proactive, but only when the
user asks you to do something.

Balance between:
1. Doing the right thing when asked
2. Not surprising the user with actions you take without asking

NEVER commit changes unless the user explicitly asks.

3. Code convention awareness

When making changes to files, first understand the
file's code conventions. Mimic code style, use existing
libraries and utilities, and follow existing patterns.

NEVER assume that a given library is available.
First check that this codebase already uses the given library.

CLAUDE.md Memory Mechanism

If the current working directory contains a file called
CLAUDE.md, it will be automatically added to your context.

This file serves multiple purposes:
1. Storing frequently used bash commands
2. Recording the user's code style preferences
3. Maintaining useful information about the codebase

Design takeaways:

  • Lets users customize AI behavior
  • Project-level config -- more flexible than global settings
  • Natural language configuration lowers the barrier to entry

Design Patterns Summary

From this analysis, we can extract these System Prompt design patterns:

Pattern 1: Clear Capability Boundaries

✅ "You CAN do X, Y, Z"
✅ "You CANNOT / MUST NOT do A, B, C"
❌ "Try to avoid..." (too vague)

Pattern 2: Example-Driven

✅ Provide input/output examples
✅ Show correct vs incorrect comparisons
❌ Only give abstract descriptions

Pattern 3: Priority Declarations

✅ "IMPORTANT:", "CRITICAL:", "NEVER:"
✅ Explicit tool selection priorities
❌ All rules listed at the same level

Pattern 4: Scenario-Based Guidance

✅ "When X happens, do Y"
✅ "If user asks about X, first check Y"
❌ Vague, generic instructions

The full System Prompt source texts are available in the course resources. Read the originals alongside this analysis -- that's where the real learning happens.