How I stopped babysitting Claude Code and Codex on hours long runs: planning, git checkpoints and a test gate outside the agent

Reddit r/AI_Agents Tools

Summary

The author shares techniques for running Claude Code and Codex on long, multi-step tasks without babysitting, using an external test gate, git checkpoints per task, and a DAG-based plan to avoid blocked tasks stalling the run, and packages this into an open-source tool.

I run Claude Code and Codex on long, multi-step tasks on an isolated machine and I kept hitting the same handful of issues: * The agent reports a task as done when the tests didn't actually pass and blames "prexisting bugs." * Context fills up and compaction makes the agent forget why it did something three steps back, which wastes tokens and creates downstream bugs. * One blocked task stalls the whole run. I just wanted to leave my agent running without giving up control. Here's what I did about each: * **Lying about tests:** the build and test commands run outside the worker, so it can't claim success and skip the gate. On failure it reverts to a git checkpoint and retries with the failure context. * **Compaction amnesia:** each task runs in a fresh worker, so nothing drags through a long compaction cycle. A worker can still inspect prior work when it needs to. * **Blocked tasks:** the plan is a DAG, so one block doesn't stop everything. It keeps working on tasks that aren't downstream and asks me a focused question in Telegram. * **Staying in control:** Claude Code drafts the plan, Codex reviews it, and I approve it before anything runs. There's a git checkpoint before each task, and the whole execution trail is on disk: plans, prompts, stdout/stderr, attempts, checkpoints, lessons. I packaged this into an open source tool, link in a comment if it's useful, but I'm mostly curious how others here handle the "agent is a bad witness of its own work" problem. Putting the test gate outside the worker is the only thing that reliably worked for me. What are you doing for that?
Original Article

Similar Articles

How I got Claude Code and Codex to pursue goals over weeks

Reddit r/AI_Agents

The author built SmithersBot, an open-source agent harness that orchestrates Claude Code and Codex to pursue long-term goals over weeks by breaking plans into tasks, requiring approvals, and using checkpoints to avoid degradation.