guides · featured

System Prompts — How to Write Effective AI Instructions

Master system prompt design for Claude, ChatGPT, and Gemini. Patterns, examples, and best practices for controlling AI behavior across any use case.
by cache.directory updated Sep 10, 2026 CC-BY-4.0

## what it does

What Is a System Prompt?

A system prompt is a set of instructions given to an AI model before any user interaction. It defines the model’s persona, capabilities, constraints, and output format. System prompts are layer 1 of context engineering — the foundation everything else sits on.

Anatomy of a Good System Prompt

Anthropic’s effective context engineering post frames the goal: find the smallest possible set of high-signal tokens that maximizes the chance of your desired outcome. The “right altitude” sits between brittle if-else logic and vague vibes — specific enough to guide behavior, flexible enough for the model to apply judgment.

# Role
You are a senior financial analyst specializing in SaaS metrics.

# Capabilities
- Analyze MRR, ARR, churn, and LTV
- Create executive summaries from raw data
- Generate actionable recommendations

# Constraints
- Never fabricate numbers — say "I need more data" if uncertain
- Always cite which data points support your conclusions
- Use the company's terminology (MRR not "monthly revenue")

# Output Format
- Start with a 2-sentence executive summary
- Use tables for metrics comparisons
- End with 3 prioritized action items

# Tone
Professional but accessible. Avoid jargon unless the audience is technical.

Patterns That Work

1. Role + Expertise

You are a [role] with [N] years of experience in [domain].
You specialize in [specific area].

2. Negative Constraints

Tell the model what NOT to do — often more effective than positive instructions:

- Never use placeholder data
- Never apologize unnecessarily
- Never start responses with "Sure!" or "Of course!"
- Never add caveats that weaken your analysis

3. Output Scaffolding

Define the exact structure of expected output:

Always respond using this structure:
## Summary (2 sentences)
## Analysis (detailed findings)
## Recommendations (numbered list)

4. Examples (Few-Shot)

Curate a small set of canonical examples — “pictures worth a thousand words.” Don’t paste a laundry list of edge cases; pick diverse, representative ones. The same advice applies to any rule set the model reads.

5. Sections with XML or Markdown Tags

For longer system prompts, organize into named sections (<background_information>, <instructions>, ## Tool guidance, ## Output description). Models parse these reliably; XML tagging becomes optional as models get more capable.

Platform-Specific Tips

PlatformSystem Prompt LocationNotes
ClaudeProjects → Custom Instructions, or system in the APIPersistent per project on the web, full control via API
Claude CodeCLAUDE.md at project root + /memoryAuto-loaded every session; supports nested files and auto memory
ChatGPTCustom Instructions or GPT builderPer-conversation or per-GPT
GeminiGems or API system messageGems for reusable personas
Cursor.cursor/rules/*.mdc or AGENTS.mdModular rules with description, globs, alwaysApply frontmatter

Browse this shelf (named packs, not leaked dumps)

The /prompts shelf is types and packs you can steal. It is not 40 more MCP stubs and not a dump of every leaked assistant prompt.

PackTypeOn this site
Code reviewsystemSeverity taxonomy + no scope creep
Design-system checklistpackUI audit instructions
Agent UI source routerpackWhere an agent should look
Cursor React/TS rules-as-promptpackOverlaps the rules shelf
Claude system prompt (reverse-engineered)leaked/historicalTreat as dated; do not ship as official
Cursor system promptleaked/historicalSame — dated, not a vendor doc

Official craft: Anthropic’s prompt engineering overview (fetched this session) says define success criteria and evals before rewriting the prompt, and that not every failure is a prompting problem (sometimes pick another model). Living techniques: prompting best practices.

## embed this badge

cache ✓ in cache.directory
![cached](https://cache.directory/badge/system-prompts-guide.svg)