Back to cookbook

AI Prompt for Meta-Prompting to Have a Model Write and Refine Its Own Prompt

0 views Updated

Make this prompt yours

Share

Meta-prompting is the technique of asking an AI model to write, critique, or improve a prompt instead of writing the prompt entirely by hand. This prompt is for anyone who has a rough idea of a task but isn't sure how to phrase the instructions, constraints, or output format needed to get a reliable result from ChatGPT, Claude, or Gemini.

The approach works because models are good at recognizing the structural elements a strong prompt needs — a defined role, clear context, explicit constraints, and a stated output format — even when they're not given those elements themselves. You describe the task and the problems you're running into, and the model drafts (or rewrites) a prompt, explains the reasoning behind each choice, and flags anything that's still ambiguous.

Because meta-prompting produces two versions of the same prompt — your rough draft and the model's rewrite — it's a natural fit for a direct side-by-side check. Running both versions through Compare & Diff shows exactly what changed between them along with the token and cost difference, which makes it easier to tell whether the rewrite actually earns its added length.

Prompt template

Make this prompt yours

prompt-template
242 tokens
Role: You are a prompt engineering expert who improves prompts for clarity, consistency, and reliability across AI models. Context: - Task I'm trying to accomplish: [DESCRIBE THE TASK] - My current prompt attempt: [PASTE YOUR CURRENT PROMPT] - What's going wrong with the results: [DESCRIBE THE SPECIFIC PROBLEM, E.G. INCONSISTENT FORMAT, MISSING DETAILS, WRONG TONE] Task: 1. Identify the specific weaknesses in my current prompt that are causing the problem described above 2. Rewrite the prompt with a clear role, context section, explicit constraints, and a defined output format 3. Explain in 2-3 sentences why each major change should fix the problem Constraints: - Keep the rewritten prompt as short as possible while still being unambiguous - Do not add requirements I did not ask for - The rewritten prompt must work across different AI models, not rely on model-specific syntax Output format: Section 1: "Weaknesses" as a short list Section 2: "Rewritten Prompt" as a plain text block Section 3: "Why This Should Work" as 2-3 sentences

Want it sharper? Optimize this prompt with Prompt Optimizer, check it with the Prompt Debugger or shorten it with the Token Optimizer.

Example input

example-input
51 tokens
Task: Summarize customer support tickets into a weekly report Current prompt attempt: "Summarize these support tickets for me" What's going wrong: The summaries are inconsistent length, sometimes miss the actual issue, and never mention how many tickets were urgent

When to use it

  • You have a task clearly in mind but keep getting inconsistent or off-target results from your current prompt
  • You're building a prompt template that other people on your team will reuse and need it to be unambiguous
  • You want the model to explain why a prompt works, not just produce a rewritten version
  • You're iterating on a system prompt or agent instructions and need a second pass at tightening the constraints

Best practices

  • Give the model your actual failed attempt and describe specifically what went wrong, not just the general topic
  • Ask the model to explain its reasoning for each change so you can evaluate whether the suggestion is actually an improvement
  • Request the rewritten prompt in a clean, copy-pasteable block separate from the explanation
  • Test the rewritten prompt on a real example immediately rather than assuming the rewrite is correct just because it sounds more structured

Common mistakes

  • Accepting the model's rewritten prompt without testing it, which can introduce new assumptions that don't match your actual use case
  • Giving the model only the topic instead of the failed prompt and its bad output, which removes the context it needs to fix the real problem
  • Letting meta-prompting add unnecessary length or jargon that makes the prompt harder for a human to maintain later
  • Treating the rewrite as final instead of running a second meta-prompting pass after testing it on real inputs

FAQs

What is meta-prompting in AI?

Meta-prompting is asking an AI model to write, evaluate, or rewrite a prompt rather than writing every instruction by hand yourself. You describe the task and the problem, and the model handles the structural work of turning that into a clear prompt.

Does meta-prompting work the same way in ChatGPT, Claude, and Gemini?

The underlying idea works across all three since it's just asking the model to reason about prompt structure, but each model may phrase its rewritten prompt slightly differently. Testing the rewrite on your actual task is the only reliable way to confirm it works for your use case.

Is meta-prompting better than writing a prompt from scratch?

Neither approach is universally better. Meta-prompting is most useful when you already have a failed or inconsistent prompt to diagnose, while writing from scratch works fine when the task is simple enough that you already know the structure you need.

How can I tell exactly what a meta-prompting rewrite actually changed?

