Reverse Prompting: Get the Prompt Behind a Great Answer
When the AI gives you an answer you love, ask it to write the prompt that produced it, test that prompt, and save it. When you do not know what to ask, let the AI ask you. 11 templates to copy, for ChatGPT, Claude or Gemini.
A small library of your own prompts that each produce a result you already know is good, plus a habit that stops you guessing what the AI needs. Normal prompting goes prompt, then output. Reverse prompting goes the other way: output, then prompt.
You need: any chat assistant (ChatGPT, Claude or Gemini; a free plan works), and a notes app or document where you keep your saved prompts.
Two ways to reverse a prompt
From output to prompt
You have a result you like: from your own chat, or a text you admire. You ask the model to work out the prompt that would produce it, then reuse that prompt. Sections 3 and 4.
Let the model ask you
You only have a goal. You ask the model to question you until it has the context it needs, then do the task. Researchers at Vanderbilt University called this the "Flipped Interaction" pattern in 2023. Section 5.
The two work best together: let the model interview you, get a result you like, then reverse that result into a saved prompt.
The five parts a rebuilt prompt must name
A rebuilt prompt is only reusable if it spells out what made the result good. Ask for these five parts every time:
Who the model should act as: "an editor for a Gulf business magazine".
Audience, purpose and background the model cannot guess, and why it matters.
One clear action, phrased as what to do.
Length, structure, tone and language, in measurable terms ("5 bullets, under 20 words each").
The good output itself, kept as a sample. Anthropic and Google both describe examples as one of the most reliable ways to steer format and tone.
For frameworks, best practices and 10 domain templates, see the Library's general guide, Writing Better AI Prompts. This guide covers only the reverse technique.
Reverse a great answer into a reusable prompt
Do this the moment a chat gives you something you would happily use again.
- Stay in the same chat. The model can see everything that led to the result, including your corrections along the way.
- Paste prompt 1 below. It asks the model to explain what worked and turn it into a template.
- Copy the template it returns and continue to section 4 to test it before you save it.
1 · Capture a success (same chat)
This output is exactly what I needed. Analyze what made it work and write one reusable prompt that would produce the same quality on the first try, without our back-and-forth.
The prompt must state:
- the role you should take
- the context and audience
- the task
- the format: length, structure, tone, language
- the quality standards and anything to avoid
Replace the details that change each time with [BRACKETED PLACEHOLDERS]. Return only the prompt, ready to copy.If the good result is not from your chat (a post, an email or a report you admire), paste it into a new chat with prompt 2.
2 · Rebuild the prompt behind a sample
Below is a piece of writing I want to be able to reproduce in the same style for other topics.
Reverse-engineer it:
1. Describe its audience, purpose, structure, tone, sentence length and formatting.
2. List what makes it effective, in 5 bullets.
3. Write the prompt that would most likely produce a text like this, using [BRACKETED PLACEHOLDERS] for the topic and any detail that changes.
Sample:
"""
[PASTE THE TEXT HERE]
"""It is a best guess, not the original. The model cannot see the prompt someone else used. It writes a prompt that should produce something similar, which is why section 4 exists. Use samples to learn a style, not to copy another person's work word for word.
Test it, fix it, save it
- Open a new chat. A fresh chat has none of the earlier context, so it shows whether the prompt works on its own.
- Paste the rebuilt prompt and fill the placeholders with a different topic from the original.
- Compare the new result with the one you liked. If it is close, save it. If something is off (too long, wrong tone, missing a section), go to step 4.
- Fix the gap with prompt 3 in the same new chat. Ask for small edits, not a rewrite, so what already works stays in place.
- Save it in your notes using the layout in prompt 4, so you can find and fill it in seconds next time.
3 · Fix what the test got wrong
Here is a prompt I am testing:
"""
[PASTE YOUR PROMPT]
"""
I want it to [WHAT YOU WANTED], but instead it [WHAT HAPPENED].
Keeping as much of the prompt as possible, which phrases would you add or delete so it does what I want every time? Show the edits, then the full corrected prompt.4 · How to save a prompt in your library
NAME: [short name, e.g. "LinkedIn post, investor tone"]
USE FOR: [one line on when to use it]
WORKS BEST IN: [ChatGPT / Claude / Gemini]
LAST TESTED: [month and year]
PROMPT:
[the tested prompt with its placeholders]
EXAMPLE OF A GOOD RESULT:
[paste the output you liked]Keeping the good result next to the prompt matters: next time you can paste it in as the example, which is the part that steers tone and format most.
When you only have a goal: let the model ask you
Most weak answers come from missing context. Instead of guessing what to include, give the model the goal and ask it to question you first. Pick the prompt that fits.
5 · The one-line add-on
[YOUR NORMAL PROMPT]
Before you start, ask me clarifying questions until you are 95% confident you can complete this task well. Ask one question at a time.Lower the number (80%) for quick tasks, raise it (99%) when the result matters, such as a proposal or a CV.
6 · The clean interview
My goal: [WHAT YOU WANT TO END UP WITH]
Ask me questions, one at a time, until you have enough context to achieve this goal. Stop when [STOP CONDITION, e.g. "you know my audience, budget and deadline"], then summarize what you learned and do the task.
Start with your first question.7 · Clarify first, then answer
My request: [YOUR QUESTION OR TASK]
Do not answer yet. First:
1. List 3 to 5 questions you need answered to do this well.
2. Wait for my replies.
3. Then give your complete answer.8 · The specialist consultant
Act as my [FIELD] consultant. My goal is to create [THE OUTPUT YOU NEED].
Ask me clarifying questions about [THE THINGS THAT MATTER, e.g. target audience, budget, brand voice, goals] until you are confident you have everything you need. Ask one question at a time.
Start with your first question.If the questions never end, reply "That is enough, go ahead with what you have." Setting a stop condition, as in prompt 6, prevents this.
Let the model write the prompt for you
Two prompts that put the model in charge of the prompt itself. Use them when you know roughly what you want but not how to ask.
9 · Your prompt engineer, in rounds
Act as my prompt engineer. Your goal is to help me write the best possible prompt for my needs. The prompt will be used by you.
Follow this process:
1. First, ask me what the prompt should be about. We will improve it over several rounds.
2. After each of my answers, reply with 3 sections:
a) Revised prompt: your rewritten prompt, clear and ready to use
b) Suggestions: details I could add to improve it
c) Questions: what else you need to know from me
3. We repeat this until I say "done".10 · Design the ideal prompt, then run it
What would be the ideal prompt to get [EXPERT]-level [TYPE OF TASK] focused on [WHAT MATTERS MOST]?
Write that prompt and show it to me. Then run it on the following:
"""
[PASTE YOUR CONTENT, DATA OR CODE]
"""When the result is good, finish with prompt 1 so the prompt goes into your library.
Worked example: a 30-day Instagram plan
The weak way. The model has to guess the account, the audience and the format:
Write me an Instagram content strategy.The reverse way. Start with the goal and let the model interview you:
11 · Interview first, then plan
I want a 30-day Instagram content strategy for an AI education account aimed at Gulf audiences.
Before you create anything, ask me clarifying questions until you are 95% confident you can deliver an excellent strategy. Cover brand voice, content pillars, posting frequency, competitors, goals and audience. Ask one question at a time.
When you have enough, deliver the plan as a table: day, pillar, topic, hook.
Start with your first question.- Answer the questions. Expect some you had not thought of, such as ad budget, how you will measure success, or your audience's main pain points.
- Read the plan and ask for any changes in the same chat.
- When the plan is right, paste prompt 1. You now have a tested "monthly content plan" prompt you can fill in next month without the interview.
Small adjustments per assistant
When you save a prompt you will use often, tune it to the assistant you will run it in:
- Claude: wrap the parts in tags such as
<context>,<instructions>and<example>. With long documents, put the document first and your question last; Anthropic reports this can improve quality by up to 30% in its tests. Use calm wording ("Use this when...") rather than "CRITICAL: you MUST", which newer models can overreact to. - Gemini: Google recommends always including examples in the prompt, and placing your instructions or question at the very end, after the context.
- ChatGPT: OpenAI's GPT-5 prompting guide recommends using the model to improve its own prompts, the same move as prompt 3.
Re-test after model updates. A prompt tuned on one model version can behave differently on the next. That is why the saved layout in prompt 4 has a "last tested" line.
Researchers study a harder version of this too: recovering a hidden prompt from only a few outputs. Northwestern University researchers presented such a method, using a genetic-algorithm style search, at EMNLP 2025. For everyday use, the prompts above are enough.
Before you save a prompt
Sources: White et al., "A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPT", Vanderbilt University, arXiv 2302.11382 (2023); Li and Klabjan, "Reverse Prompt Engineering", EMNLP 2025; Anthropic, Prompting best practices (platform.claude.com); Google, Prompt design strategies (Gemini docs); OpenAI, GPT-5 prompting guide (OpenAI Cookbook). Checked November 2026.
Want your team to use this at work?
I'm Abdulaziz Alshamsi, a certified AI trainer and consultant in Abu Dhabi. I train government and company teams to use AI in their daily work. Message me to discuss a session for your team.