AI & Claude

12 Claude Prompt Codes for Better AI Outputs

A practical cheat sheet of 12 Claude prompt patterns to improve AI outputs. Learn to use XML tags, artifacts, and constraints for better results.

A practical cheat sheet of 12 Claude prompt patterns and codes to improve AI outputs, covering roles, context, constraints, formatting, and artifacts. These techniques, based on official Anthropic guidance, help builders, founders, and creators reduce generic responses and generate higher-quality drafts.

TL;DR

  • Structure prompts using clear roles, context, and constraints to eliminate vague Claude outputs.
  • Use XML tags and few-shot examples to guide Claude's tone, format, and technical accuracy.
  • Apply a draft, review, and refine workflow to turn first drafts into polished, actionable deliverables.
  • Combine multiple prompting codes into reusable stacks for content creation, research, and decision-making.

Read This First

"Claude codes" is a memorable name for the prompt patterns in this guide.

These are not hidden commands, secret shortcuts, or universal slash commands built into Claude. They are practical prompting structures based on official Anthropic guidance and broadly reliable ways to give Claude clearer instructions.

The goal is simple:

  • Reduce vague and generic answers
  • Give Claude the context it needs
  • Control the format, tone, and depth
  • Produce work that is easier to use
  • Improve the first draft through structured review

You do not need to use all 12 patterns in every prompt. Start with the two or three that solve your current problem.

The Quick Reference

Code Prompt Pattern Use It When You Need
01 Role + Task A clearer perspective and responsibility
02 Context + Goal A response tailored to your real situation
03 Constraints + Success Criteria Precise output that follows your boundaries
04 Clarify Before Answering Fewer assumptions on ambiguous tasks
05 XML / Section Blocks Cleaner separation of complex prompt inputs
06 Request the Output Format A table, checklist, JSON, template, or fixed structure
07 Few-Shot Examples Consistent tone, format, or classification
08 Plan, Then Execute Better sequencing on complex work
09 Tone + Audience Transform Writing adapted to a specific reader
10 Table / Checklist / Comparison Information that supports decisions
11 Create an Artifact A reusable document, tool, visual, or interactive output
12 Draft → Review → Refine A stronger second version with fewer weak spots

Code 01: Role + Task

Give Claude a useful working role and pair it with one clearly defined task.

A role helps focus the perspective, expertise, priorities, and communication style Claude should use. The task tells it what must actually be produced. Avoid assigning an impressive-sounding role without giving it a concrete responsibility.

Simple Formula

text You are a [relevant role].

Your task is to [specific task].

The result should help [audience] achieve [desired outcome].

Copy-Ready Prompt

text You are a senior growth strategist.

Your task is to create a 30-day Instagram content plan for a bootstrapped SaaS founder.

The plan should help the founder build authority, generate qualified conversations, and publish consistently without a large content team.

Why It Improves the Output

  • Establishes the perspective Claude should use
  • Reduces irrelevant advice
  • Makes the task and expected outcome explicit
  • Produces recommendations that feel more specialized

Best Used For

Strategy, copywriting, analysis, coaching, planning, coding, research, and decision support.

Practical Tip

Use the most relevant role, not the most prestigious one. "B2B lifecycle email strategist" is often more useful than "world-class marketing expert."

Code 02: Context + Goal

Give Claude the background it would need if it were joining your project as a new teammate.

Context can include your audience, business model, existing assets, constraints, current situation, previous attempts, source material, and the reason the task matters. The goal defines the outcome you are trying to create.

Simple Formula

text [Relevant background]

[Desired outcome] [What Claude should do]

Copy-Ready Prompt

text I create practical AI education for builders, students, freelancers, creators, founders, and operators in India. My content should help people move from consuming AI content to building useful workflows and skills.

Create an Instagram carousel people will save because it is immediately useful. Turn the topic below into an 8-slide carousel with a strong hook, six educational slides, and one CTA slide.

Why It Improves the Output

  • Reduces guesswork
  • Makes recommendations relevant to your situation
  • Helps Claude understand why the task matters
  • Prevents generic one-size-fits-all responses

