Live data from Hacker News

Unrolling the Codex agent loop

openai.com

41–50 of 220 posts

Re: Unrolling the Codex agent loop

#41

I use 2 cli - Codex and Amp. Almost every time I need a quick change, Amp finishes the task in the time it takes Codex to build context. I think it’s got a lot to do with the system prompt and a the “read loop” as well, amp would read multiple files in one go and get to the task, but codex would crawl the files almost one by one. Anyone noticed this?

Which Gpt model and reasoning level did you use in Codex and Amp?

Generally I have noticed Gpt 5.2 codex is slower compared to Sonnet 4.5 in Claude Code.

Re: Unrolling the Codex agent loop

#42
post #26

One thing that surprised me when diving into the Codex internals was that the reasoning tokens persist during the agent tool call loop, but are discarded after every user turn. This helps preserve context over many turns, but it can also mean some context is lost between two related user turns. A strategy that's helped me here, is having the model write progress updates (along with general plans/specs/debug/etc.) to…

It depends on the API path. Chat completions does what you describe, however isn't it legacy? I've only used codex with the responses v1 API and there it's the complete opposite. Already generated reasoning tokens even persist when you send another message (without rolling back) after cancelling turns before they have finished the thought process Also with responses v1 xhigh mode eats through the context window multi…

[deleted]

Re: Unrolling the Codex agent loop

#43

One thing that surprised me when diving into the Codex internals was that the reasoning tokens persist during the agent tool call loop, but are discarded after every user turn. This helps preserve context over many turns, but it can also mean some context is lost between two related user turns. A strategy that's helped me here, is having the model write progress updates (along with general plans/specs/debug/etc.) to…

but that's why I like Codex CLI, it's so bare bone and lightweight that I can build lots tools on top of it. persistent thinking tokens? let me have that using a separate file the AI writes to. the reasoning tokens we see aren't the actual tokens anyway; the model does a lot more behind the scenes but the API keeps them hidden (all providers do that).

Codex is wicked efficient with context windows, with the tradeoff of time spent. It hurts the flow state, but overall I've found that it's the best at having long conversations/coding sessions.

Re: Unrolling the Codex agent loop

#44

Has anyone seriously used codex cli? I was using LLMs for code gen usually through the vscode codex extension, Gemini cli and Claude Code cli. The performance of all 3 of them is utter dog shit, Gemini cli just randomly breaks and starts spamming content trying to reorient itself after a while. However, I decided to try codex cli after hearing they rebuilt it from the ground up and used rust(instead of JS, not implyi…

It's pretty good, yeah. I get coherent results >95% of the time (on well-known problems).

However, it seems to really only be good at coding tasks. Anything even slightly out of the ordinary, like planning dialogue and plot lines it almost immediately starts producing garbage.

I did get it stuck in a loop the other day. I half-assed a git rebase and asked codex to fix it. It did eventually resolve all debased commits, but it just kept going. I don't really know what it was doing, I think it made up some directive after the rebase completed and it just kept chugging until I pulled the plug.

The only other tool I've tried is Aider, which I have found to be nearly worthless garbage

Re: Unrolling the Codex agent loop

#45

One thing that surprised me when diving into the Codex internals was that the reasoning tokens persist during the agent tool call loop, but are discarded after every user turn. This helps preserve context over many turns, but it can also mean some context is lost between two related user turns. A strategy that's helped me here, is having the model write progress updates (along with general plans/specs/debug/etc.) to…

I’ve been using agent-shell in emacs a lot and it stores transcripts of the entire interaction. It’s helped me out lot of times because I can say ‘look at the last transcript here’.

It’s not the responsibility of the agent to write this transcript, it’s emacs, so I don’t have to worry about the agent forgetting to log something. It’s just writing the buffer to disk.

Re: Unrolling the Codex agent loop

#46

What I really want from Codex is checkpoints ala Copilot. There are a couple of issues [0][1] opened about on GitHub, but it doesn't seem a priority for the team. [0] https://github.com/openai/codex/issues/2788 [1] https://github.com/openai/codex/issues/3585

[deleted]

Re: Unrolling the Codex agent loop

#47
post #29

Earlier quoted context omitted.

codex the model (not the cli) is the big thing here. I've used it in CC and w/ my claude setup, it can handle things Opus could never. it's really a secret weapon not a lot of people talk about. I'm not even using xhigh most of the time.

When you say CC is it Codex CLI or Claude Code?

claude code

Re: Unrolling the Codex agent loop

#48

Earlier quoted context omitted.

Same goes for Claude Code. Literally has vim bindings for editing prompts if you want them.

CC is the clunkiest PoS software I've ever used in terminal; feels like it was vibe coded and anthroshit doesn't give a shit

All of these agentic UIs are vibe coded. They advertise the percent of AI written code in the tool.

Re: Unrolling the Codex agent loop

#49

Earlier quoted context omitted.

codex the model (not the cli) is the big thing here. I've used it in CC and w/ my claude setup, it can handle things Opus could never. it's really a secret weapon not a lot of people talk about. I'm not even using xhigh most of the time.

No, the codex harness is also optimized for the codex models. Highly recommend using first-party OpenAI harnesses for codex.

I used that too, but CC currently has features like hooks that codex team has refused to add far too many times.

Re: Unrolling the Codex agent loop

#50

Earlier quoted context omitted.

but that's why I like Codex CLI, it's so bare bone and lightweight that I can build lots tools on top of it. persistent thinking tokens? let me have that using a separate file the AI writes to. the reasoning tokens we see aren't the actual tokens anyway; the model does a lot more behind the scenes but the API keeps them hidden (all providers do that).

Codex is wicked efficient with context windows, with the tradeoff of time spent. It hurts the flow state, but overall I've found that it's the best at having long conversations/coding sessions.

yeah it throws me out of the "flow", which I don't like. maybe the cerebras deal helps with that.
Post reply on HN