Guides

Use a coding agent to find and fix bugs

Review, fix, verify, and re-review defects until a clean pass or the shift deadline.

Answers: use a coding agent to find and fix bugs · Updated

SHORT ANSWER

A defect hunt is an open-ended scan–fix–rescan loop. It records every finding and disposition, fixes behind the project gate, and stops when a full pass finds nothing new or the deadline arrives.

01

Define the review surface

Start with user-visible paths, recent changes, failure-prone boundaries, and existing test evidence. Keep the review tied to the repository rather than speculative style preferences.

  • Reproduce before fixing when practical.
  • Keep unrelated refactors out of the defect commit.
  • Add regression coverage for behavior changes.
02

Use the snag log as memory

Read all prior dispositions before reporting a finding. Append fixed, rejected-because, or accepted-tradeoff after acting so the next cycle does not waste time on the same point.

03

Know when to stop

Zero new findings is convergence, not idleness. End the walkthrough even when time remains; do not manufacture work to fill the clock.

TRY IT

Start with a bounded prompt

This prompt names the outcome and preserves Nightshift’s review boundary. Paste it into the supported coding host from the project you want to change.

Run a bounded defect hunt: review for reproducible defects, deduplicate every finding, fix behind the project gate, and stop at a clean pass or the deadline.
BOUNDARIES

What this workflow does not claim

  • A suspected defect needs evidence before it is changed.
  • The loop stops at convergence or the deadline; it must not manufacture findings to fill time.
SOURCES

Evidence and sources

These links support the released behavior, public outcomes, or problem language described on this page.

defect-hunt contractThe released scan-fix-rescan contract and convergence rule.Open evidence ↗Versioned workflow contractThe shipped one-item loop, decision boundary, gates, recovery, and clock-out behavior.Open evidence ↗Merged Codex hardening PRAn 11-item Nightshift run in Codex that shipped in v0.9.2.Open evidence ↗
RELATED QUESTIONS

Continue from the question you have

run an autonomous code review loopRead the answer →repair flaky tests automaticallyRead the answer →review a web app overnightRead the answer →