Best Used For

Brand content, business strategy, project planning, consulting, personal advice, customer research, and technical tasks.

Practical Tip

Include only context that can influence the answer. More context is useful only when it is relevant and organized.

Code 03: Constraints + Success Criteria

Define the boundaries Claude must work within and explain what a successful answer should achieve.

Constraints control the answer. Success criteria help Claude optimize the answer. Useful constraints include:

  • Word or character limit
  • Audience knowledge level
  • Required points
  • Prohibited claims
  • Tone and reading level
  • Budget, time, tools, or resources
  • Output structure
  • Accuracy and sourcing requirements

Simple Formula

text Create [deliverable].

Requirements:

  • [Requirement 1]
  • [Requirement 2]
  • [Requirement 3]

Avoid:

  • [Unwanted pattern 1]
  • [Unwanted pattern 2]

A successful result should:

  • [Success criterion 1]
  • [Success criterion 2]

Copy-Ready Prompt

text Write 10 Instagram hooks about AI automation.

Requirements:

  • Each hook must be under 12 words
  • Use simple modern English
  • Make the practical benefit clear
  • Write for founders and operators

Avoid:

  • Hype
  • Fear-based claims
  • “AI will replace you”
  • Generic phrases such as “unlock your potential”

A successful hook should create curiosity without making a misleading promise.

Why It Improves the Output

  • Keeps the response focused
  • Reduces unwanted styles and formats
  • Makes subjective quality easier to judge
  • Helps Claude follow your real-world limitations

Best Used For

Writing, design briefs, coding tasks, recommendations, marketing, research, and operational planning.

Practical Tip

Tell Claude what to produce, not only what to avoid. Positive instructions are usually easier to follow than a long list of negatives.

Code 04: Clarify Before Answering

How do I stop Claude from making assumptions on complex tasks?

Allow Claude to ask a limited number of questions when missing information would materially change the answer. This pattern is useful when the request could reasonably lead to several different outputs. It is less useful for simple tasks where Claude can make safe assumptions.

Simple Formula

text Before answering, check whether any essential information is missing.

Ask up to [number] clarifying questions only if the answers would materially change your recommendation.

If the task is sufficiently clear, proceed without asking questions.

Copy-Ready Prompt

text Help me choose the best automation platform for this workflow.

Before recommending a platform, ask up to 3 clarifying questions only if the answers would materially change the recommendation.

If you already have enough information, proceed directly.

After that, compare the strongest options and recommend one.

Why It Improves the Output

  • Prevents Claude from inventing assumptions
  • Surfaces missing requirements early
  • Produces recommendations that fit the situation
  • Reduces unnecessary revisions later

Best Used For

Consulting, purchasing decisions, technical architecture, business strategy, hiring, travel planning, and complex writing requests.

Practical Tip

Limit the number of questions. Without a limit, the conversation can turn into an interview instead of producing useful work.

Code 05: XML / Section Blocks

Separate different types of information using clear, descriptive tags.

Anthropic recommends XML-style tags when prompts combine instructions, context, examples, documents, and variable inputs. The tags help Claude distinguish what each section is for. The tags do not need to follow a predefined vocabulary. Use names that clearly describe the content.

Simple Formula

text [Background]

[What Claude should do] [Content Claude should process] [Required format and constraints]

Copy-Ready Prompt

text The audience is learning AI automation for the first time.

Explain the workflow in simple language. Preserve technical accuracy. A lead enters a CRM, receives a personalized email sequence, and is routed to a salesperson when they reply positively. Return: 1. A plain-English explanation 2. A numbered workflow 3. The tools required 4. Three common implementation mistakes

Why It Improves the Output

  • Reduces ambiguity in long prompts
  • Separates source material from instructions
  • Makes reusable prompt templates easier to maintain
  • Helps Claude process multiple documents or examples

Best Used For

Long prompts, research, document analysis, content pipelines, coding agents, reusable templates, and API workflows.

Practical Tip

Use consistent tag names. Do not create ten sections when four clear sections will do.

Code 06: Request the Output Format

Tell Claude exactly how the final response should be structured.

