Gemini debugging — paste your whole module, not just the broken line
Built for Gemini's massive context window — paste multiple files, the full stack trace, and get root-cause analysis that sees architectural issues, not just line-level bugs. Includes the 'write a test that catches this' output.
Gemini's large context window is its debugging superpower — use it. Paste MORE code, not less. 'You are a senior [LANGUAGE/FRAMEWORK] engineer doing a thorough code review and debug. I'm pasting multiple files and the full error — use the full context to find root causes that span across modules, not just the broken line. [PASTE THE FULL MODULE/FILE — not just the broken function] [PASTE RELATED FILES: types, configs, imports, the calling code] [PASTE THE COMPLETE ERROR/STACK TRACE — unedited] [DESCRIBE: what should happen vs what actually happens] Analyze at three levels: 1. LINE-LEVEL: What specific code is causing this error? Show the corrected code with comments explaining what changed and why. 2. ARCHITECTURE-LEVEL: Is this a symptom of a deeper design issue? (wrong data flow, missing error boundary, race condition, incorrect abstraction, state management problem). If so, explain the structural fix, not just the band-aid. 3. PREVENTION: Write a test that would have caught this bug before it shipped. Use [testing framework, e.g. Jest/pytest/Go test]. The test should: - Reproduce the exact failure condition - Assert the correct behavior - Cover the edge case that triggered this If the cause is ambiguous, give the 2-3 most likely explanations ranked by probability, and tell me how to confirm which one it is (a specific log line to add, a value to inspect, a condition to test). Do NOT guess at code you can't see — ask me for the specific file if you need it.' WHY 'PASTE MORE' WORKS BETTER WITH GEMINI: • Most bugs aren't in the line that throws — they're in the data that arrives wrong, the config that's misconfigured, or the type that doesn't match. Gemini's 1M+ token context means you can paste the whole module, its imports, and the calling code. Do it. • The 'paste your whole module, not just the broken function' technique catches: incorrect imports, missing middleware, wrong environment variables, type mismatches across module boundaries, and stale caches — none of which are visible in a code snippet. • Include your package.json / requirements.txt / go.mod if you suspect a dependency issue. Tips: paste the full unedited stack trace — paraphrasing errors loses critical info (line numbers, call order, variable states); if the bug is intermittent, describe the conditions when it happens vs doesn't; for frontend bugs, paste the component AND the hook/store it reads from; add 'also check for: race conditions, null propagation, off-by-one, and async/await mistakes' to trigger a broader scan.
- Source
- promptfork seed
- License
- CC-BY-4.0
- Published
- 6/22/2026