PromptFork

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.

Open in Studio
Prompt
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

More prompts you might like

Editor’s pickChatGPT & AI PromptsSeed

Gemini deep-dive research briefing prompt

Turns Gemini into a research analyst — structured briefing, key players, what's debated, cited sources. Plays to Gemini's long context and Google grounding.

New

Gemini multimodal analyst — structured extraction for any visual input type

Play to Gemini's strongest capability — paste any visual (chart, screenshot, document, photo, or two images to compare) and get a type-specific structured analysis that extracts what actually matters, not just a description.

New

Gemini study coach — with spaced repetition, teach-back, and exam simulation

Turns Gemini into an adaptive study coach that explains, quizzes, schedules review using spaced repetition, verifies understanding with the 'teach it back' method, and runs timed exam simulations with scoring.

New

Gemini data analyst — from messy data to clean insights, formulas, and the right chart

Paste a messy table and get a full analysis pipeline — data cleaning first, pivot tables, statistical significance checks, the exact Sheets formulas, and a specific chart recommendation with the reasoning for why that chart type (not another) tells the story.

New

Direct expert — answers with zero fluff

Turn any assistant into a decisive, no-padding expert. Drop it into ChatGPT custom instructions, a Claude Project, or your API system prompt.

New

Senior engineer for AI coding tools

Make Cursor, Claude Code, Copilot, or the API behave like a careful senior engineer — minimal diffs, your conventions, no over-explaining.

New