Do not assume Claude knows whether you want a report, checklist, table, JSON object, action plan, decision memo, email, or presentation outline. You can define both the container and the fields inside it.

Simple Formula

text Return the answer as a [format].

Use the following structure:

  1. [Section or field]
  2. [Section or field]
  3. [Section or field]

Keep each section within [limit].

Copy-Ready Prompt

text Compare the options in a table with these columns:

  • Option
  • Setup effort
  • Monthly cost
  • Flexibility
  • Best use case
  • Main risk

After the table, provide:

  1. Your recommended option
  2. The reason it wins
  3. The condition under which another option would be better

Why It Improves the Output

  • Makes the response easier to scan
  • Produces information you can paste into another system
  • Reduces formatting revisions
  • Helps decision-makers compare options consistently

Best Used For

Reports, research, project plans, databases, spreadsheets, APIs, content briefs, and decision documents.

Practical Tip

Show a miniature template when the structure matters. Claude often follows an example more reliably than a vague formatting instruction.

Code 07: Few-Shot Examples

How do I ensure Claude matches a specific tone or format?

Show Claude examples of the output you want. Anthropic describes examples as one of the most reliable ways to steer format, tone, and structure. A small set of relevant examples can teach Claude the pattern more effectively than a long abstract explanation. Examples should be:

  • Relevant to the real task
  • Diverse enough to cover variation
  • Structured clearly
  • Representative of the quality you expect

Simple Formula

text Study the examples below and infer the common pattern.

[Input and desired output] [Input and desired output]

Now apply the same pattern to: [New input]

Copy-Ready Prompt

text Write five hooks that follow the pattern in these examples.

Stop collecting AI tools. Build one workflow instead. Your prompts are not the problem. Your context is. Most people automate tasks. Operators automate decisions.

Topic: Using Claude for business operations

Keep each hook under 12 words. Do not copy the wording of the examples.

Why It Improves the Output

  • Demonstrates the standard instead of merely describing it
  • Improves consistency
  • Helps Claude match a specific format or voice
  • Reduces trial and error

Best Used For

Copywriting, classification, data extraction, code style, support responses, content formats, and brand voice.

Practical Tip

Examples can accidentally teach unwanted patterns. Review them for repeated phrases, narrow assumptions, and weak edge-case coverage.

Code 08: Plan, Then Execute

For complex tasks, ask Claude to create a concise plan before producing the final deliverable.

This is different from asking Claude to reveal private internal reasoning. You need the useful plan, assumptions, checkpoints, or decision process, not hidden chain-of-thought.

Simple Formula

text First, analyze the task and create a concise execution plan.

Then complete the task using that plan.

Before finalizing, verify that every requirement has been addressed.

Show:

  • The concise plan
  • The final deliverable
  • Any important assumptions

Copy-Ready Prompt

text Create a go-to-market plan for this new product.

First:

  1. Identify the target customer
  2. Clarify the core problem
  3. Define the offer
  4. Select the acquisition channels
  5. Set the first 30-day priorities

Then create the final plan.

Before finalizing, check that the recommendations fit the stated budget, team size, and timeline.

Why It Improves the Output

  • Creates better sequencing
  • Reduces missed requirements
  • Makes complex work easier to verify
  • Produces more actionable deliverables

Best Used For

Strategy, research, coding, migration plans, launches, audits, operations, and multi-step projects.

Practical Tip

Ask for a concise plan. A long planning phase can consume attention without improving the final answer.

Code 09: Tone + Audience Transform

Tell Claude who will read the content and how the writing should feel.

"Make it human" is too vague by itself. Define the audience, sentence style, vocabulary, energy, level of formality, and habits to avoid.

Simple Formula

text Rewrite this for [specific audience].

The writing should feel:

  • [Trait]
  • [Trait]
  • [Trait]

Use:

  • [Preferred writing behavior]

Avoid:

  • [Unwanted behavior]

Preserve:

  • [Meaning, facts, structure, or examples that must remain]

Copy-Ready Prompt

text Rewrite this for a busy founder who understands business but is not deeply technical.

