Give the Agent Only the Context It Needs
Scenario
Compare three prompts asking an agent to fix a bug in canCheckout.
Try it yourself
Inspect each prompt to see which gives crisp, reproducible context.
| Case | Result |
|---|---|
| "Checkout is broken, please fix it." | Select a choice above to see what happens. |
| Pasting 40 unrelated files and chat logs without naming the failing test | Select a choice above to see what happens. |
| "In src/library.js, canCheckout(true, 3) returns true; rule requires borrowedCount < 3 -> false. Run npm test." | Select a choice above to see what happens. |
Reveal the explanation
- "Checkout is broken, please fix it."
Missing context! No file path, no failing input, no expected output.
- Pasting 40 unrelated files and chat logs without naming the failing test
Noisy! Distracts the agent and increases unrelated edits.
- "In src/library.js, canCheckout(true, 3) returns true; rule requires borrowedCount < 3 -> false. Run npm test."
Minimal reproducible context: exact file, input, actual vs expected, and verification command.
Four ingredients make a minimal reproducible brief: file path, failing input, expected vs actual result, and exact test command.
Review first
Your turn
Draft a 3-sentence minimal reproducible brief for a bug where didPassQuiz(60) returns false instead of true in quiz.py.
Common mistake Describing the symptom without giving the concrete input (60) or test command.
Check your work
Names quiz.py, input 60 (actual false vs expected true), and command pytest test_quiz.py.
Quick check
This browser could not save your progress. Changes last until you leave the page.