Back to blog
Prompting
Claude Code

Prompt Iteration: Fixing Prompts That Don't Work

Thắng Đoàn
Thắng Đoàn

Prompt not giving you what you want? First drafts rarely work, even for experts; the skill is iterating with moves instead of guessing. Three moves fix most broken prompts.

Rephrase the same request

Different wording gives different results even when the meaning is identical. "How do I bake a pie?", "Suggest a recipe for a pie", and "What is a good pie recipe?" ask for the same thing, but the second or third often answers noticeably better.

Switch to a similar task type

If the model will not follow instructions, reframe the goal. Asking it to sort a book into genres may return a long explanation instead of a category. Reframe as multiple choice: "Which option describes The Odyssey? Options: thriller, sci-fi, mythology, biography." Same goal, cleaner answer.

Change the order of content

Order changes emphasis. Try examples then context then question, or question first then examples then context. Models weight the start and end of a prompt most heavily, so moving your question to the end often sharpens the answer.

The trade-off

Each move costs a rerun, and results are not deterministic: a better phrasing this run may not hold the next. Rephrasing is cheapest, so burn that first; reorder only for long prompts; switch task type when the output shape itself is wrong. And if you keep hitting a refusal-style fallback, a slightly higher temperature sometimes clears it.

The smallest test

Pick your most stubborn prompt and run all three rephrasings of it. Keep the winner.

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

Share:

Recommended for you

Enjoyed this article?

Subscribe for new articles. No spam. Unsubscribe anytime.

By subscribing you agree to receive the newsletter. No spam, and you can unsubscribe anytime.