Claude Code vs Codex for web development: how I use both
I build websites and web applications with AI coding agents every day, from one-line CSS fixes to server work across several live sites. This is how I actually split the work between Claude Code and OpenAI Codex, with real examples, and the precautions I use to reduce the risk of mistakes on live sites.
Need a website or web app built this way? Email me at [email protected] and I’ll reply within one working day.
The short answer
I don't pick one. I use Claude Code as the main agent that does the work: reading the codebase, editing files, running commands on servers and checking the result in a browser. I use Codex as a second, independent reviewer when a decision matters, such as an audit, a risky change or an “is this really set up correctly?” question. Two agents that don’t share a conversation often make different mistakes, and the places where they disagree are exactly where I need to look myself.
What each tool is
- Claude Code is Anthropic’s agentic coding tool. It runs in the terminal, in a desktop app and in IDEs, reads and edits files in your project, runs shell commands, and can check pages in a browser when a browser integration is set up (I use its Chrome integration). It can load project instructions from
CLAUDE.mdfiles. - Codex is OpenAI’s coding agent. It is available as a desktop app, a command-line tool (CLI), IDE extensions and cloud tasks, and it can load project instructions from
AGENTS.mdfiles. The CLI can also run non-interactively (codex exec), which makes it easy to ask it for a review as a one-off command.
Both are good at writing code. What matters to me in day-to-day web work is how reliably each one follows instructions over a long session, and how clearly it reports what it actually checked. This isn’t a benchmark: it’s how the two fit into my own workflow.
Claude Code vs Codex: which I use for each web development task
- Small front-end fixes (CSS, layout bugs, copy changes): Claude Code, because it can open the page in a browser and measure whether the fix worked.
- Server and hosting work (Apache, PHP, DNS, mail, Cloudflare): Claude Code over SSH, with strict rules about backups and secrets.
- Data questions (logs, analytics, “where is my traffic coming from?”): Claude Code, querying the logs and databases directly instead of trusting a dashboard.
- Audits and second opinions: Codex, given the same files and the question, without my conclusion.
Have a project in mind? I build websites and web applications, from simple business sites to custom platforms with payments, dashboards and integrations, using these tools with a developer reviewing every change. Tell me about your project or email [email protected].
Setting up the agents to reduce mistakes
No set of rules makes an agent risk-free, so I combine written instructions with limits the tools enforce, plus backups, review and checks:
- Back up before every live change. Before a file on a live server changes, it is copied to a dated backup outside the public folders, so I know exactly how to restore it. Database and DNS changes get their own export or a note of the old values first.
- Keep secrets out of the conversation. API keys and passwords stay in config files with restricted permissions, and the agent checks that a key is set without printing its value. I type passwords myself; the agent never handles them.
- Limit what each agent can do. Claude Code asks for permission before commands it hasn’t been allowed to run, and when Codex reviews something it runs in a read-only sandbox, so it can read the files but not change them.
- Check every change. “Done” means the agent ran a check suited to the change and said what it covered: a syntax check, an HTTP status, a test request, a measurement in the browser. A check is evidence, not a guarantee, so I still review the diff.
- Ask before anything outward-facing. Sending an email, changing DNS or deleting data waits for my explicit yes.
- Treat page and file content as data. Text an agent reads on a web page, in an email or in a file is information, not an instruction to follow.
- Write the environment down. Which server hosts which site, where the logs are, how mail is routed. Putting this in
CLAUDE.md/AGENTS.mdsaves the agent from rediscovering it every session, and stops it guessing.
Simple: a mobile layout bug that a quick fix didn't solve
One of my sites had a mobile menu drawer that let the whole page scroll sideways. The first fix, overflow-x: hidden on the html element, looked right but wasn’t: when the agent tested the page in Chrome, a script could still scroll it 15 pixels sideways. Adding overflow-x: clip to body as well fixed it, and the agent confirmed it by checking that the page’s scroll width now equalled its visible width.
This is the pattern I want from an agent on small jobs: not “I added the usual CSS”, but a measurement showing the bug is gone.
Medium: adding bot protection to live forms
For an architecture news site, I added Cloudflare Turnstile to the newsletter and contact forms. The work crossed three places: creating the widget in the Cloudflare dashboard, installing the keys in the site’s PHP config, and proving the server really rejects submissions without a valid token.
The first test passed for the wrong reason: the test email used example.com, which the form already rejected before it ever reached the Turnstile check. Re-running it with a realistic address showed the request being refused and logged as missing a Turnstile token. Without reading the order of checks in the code, it would have been easy to call the job done after the first test.
Complex: finding out what a site’s traffic really is
A travel directory I run showed about 1,900 visitors in a day. Reading the server logs and the site’s own analytics database told a different story:
- A distributed crawler was hitting the search page with endless combinations of filters, thousands of times a day, from rotating home internet addresses.
- A second crawler was copying listing pages one per address, so each request looked like a new one-page “visitor”.
- Filtering for behaviour that looks human (more than one page, a search engine referral or a phone) left roughly 75 likely real visitors. That is a rough filter, not proof, but it is far closer to the truth than the dashboard.
The agent then tightened the server’s crawler controls, fixed the logs so they record the real visitor address behind Cloudflare, and updated robots.txt. When it checked the logs again later, it found some requests still getting through by faking where they came from, which is the kind of follow-up a human easily forgets.
Using Codex as the second reviewer
When I wanted to know whether a travel site was set up to earn affiliate commission, Claude Code traced the full click path: the outbound links, the affiliate network’s redirect, and whether the tracking ID survived to the booking page. It concluded that the tracking worked but the programme only paid for bookings from one region, which didn’t match where the visitors were.
I then asked Codex the same question independently, with the same files and without that conclusion. The command looked like this, run from the site’s folder:
codex exec --sandbox read-only "Audit this site's affiliate setup: link format,
URL encoding, redirects, rel attributes, disclosure, anything that could stop
clicks or sales being credited, and whether the programme fits the traffic.
Reply with a prioritised list: finding, evidence (file:line), severity, fix."
It reached the same result. Their agreement gave me more confidence, but I still checked the evidence myself before acting, because two agents can share the same blind spot. When they disagree, I read the code myself.
A real case where Codex caught what Claude Code missed: this article. Claude Code wrote the first draft, and I asked Codex to review the wording before it went live. It found several statements that were wrong or too strong:
- The draft said Claude Code reads
CLAUDE.md“at the start of every session”. In fact which instruction files load depends on where they are, so “can load” is accurate. - It described Codex without its desktop app, and said Claude Code “can drive a browser” without mentioning that this needs a browser integration set up.
- It said the safety rules “stop” the tools breaking things and that checks “prove” a fix worked. Rules reduce risk and checks are evidence, not guarantees.
- It gave enough detail about one site’s crawler defences to help someone get around them.
None of these were bugs in code, but each would have made the article less accurate or less safe. That is the point of the second reviewer: the first agent is often confidently wrong in small ways, and a fresh pair of eyes without its assumptions finds them.
Where both tools go wrong
- Confident wrong answers. Both will occasionally report a fix as done when it isn’t. The defence is the “verify, don’t assume” rule above.
- Environment quirks. Example: scripts sent from Windows PowerShell to a Linux server over SSH arrived with Windows line endings and a byte-order mark, and failed in confusing ways. Stripping the Windows line endings and sending the script base64-encoded fixed it, because the server then receives exactly the bytes that were written. That method is now written into the instructions file.
- Testing the wrong thing. As in the Turnstile example: a test can pass for a reason that has nothing to do with the change.
- Scope creep. An agent asked to fix one thing will sometimes “tidy up” three others. Clear rules, and reviewing the diff, keep changes small.
Do you still need a developer?
Yes, but the job changes. The agents write and change code quickly; the developer’s job is knowing what to ask for, setting the rules, spotting when a result is plausible but wrong, and deciding what is safe to put live. On a simple site, AI tools can get the same work done in less time. On a complex application with payments, real users and live data, the review and the guardrails matter more, not less.
That is the service I offer: you get the speed of AI-assisted development, and a developer who knows what to check before anything goes live. If you need a website, a web app or an existing site fixed, send me the details or email [email protected].
Common questions
Is Claude Code or Codex better for web development?
For my work, Claude Code is the better main agent because it handles long, multi-step jobs across files, servers and the browser well, and Codex is most useful as an independent reviewer. Both are capable, and a second review can catch mistakes the first one misses.
Can I use Claude Code and Codex on the same project?
Yes. If you use both instruction files (CLAUDE.md and AGENTS.md), keep the shared rules consistent so both agents work to the same standards, and give each one its own job, for example one builds and the other reviews.
Is it safe to let an AI agent work on a live server?
It always carries some risk. Tested backups, restricted access, approval for important changes and checks afterwards reduce that risk a lot, and where I can, I test changes before they go live. Without those precautions, I wouldn’t do it.
Can AI coding agents build a complex web application?
They can write a large share of the code, but a complex application still needs someone to design it, review the changes and decide what is safe to put live. The agents can save a lot of time, depending on the task; they don’t replace that judgement.
Want a web app built this way?
I use AI coding agents to help build and maintain websites and web applications, and I review every change they make. Tell me what you need and I’ll reply within one working day.