The writing should feel:

  • Direct
  • Practical
  • Calm
  • Credible

Use short sentences and concrete examples.

Avoid corporate filler, exaggerated claims, rhetorical questions, and generic motivational language.

Preserve every factual claim and technical limitation.

Why It Improves the Output

  • Adapts the answer to the real reader
  • Produces more natural and usable writing
  • Reduces generic AI phrasing
  • Preserves substance while changing delivery

Best Used For

Emails, social content, reports, documentation, sales copy, education, and executive communication.

Practical Tip

Describe observable writing choices. "Short sentences with concrete examples" is clearer than "sound authentic."

Code 10: Table / Checklist / Comparison

Convert unstructured information into a format that supports action or a decision.

Use a table for comparison, a checklist for execution, a scorecard for evaluation, or a decision matrix when several criteria matter.

Simple Formula

text Transform the information into a [table/checklist/scorecard/decision matrix].

Evaluate each item using:

  • [Criterion 1]
  • [Criterion 2]
  • [Criterion 3]

Then provide:

  • The strongest option
  • The main trade-off
  • The next action

Copy-Ready Prompt

text Compare these four AI coding tools in a decision table.

Score each one from 1 to 5 on:

  • Setup effort
  • Repository understanding
  • Automation potential
  • Extensibility
  • Suitability for non-expert builders

Explain each score briefly.

Then recommend:

  1. The best option for a beginner
  2. The best option for an experienced developer
  3. The best option for an operations team

Why It Improves the Output

  • Makes differences visible
  • Forces consistent evaluation criteria
  • Converts information into an action
  • Helps reveal trade-offs instead of producing a generic winner

Best Used For

Tool selection, hiring, vendor reviews, product comparisons, project planning, audits, and research synthesis.

Practical Tip

Define the evaluation criteria before asking for a recommendation. Otherwise, Claude may choose criteria that do not match your priorities.

Code 11: Create an Artifact

Artifacts are a real Claude feature for substantial, self-contained outputs that you may want to view, edit, iterate on, share, or reuse separately from the main conversation.

Depending on the task and your available Claude capabilities, artifacts can include:

  • Markdown or plain-text documents
  • Code
  • Single-page websites
  • SVG visuals
  • Diagrams and flowcharts
  • Interactive React components
  • Apps and tools

Artifacts are useful when the output should become a working object, not merely another chat response.

Simple Formula

text Create an artifact for [specific purpose].

It should include:

  • [Feature or section]
  • [Feature or section]
  • [Feature or section]

Design requirements:

  • [Visual or usability requirement]

Interaction requirements:

  • [What the user should be able to do]

After creating it, review the artifact against the requirements and improve any weak areas.

Copy-Ready Prompt

text Create an artifact: a responsive one-page ROI calculator for an automation project.

Include:

  • Monthly task volume
  • Minutes saved per task
  • Hourly team cost
  • Monthly software cost
  • Implementation cost
  • Monthly savings
  • Payback period

The user should be able to edit every input and see the results update clearly.

Use a clean, professional SaaS-style interface with strong mobile usability.

Why It Improves the Output

  • Produces something you can interact with or reuse
  • Moves from explanation to implementation
  • Makes iteration more visual
  • Works well for prototypes, documents, diagrams, and small tools

Best Used For

Calculators, dashboards, prototypes, landing pages, diagrams, documents, visualizations, and reusable tools.

Practical Tip

Specify what should be editable, interactive, downloadable, or visually emphasized. "Create an artifact" alone does not define the product.

Code 12: Draft → Review → Refine

How do I get Claude to improve its own writing?

Ask Claude to review the first version against explicit criteria, identify the problems, and produce an improved version. A generic instruction such as "make it better" gives Claude no stable definition of better. A review rubric creates one.

Simple Formula

text Review the draft against these criteria:

  1. [Criterion]
  2. [Criterion]
  3. [Criterion]
  4. [Criterion]

First, list the specific issues you found.

Then produce a revised version that fixes those issues.

Preserve:

  • [Elements that must not change]

Copy-Ready Prompt