Compare & Diff — lays your original prompt and the model's rewrite side by side with a token and cost comparison, making it easy to confirm the rewrite is a real improvement and not just longer.

Found this prompt useful? Share it.

Share

More in Prompt Fundamentals & Techniques

Prompt Fundamentals & Techniques

AI Prompt for Zero-Shot Prompting to Get Accurate Answers Without Examples

A zero shot prompting prompt asks a model like ChatGPT, Claude, or Gemini to complete a task with no examples at all — just clear instructio…

ROLE: You are a [DOMAIN EXPERT ROLE, e.g., "senior support ticket triage specialist"] completing a single task with no prior examples to reference.

CONTEXT: [DESCRIBE THE INPUT - e.g., "a customer support message", "a paragraph of text", "a product review"] will be provided below. The task is [TASK NAME, e.g., "classify the input into one of the categories listed"].

TASK:
[STATE THE EXACT TASK IN ONE OR TWO SENTENCES]

CATEGORIES OR RULES (define every option explicitly, with no overlap):
- [OPTION 1]: [DEFINITION OR CRITERIA]
- [OPTION 2]: [DEFINITION OR CRITERIA]
- [OPTION 3]: [DEFINITION OR CRITERIA]

CONSTRAINTS:
- Base your answer only on the input provided, not on assumptions beyond it
- If the input does not clearly match any option, respond with "[FALLBACK LABEL, e.g., Unclear]" instead of guessing
- Do not explain your reasoning unless explicitly asked

OUTPUT FORMAT:
Return only [EXACT FORMAT, e.g., "the category name", "a JSON object with fields: category, confidence"] — no extra commentary.

INPUT:
[PASTE THE TEXT OR DATA TO PROCESS HERE]

Make this prompt yours

Prompt Fundamentals & Techniques

AI Prompt to Use Tree-of-Thought Reasoning for Complex Problem-Solving

This prompt helps you apply tree of thought reasoning to get ChatGPT, Claude, or Gemini to explore multiple solution paths before committing…

Role: You are an expert [DOMAIN] advisor helping evaluate approaches to a complex problem.

Context:
Problem: [DESCRIBE THE PROBLEM OR DECISION]
Constraints: [LIST ANY HARD CONSTRAINTS, e.g. budget, time, resources]
Evaluation criteria: [LIST 2-4 CRITERIA, e.g. cost, risk, speed, feasibility]

Task:
1. Generate [NUMBER, e.g. 3] distinct reasoning branches, each representing a genuinely different approach to the problem.
2. For each branch, reason through the approach step by step and state its strengths and weaknesses against the evaluation criteria.
3. Score each branch against the evaluation criteria on a scale of 1 to 5.
4. Compare the branches directly and explain which one or two perform best overall, and why the others fall short.
5. Recommend a final approach, noting any conditions under which a different branch would be preferable.

Output format:
Branch 1: [NAME]
Reasoning: [STEP-BY-STEP REASONING]
Scores: [CRITERION: SCORE, CRITERION: SCORE]

Branch 2: [NAME]
Reasoning: [STEP-BY-STEP REASONING]
Scores: [CRITERION: SCORE, CRITERION: SCORE]

Comparison: [DIRECT COMPARISON ACROSS BRANCHES]
Recommendation: [FINAL ANSWER WITH JUSTIFICATION]

Make this prompt yours

Prompt Fundamentals & Techniques

AI Prompt to Assign an Expert Persona for Sharper, More Specific Answers

This is a role prompting prompt for anyone who keeps getting generic, hedge everything answers out of ChatGPT, Claude, or Gemini and wants r…

Role: You are a [SPECIFIC ROLE, e.g., "senior clinical dietitian specializing in sports nutrition"] with [NUMBER] years of experience working with [TYPICAL CLIENT OR AUDIENCE].

Context: [DESCRIBE THE SITUATION OR QUESTION NEEDING EXPERT INPUT]

Constraints:
- Answer only using the judgment and standards a practitioner in this exact role would apply
- Flag any trade-offs, risks, or edge cases a specialist in this field would normally raise
- If the question falls outside this role's expertise, say so explicitly instead of guessing
- Avoid generic disclaimers that a specialist wouldn't bother stating

Output format: [DESCRIBE DESIRED FORMAT, e.g., "a short recommendation followed by 3 bullet points of reasoning"]

Question: [YOUR ACTUAL QUESTION]

Make this prompt yours