How to Prompt an AI Code Reviewer for Useful Feedback
Five tactics for getting better, sharper feedback from any AI code reviewer — including the 'rubber duck' trick and intent-first prompting.
AI code reviewers are only as good as the input you give them. Pasting raw code with no context produces generic feedback. Pasting code with a one-line goal produces feedback that's actually useful. Here are five ways to get sharper output every time.
1. Lead with the intent
Add a comment at the top: "Goal: parse a CSV upload, reject rows missing required fields, return the count of valid rows." Now the AI can judge whether your code actually does that. Without the goal, it grades the code in a vacuum.
2. Pick the right intensity
On TrashMyCode you can choose Be Nice, Roast Me, or Destroy Me. The harsher the prompt, the less the model sugar-coats real bugs. Use Destroy Me before merging — Be Nice when learning a new language.
3. Ask a specific question alongside
Instead of pasting code and waiting, paste it with: "Is there a race condition between save() and emit()?". AI reviewers do their best work when given a specific hypothesis to confirm or deny.
4. Paste the type definitions and the test file too
Code without context is half the picture. Paste the function alongside the types it uses and one or two existing tests. The AI can then reason about whether your change breaks any contract.
5. Use it as a rubber duck
Sometimes the act of pasting code into a reviewer and reading the AI's summary out loud surfaces a bug before the AI even responds. The AI is doing rubber-duck debugging at scale, and that alone justifies the 30 seconds it takes.
One thing to avoid
Don't paste your entire repository. Most reviewers (including TrashMyCode) work best on focused snippets — a single function, a single file, or a small diff. Long inputs dilute attention and produce vague feedback.
Try these tactics on your next push and you'll cut your actual-PR-comment count in half.
Want to apply this to your code?
Paste any code into TrashMyCode and get a brutally honest AI review in 30 seconds. Free, no credit card.
Roast my code