text Review the draft for:

  1. Clarity
  2. Factual accuracy
  3. Practical usefulness
  4. Repetition
  5. Logical flow
  6. Audience fit
  7. Unsupported claims

First, list the specific issues and explain why each one matters.

Then produce the improved version.

Preserve the core argument, examples, and intended CTA.

Why It Improves the Output

  • Creates a deliberate second pass
  • Identifies weak claims and repetition
  • Improves clarity and structure
  • Produces a revision based on criteria rather than random rewriting

Best Used For

Articles, scripts, emails, reports, strategy documents, code, presentations, and proposals.

Practical Tip

Use external facts, tests, source documents, or human review for important work. A self-review is useful, but it is not independent verification.

The Master Prompt Template

Use this when you want to combine the strongest patterns into one reusable structure.

text You are a [relevant role].

[Relevant background, audience, situation, available resources, and source material] [The outcome this work should create] [The specific deliverable Claude should produce] - [Requirement 1] - [Requirement 2] - [Requirement 3] - [Length, budget, tools, timeline, exclusions, or limitations] [Representative example] 1. Ask up to [number] clarifying questions only if essential information is missing. 2. Create a concise plan. 3. Complete the task. 4. Review the result against the success criteria. 5. Revise weak areas before presenting the final answer. [Exact sections, table columns, JSON schema, checklist, or document structure] - [What a strong result must achieve] - [What it must avoid]

Five High-Value Prompt Combinations

Content Creation Stack

Combine:

  • Role + Task
  • Context + Goal
  • Constraints
  • Few-Shot Examples
  • Tone + Audience
  • Draft → Review → Refine

text You are a practical AI content strategist.

My audience consists of builders, creators, freelancers, students, founders, and operators who want to apply AI rather than only consume AI news. Create an 8-slide Instagram carousel about [topic]. - Strong cover hook - Six educational slides - One CTA slide - One clear idea per slide - Practical examples Direct, modern, credible, and easy to understand. Avoid hype and generic motivational language. For each slide provide: - Top label - Headline - Supporting copy - Visual direction

After drafting, review the carousel for clarity, repetition, factual accuracy, and saveability. Then produce the improved final version.

Research Stack

Combine:

  • Context + Goal
  • XML Blocks
  • Success Criteria
  • Structured Output
  • Review and Verification

text I need to make a business decision about [topic].

[Question] - Use current and credible sources - Separate facts from inference - Highlight disagreement between sources - State uncertainty clearly 1. Executive summary 2. Key findings 3. Evidence table 4. Risks and unknowns 5. Recommendation 6. Sources

Verify important claims across multiple sources before finalizing.

Decision-Making Stack

Combine:

  • Context
  • Constraints
  • Comparison Table
  • Explicit Criteria
  • Recommendation

text I need to choose between [options].

[Situation] - Budget: [amount] - Timeline: [time] - Team capability: [details] - Must-have requirements: [details]

Evaluate each option on:

  • Cost
  • Setup effort
  • Flexibility
  • Reliability
  • Long-term maintenance
  • Fit for the stated use case

Return a comparison table, identify the main trade-offs, and recommend one option.

Also explain the condition under which your second choice would become better.

Writing Transformation Stack

Combine:

  • Audience
  • Tone
  • Constraints
  • Preservation Rules
  • Review

text Rewrite the text below for [audience].

The writing should be direct, natural, clear, and specific.

Use:

  • Short paragraphs
  • Concrete language
  • Useful examples

Avoid:

  • Corporate filler
  • Exaggerated claims
  • Repetition
  • Generic AI phrases

Preserve:

  • Every factual claim
  • The original intent
  • Important names, dates, and numbers

After rewriting, verify that no meaning or factual detail was lost.

[Paste text]

Artifact Builder Stack

Combine:

  • Role + Task
  • Product Requirements
  • Constraints
  • Artifact
  • Verification Pass

text You are a senior product designer and frontend developer.

Create an artifact for [purpose].

Users: [Describe users]

Core actions:

  1. [Action]
  2. [Action]
  3. [Action]

Required features:

  • [Feature]
  • [Feature]
  • [Feature]

