Claude · OpenAI GPT · Gemini
Code Debugging and Refactoring.
Reproduce the same intermittent API error first
All three examples investigate the same issue without assuming a race condition or repository access in an ordinary web chat. No test project or stack trace is attached to this page.
Content reviewed
Shared brief
A TypeScript Next.js project intermittently returns HTTP 500 from /api/comments. Inventory accessible evidence, reproduce the problem, propose the smallest scoped fix, and verify with a regression test and typecheck.
Claude
Official version reference checked · Fable 5.1 / Opus 5.5 / Sonnet 5.5 / Haiku 5.5 · Source checked
Writing approach
Define the goal, available evidence and permitted edit scope.
English prompt example
In the supplied TypeScript Next.js project, investigate intermittent HTTP 500 responses from /api/comments. Start by listing the files, stack traces and reproduction evidence you can actually access. Do not assume a root cause. Propose the smallest fix within the comments module, explain alternatives and wait if a required scope decision is missing. Preserve unrelated changes. Do not change authentication, sessions, billing, credits or dependencies. If the environment supports edits and execution, implement the agreed fix and run the relevant regression test and typecheck. Otherwise provide a reviewable patch and commands to run. Report exact changes, commands, exit codes and remaining uncertainty. Never describe unrun tests or unavailable files as checked.Setup and use
Supply the material through your actual Claude interface or developer tool. A web conversation and an agent with repository access have different permissions.
Watch for
- Confirm the environment can actually read the needed files.
- Ask for execution evidence; tests that were not run must not be reported as passing.
OpenAI GPT
Official version reference checked · GPT-6 Astra / GPT-6.1 Sol / GPT-6 Luna · Source checked
Writing approach
State the supplied material, output format and how missing evidence should be handled.
English prompt example
In the supplied TypeScript Next.js project, investigate intermittent HTTP 500 responses from /api/comments. Start by listing the files, stack traces and reproduction evidence you can actually access. Do not assume a root cause. Propose the smallest fix within the comments module, explain alternatives and wait if a required scope decision is missing. Preserve unrelated changes. Do not change authentication, sessions, billing, credits or dependencies. If the environment supports edits and execution, implement the agreed fix and run the relevant regression test and typecheck. Otherwise provide a reviewable patch and commands to run. Report exact changes, commands, exit codes and remaining uncertainty. Never describe unrun tests or unavailable files as checked.Setup and use
Choose available models and tools in your OpenAI product. An API model listing does not establish access to the same model or features in a ChatGPT account.
Watch for
- Do not treat missing attachments or sources as already read.
- A text response does not prove that searches, file edits or tests occurred.
Gemini
Official version reference checked · 3.8 Flash / 3.5 Flash-Lite · Source checked
Writing approach
Inventory the supplied material, state its visible scope and request evidence-based analysis.
English prompt example
In the supplied TypeScript Next.js project, investigate intermittent HTTP 500 responses from /api/comments. Start by listing the files, stack traces and reproduction evidence you can actually access. Do not assume a root cause. Propose the smallest fix within the comments module, explain alternatives and wait if a required scope decision is missing. Preserve unrelated changes. Do not change authentication, sessions, billing, credits or dependencies. If the environment supports edits and execution, implement the agreed fix and run the relevant regression test and typecheck. Otherwise provide a reviewable patch and commands to run. Report exact changes, commands, exit codes and remaining uncertainty. Never describe unrun tests or unavailable files as checked.Setup and use
Check the input and model limits of your interface and supply necessary material in batches. Do not assume an entire repository was uploaded or read.
Watch for
- An input-size limit does not establish accurate use of every fact.
- Verify citations and proposed edits individually.
Copying does not submit a generation. Check the model, mode and available features on your target platform first.
Check the actual result
- The root cause has reproducible evidence rather than being assumed by the prompt.
- The diff stays within the permitted scope and preserves other uncommitted work.
- Test names, commands and exit codes are recorded; unrun checks are identified.
Choosing and checking
Check which files your environment can read or edit and whether it can run tests before selecting a workflow. Judge a fix by its actual diff and execution evidence.