Use a long-running agent to chase a stubborn bug
A developer let Codex work overnight against a repeatable test, using debug prints and hypotheses to track down an unexplained bug.
- What they did
- They started Codex on a bug they could not easily explain and left it running for hours. Beforehand, they made sure there was a deterministic unit test that hit the problem through the app’s normal entry point. From there, the agent did the repetitive work: adding temporary logging, checking ideas, and rerunning the test.
- How it went
- The write-up does not give a count or a named fix. The developer said this was a very good fit for the agent and that they use it regularly, though it does not say how often it actually reaches the root cause.
- Tips
- This works best when the test gives the agent a clear pass/fail signal to compare against. Have it stop and ask before any irreversible change, and make sure temporary prints are removed afterward.
Try it yourself with Codex
I have a bug in [project] that I can reproduce with [test name or path]. Investigate it by forming likely causes, adding temporary debug output where useful, and rerunning the test after each change. Use only the app’s normal entry path and keep going until you can explain the root cause with evidence from the test output. Before you make any irreversible change, such as deleting code, submitting a patch, or altering behavior, pause and ask for my approval. When you are done, list the debug output you added and remove it unless I approve keeping it. Then propose the smallest fix you think would address the bug, with a brief explanation of why.
Fill in the [brackets]. Agents can make mistakes, so review anything before it is sent, paid or deleted.
Get 3 agent uses like this every morning
With the day's top AI news. Free, and one click to unsubscribe.
Related agent uses
Use Claude for UI work and Codex for server tasks
A developer split interface work and backend work between Claude and Codex after other agents failed on real projects.
Use Codex for feature delivery and outage notices
They had Codex build a feature in staged pull requests, then paused for manual testing and assigned a separate alerting task for a third-party outage.
Split frontend and backend work between two agents
A poster used Claude Code for the frontend and Codex for the backend while sharing one live workspace to cut down on handoff work.
Review a pull request with staged sub-agents
Use parallel checks and a validation pass to review a branch or PR before you decide what to fix.
Set up a separate sandbox QA pass
Codex turned an existing Claude login into a second reviewer that checked an AI system without changing the user’s credentials.
Use spare AI quota to draft reviewable PRs
A founder pointed an agent at goals and task lists so it could turn leftover Claude and Codex quota into pull requests for review.