Design requirements:

  • Responsive
  • Accessible
  • Clear visual hierarchy
  • Professional and minimal
  • Easy to understand without instructions

Before finalizing:

  • Test the main interactions
  • Check the layout on mobile
  • Remove unnecessary complexity
  • Verify every requirement is implemented

Common Prompting Mistakes

Giving Claude a Topic Instead of a Task

Weak:

text Tell me about AI automation.

Stronger:

text Explain AI automation to a non-technical operations manager, then provide three workflows they could implement this month.

Adding Unorganized Context

A long wall of text is not automatically a good prompt. Separate instructions, background, examples, and inputs.

Using Vague Quality Words

Words such as "better," "professional," "viral," and "human" need observable criteria.

Replace "make it professional" with:

text Use concise sentences, specific recommendations, neutral language, and an executive-summary structure.

Asking for Too Much in One Unstructured Sentence

Break complex tasks into sections or sequential steps.

Asking for a Format Without Defining the Fields

"Give me a table" is weaker than naming the columns and explaining the final decision the table should support.

Treating Claude's First Draft as Final

Use Code 12. For high-stakes work, also verify claims using primary sources, data, tests, or an expert reviewer.

Using Examples That Teach the Wrong Pattern

Claude can reproduce both the strengths and weaknesses of your examples. Curate them carefully.

Confusing Prompting With Proof

A better prompt can improve usefulness and consistency. It cannot guarantee factual accuracy. Verification still matters.

A Simple Workflow for Better Claude Outputs

Use this five-step loop:

  1. Define the outcome
    Decide what the answer must help you do.

  2. Add relevant context
    Give Claude the information that changes the answer.

  3. Choose the right patterns
    Select two to five codes from this guide.

  4. Specify the output
    Define the structure, length, audience, and success criteria.

  5. Review and refine
    Check the result against the task instead of accepting the first draft automatically.

About Life of Arjav

Life of Arjav shares practical AI guides for builders, creators, founders, operators, freelancers, and students.

The focus is not generic AI news or endless tool lists. It is about building useful skills and systems across:

  • Claude and Claude Code
  • ChatGPT and OpenAI
  • AI agents
  • MCP and context engineering
  • Automation and business systems
  • AI-assisted coding
  • Creator workflows
  • GTM, outbound, and operations

The goal is to help people move:

  • From watching to building
  • From saving to applying
  • From prompting to systems
  • From curiosity to skill
  • From skill to proof
  • From proof to opportunity

Follow @lifeofarjav for practical AI workflows, implementation guides, and operator-led education.

Sources and Accuracy Notes

This guide was developed using the official carousel content and checked against current official Anthropic resources.

Primary references:

Product capabilities, model behavior, plan availability, and interface details can change. Check Anthropic's current documentation when using feature-specific guidance.

Keep This Guide

Save this page in Notion and duplicate the prompt templates you use most often.

Follow @lifeofarjav for more practical AI systems and guides.

FAQ

What are Claude prompt codes?

Claude prompt codes are memorable names for practical prompt patterns based on Anthropic's official guidance. They are not secret commands, but rather structured ways to give Claude clear context, constraints, and goals to generate better outputs.

How do I combine multiple Claude prompt patterns?

You can combine various prompt codes like Context + Goal, XML Blocks, and Draft → Review → Refine into a master prompt template or specialized stacks (like the Content Creation Stack) to handle complex tasks in a single pass.

Are these prompting techniques exclusive to Claude?

While these techniques leverage features specific to Claude (like XML tags and Artifacts) and reference Anthropic's documentation, the underlying principles of adding context, using constraints, and providing few-shot examples apply broadly to other AI models like ChatGPT.

Why should I use XML tags in my Claude prompts?

Anthropic recommends using XML tags to separate instructions, background context, and source documents. This reduces ambiguity in long prompts and helps Claude understand exactly what to process and what format to return.

Related in AI & Claude

AI & Claude 50 Claude AI Skills You Should Be Using AI & Claude 60 Claude Prompts That 10x Your Output AI & Claude The Claude System Guide: 8-Agent Marketing System
← Back to Writing