Technically it is better. But in coding you are going to be sending dozens if not hundreds of messges. If you had unlimited tokens.. maybe. But its also slower.
Opus -> Slow, powerful, lots of tokens, Sonnet -> Slightly less powerful, faster, less token use, Haiku -> very fast, significantly less tokens, but not as smart also only on 4.5.
I use both claude and codex every day.
If I need to build a new app, i will plan with claude, wire up the app with codex because creating new apps uses a lot of tokens, codex does all initial implementation.
THen I have claude go in and refine.
Claude tends to ask more technical questions about app technologies and frameworks. Codex will ask more about what you want in the application and kind of make up more stuff on the fly adn guess what you want.