Back to blog
Prompting
Claude Code

Prompt Iteration: Fixing Prompts That Don't Work

Thang Doan
Thang Doan

Prompt design is rarely perfect on the first try. You write a prompt, check the response, and adjust. That is completely normal, even experts do it. Here are three strategies to fix prompts that are not giving you what you want.

Strategy 1: Rephrase Your Prompt

Different phrasing often gives different results, even when the meaning is the same. If one version does not work, try saying it differently:

  • Version 1: "How do I bake a pie?"
    Version 2: "Suggest a recipe for a pie."
    Version 3: "What is a good pie recipe?"

All three ask for the same thing, but the model may respond differently to each. Sometimes the second or third version gives a noticeably better answer.

Strategy 2: Switch to an Analogous Task

If the model will not follow your instructions one way, try framing the same goal as a different type of task. For example, if you ask the model to categorize a book into predefined genres and it gives you a long explanation instead of just the category, reframe it as a multiple choice question.

Instead of: "Which category does The Odyssey belong to: thriller, sci-fi, mythology, biography?"

Try: "Multiple choice problem: Which option describes The Odyssey? Options: thriller, sci-fi, mythology, biography."

Same goal, different framing, and often a cleaner answer.

Strategy 3: Change the Order of Content

The order of things in your prompt can affect the response. Try rearranging the sections:

  • Version A: Examples, then context, then your question
    Version B: Your question first, then examples, then context
    Version C: Examples, then your question, then context

Bonus tip: If the model gives you a fallback response like "I'm not able to help with that," try increasing the temperature slightly. This can sometimes get past overly cautious safety filters.

Based on: Gemini API Prompting Strategies (ai.google.dev)

Recommended for you

Enjoyed this article?

Subscribe for new articles. No spam. Unsubscribe anytime.

By subscribing you agree to receive the newsletter. See the Privacy page.