Cautionary Tale

How Ash Jogalekar Runs a Claude and Codex Loop on a Geometry Proof

Built by Ash Jogalekar · · Source: X

Quick answer

Ash Jogalekar set up an autonomous loop where one model does the calculations on a hard geometry proof and the other reviews them and starts the next round. When they swapped the roles, the loop ran 42 rounds, and according to Ash, more than 20 of them added nothing new.

Result: Codex as reviewer ran 26 rounds and then hit a stop condition. With Claude as reviewer it ran 42 rounds and never stopped, and Ash found rounds 18 to 41 added no new mathematics.

What they built

Ash Jogalekar is working on a tough geometry proof that they say could have uses in chemistry. They didn't want to spend their time copying output from one model into the other, so they built an autonomous loop between Claude and Codex. One model does the calculations and the other acts as orchestrator and adversarial reviewer. They packaged the loop as a skill and published it on GitHub as claude-codex-loop.

How it works

In the first setup, Claude was the calculator and Codex was the reviewer. Claude ran a round of calculations, and Codex checked in every hour, reviewed the round adversarially, then started a fresh Claude session. The loop keeps going until a stop condition is met. That can be a scientific outcome, a budget limit or a set number of rounds.

Then Ash swapped the roles. Claude, now the reviewer, suggested starting a fresh Codex session for every calculation so long context wouldn't drift, and Ash approved it. Claude's reviewer side also ran as a new scheduled job every 30 minutes, which meant it had no memory of earlier rounds.

The result

The first setup ran 26 rounds and stopped when it hit a stop condition. The swapped setup ran 42 rounds and never stopped. Every round passed review. When Ash looked closer, rounds 18 to 41 had added no new mathematics, 19 of the 41 task titles started with "Repair", and the last four rounds changed only two files, one of them a status file.

According to Ash, the reviewer was the problem. Without memory, it kept finding small defects and followed the protocol's rule to fix defects before extending scope. It never noticed that no open question had been answered in twenty rounds. Their fix was to write the goal into a file as a working list of open questions, plus a check that counts new results, runs the new proof checkers itself and stops the loop if nothing gets answered for ten rounds.

How to build something similar

  • Use two different models in a calculator and reviewer split, so each one can catch what the other misses.
  • Keep the goal in a file the reviewer reads every round, written as a list of open questions it has to make progress on.
  • Measure real progress, like new results or checks that pass, and not only whether a round finished cleanly.
  • Set hard stop conditions for rounds, budget and stalled progress, and look over the loop's output yourself from time to time instead of trusting it to run alone.

The original post

The autonomy wars: Autonomous workflow execution is one of the most exciting frontiers of agentic AI, both intrinsically and for its practical utility. Intrinsically, it's interesting because it raises a whole bunch of questions about workflow integrity and memory, and how accurate the thing stays when extended over a period of time. Practically, it's interesting because it has clear applications in long-horizon experimentation in drug discovery and other complex science projects. But there are important questions that we need to answer when running autonomous workflows. For instance; is the workflow really working toward the specified goal or is it just doing busy work and spinning its wheels? Is it catching inconsistencies from before? How long is "long enough" for an autonomous workflow to execute? These questions are important not just for the integrity of the workflows themselves, but also because a workflow that keeps drifting can burn very rapidly through your token budget when there is no human intervention. I have been running these kinds of tests for Claude and Codex over the last couple of weeks, and recently I had an interesting experience that indicated an asymmetry between the two. I'm not making this into a case about one of them being worse or better than the other - I used both extensively and each has its strengths and limitations - but it's just a cautionary story about what to watch out for in autonomous science. In a nutshell: I have been working on a tough geometry proof with potential applications in chemistry, and I wanted to set up an autonomous loop between Claude and Codex so that I wouldn't feel like a dumb monkey whose only job was to shuttle output from one into input for the other (a fate that we will all be sharing at some point anyway, so why start now?). Setting up this kind of loop between two different models or agentic systems is much better than doing it with just one, since you hope to have one of the models compensate for the limitations of the other and vice versa by doing adversarial reviews. I assigned Codex as the orchestrator and reviewer and Claude as the calculator. This simply meant that Claude would run a round of calculations, Codex would check in every hour, then Codex would review that round of calculations, do an adversarial review, and then automatically trigger a fresh session of Claude. Rinse and repeat until some condition has been met. This condition can be a scientific outcome, or it can be a budget spend amount, or it can be a certain number of rounds that you wanted to accomplish. I saw pretty good progress with this loop, and in fact decided to package it as a skill that I posted on GitHub (https://github.com/ajogalekar/claude-codex-loop). It's impressive: you can watch the loop at work and your token allowance gloriously diminish. But then I decided to do the reverse, just for kicks. I decided to use Codex as the calculator and Claude as the reviewer and orchestrator. Interestingly, the big difference was that unlike Codex, Claude recommended that it triggered a fresh Codex round for every successive calculation. That had not been the case before when I just had one Claude session continuously running the same calculation. The idea was that it would reduce the burden of following the context for a very long time, because as we know, context can start drifting once a conversation gets long enough. This seemed eminently reasonable to me, so I approved this decision. But in this particular case, it actually turned out that it made everything worse and in fact was a rookie mistake. Previously, with Codex reviewing and Claude calculating, it ran 26 rounds and then stopped because it had run into a stop condition. With Claude reviewing and Codex calculating, it ran 42 rounds and never stopped. Every round exited cleanly, left the fixed certificates unchanged, and passed review. That seemed hopeful, but at some point I started suspecting that something had going wr
Ash Jogalekar (@curiouswavefn) · October 21, 2026 · View on X

Want to build something like this?

Join the Shipping Skool community free. Paid members get live bootcamp calls every week.

Join Shipping Skool — Free

More use cases

← All AI agent use cases