In this article
- The useful way to think about Codex
- Start with a small job, not a grand vision
- Use Codex as a repo reader before you use it as a coder
- Give Codex project rules with AGENTS.md
- Keep config boringly sensible, even if we are not saying that word
- Ask for a plan before edits
- Use full-file changes when the file is small
- Make Codex run the checks, not just write the code
- Use Codex for database work, but keep it on a lead
- Let Codex explain legacy code without shaming it
- Refactor in slices, not heroic rewrites
- Ask Codex to find duplication
- Use Codex for cron and background scripts
- Use screenshots and error messages properly
- Use code review before you commit
- Use Git like a seatbelt
- Give Codex the shape of the product, not just the code task
- Keep secrets and production details out of the conversation
- Don’t let Codex upgrade your project by accident
- Use Codex to write the documentation you’ll need later
- Use Codex for test scaffolding, even if you don’t have a full test culture
- Split big changes into Codex-sized chunks
- When Codex gets it wrong
- My practical Codex checklist
- Where Codex really helps old-school web development
I’ve been using Codex lately, and the bit that surprised me wasn’t the futuristic agent stuff. It was how well it fits the kind of practical web development that never really went away: small apps, admin screens, directories, dashboards, PHP, MySQL, Apache, cron jobs, server-rendered pages, and the odd bit of JavaScript that is only there because something needs to happen without a full page reload.
That probably sounds less shiny than “AI builds your startup while you drink coffee and stare into the middle distance,” but it’s much more useful. Codex is at its best when you give it a real codebase, a clear job, and enough boundaries that it can help without turning the whole project into soup.
For old-school web development, that matters. A lot of these projects are not huge platform builds. They are useful little systems with clear jobs. A directory needs listings, categories, admin tools, search, and edit screens. A market tool needs data ingestion, ranking logic, tables, confidence signals, and a way to show the next useful action. A small business tool might need forms, exports, reminders, and a dashboard that doesn’t make anyone want to throw the laptop into the nearest hedge.
Codex helps because those projects often have understandable moving parts. You can ask it to inspect the repo, explain the structure, add a feature, write a migration, check a route, refactor a messy file, or run a test. It doesn’t remove the need to think, which is good because thinking is still irritatingly required. But it does make the work feel less lonely and less grindy.
The useful way to think about Codex
I don’t think of Codex as a replacement developer. That framing gets silly very quickly, mostly because a real project is full of taste, judgement, old decisions, hidden context, deployment oddities, and things you only remember after the tool has already tried to “improve” them.
The better way to think about it is this: Codex is a coding agent that can sit inside your project, read files, make changes, run commands, and report back. In the CLI, it can work in the selected directory, inspect the repository, edit code, and run local commands. It can also work with approvals, sandboxing, config files, AGENTS.md instructions, code review, subagents, and cloud tasks if your setup supports them.
That means the quality of the result depends less on whether Codex is clever in some abstract demo sense, and more on whether you’ve set it up to understand the job. Give it vague instructions and it will do vague things with great confidence. Give it tight constraints, a clear target, and a testing loop, and it becomes much more useful.
For a practical solo builder, that’s the sweet spot. You’re still the product owner. Codex is the very fast helper who can do a lot of the typing, checking, searching, and first-pass thinking, as long as you don’t let it wander off the trail.
Start with a small job, not a grand vision
The easiest way to make Codex useful is to stop asking it to build “the app” and start asking it to do one contained job. This sounds obvious, but it’s the bit people skip because the big prompt feels exciting. Then the tool touches too many files, guesses at product decisions, adds a framework you didn’t ask for, and suddenly you’re doing archaeology in your own repo.
A better Codex task sounds more like this:
Inspect this project and explain the current structure first. Do not make changes yet.
I want to add a simple admin page for managing directory categories.
Use the existing PHP style, existing database connection pattern, and current admin layout.
Before editing anything, tell me:
1. which files you think need to change
2. whether a database migration is needed
3. the smallest safe implementation plan
That gives Codex a lane. It has to inspect first, propose the plan, and stay inside the current style. You can then approve the plan, adjust it, or tell it that it has misunderstood the project before it starts flinging code around like a caffeinated octopus.
For old-school stacks, this works especially well because many changes are naturally contained. Add a table, create a CRUD screen, fix a query, improve a form, add validation, clean up a view, move repeated code into a helper, or make a cron script log its failures properly. These are exactly the kinds of jobs where Codex can save time without pretending it owns the product.
Use Codex as a repo reader before you use it as a coder
One of the best Codex habits is using it to read before it writes. This feels slow for about three minutes, then saves you from a lot of clean-up.
Before asking for a feature, ask Codex to map the project:
Read the repo and give me a short map of how this app works.
Focus on:
- entry points
- routing
- database connection
- auth/session handling
- admin pages
- background scripts
- config files
- anything that looks risky to change
Do not edit files.
This is useful even when you wrote the project yourself, because past-you was probably working at midnight, naming things with optimism, and promising to tidy it later. Codex can help you rebuild the mental map before you touch anything.
It also gives you a quick check on whether Codex has understood the codebase. If it says the app uses Laravel when it’s actually a small custom PHP app, you’ve just caught a problem early. If it misses a key folder or misunderstands how auth works, you can correct it before asking for changes.
This is one of those tiny workflow changes that makes AI coding feel much safer. The first task should often be “understand this,” not “change this.”
Give Codex project rules with AGENTS.md
If you use Codex regularly, AGENTS.md is where things start getting properly useful. Codex reads AGENTS.md files before it starts work, and you can use them to give the agent stable project guidance. Instead of repeating your rules every time, you put the important stuff where Codex can find it.
For a small PHP/MySQL project, an AGENTS.md might say:
# Project instructions
This is a small PHP/MySQL web app using server-rendered pages.
## Rules
- Do not add a framework unless explicitly asked.
- Follow the existing file structure.
- Prefer small, focused changes.
- Do not change unrelated files.
- Do not modify production config or secrets.
- Use PDO prepared statements for database queries.
- Keep admin UI consistent with the existing admin pages.
- If a database change is needed, propose the SQL first.
- Before editing, explain the files you plan to change.
- After editing, summarise what changed and what still needs testing.
That little file can save a lot of repeated throat-clearing. It also helps stop Codex from doing that very AI thing where it “modernises” a project because it can, not because anyone asked.
You can have global guidance in your Codex home directory and project-specific guidance inside the repo. The useful bit is that your preferences become part of the working environment rather than something you need to remember to paste in every session, which is handy if your brain has roughly seventeen tabs open already.
Keep config boringly sensible, even if we are not saying that word
Codex has configuration layers, including user-level config and project config. The important practical point is that your defaults matter. If the model, approval policy, sandbox mode, or project settings are wrong, you’ll blame Codex for weird behaviour when the real issue is that you haven’t told it how you want it to work.
For most solo builder work, I’d start with the safer defaults. Let Codex read the project, make edits inside the workspace, and ask before doing anything riskier. Don’t give it full freedom just because you’re impatient. Impatience is how a two-line fix becomes “why has it rewritten the router and installed a package called mega-runtime-pro-plus.”
A practical config approach is:
approval_policy = "on-request"
sandbox_mode = "workspace-write"
That kind of setup lets Codex work inside the project while still pausing when it needs to step outside the normal boundary. You can loosen things later for repos you trust, but there’s no prize for giving an AI coding agent the keys to the whole shed on day one.
The same goes for network access. If Codex needs to install dependencies or fetch documentation, make that a conscious choice. A lot of PHP/MySQL fixes don’t need the internet. They need the repo, the error message, the database shape, and a developer who knows when to say “no, not like that.”
Ask for a plan before edits
This is the simplest safety trick and one of the most useful. Before Codex changes files, ask it to plan the change and list the files it expects to touch.
A good prompt looks like this:
I want to add soft delete support to the links table.
Before editing anything, inspect the relevant files and give me:
- the smallest implementation plan
- the files you would change
- the SQL migration you recommend
- any risks or edge cases
Do not modify files until I approve the plan.
This gives you a review point before the work starts. It also forces Codex to think in implementation steps rather than jumping straight to edits.
For old-school apps, this is great because the “right” solution is often smaller than the AI’s first idea. You may not need a new service layer, event system, and abstract deletion strategy. You may need a deleted_at column, one updated query, and an admin restore button. Codex can help with either, but you need to steer it toward the version that matches the actual project.
Use full-file changes when the file is small
There are two kinds of AI code output that cause trouble. One is the vague snippet that tells you to “insert this somewhere around line 87,” which is a delightful way to spend your evening counting braces. The other is the massive multi-file patch where every file looks plausible until you realise one small assumption has broken half the app.
For small files, I prefer asking Codex for full replacement files or clear patches. Codex can edit directly, of course, but the principle still stands: make the change reviewable. When a file is small enough, a full file is easier to inspect than a little mystery patch.
Try this:
Update this file only: admin/categories.php.
Make the smallest change needed to add server-side validation for duplicate category slugs.
Keep the existing style.
After editing, show me a concise summary of the exact change.
For larger files, ask for a focused diff and then review it carefully. The goal is not to slow everything down. The goal is to stop the tool from making changes you don’t notice until the next bug report arrives wearing muddy boots.
Make Codex run the checks, not just write the code
The fun part of AI coding is the code appearing quickly. The useful part is getting the code checked. Don’t stop when Codex says it has made the change. Ask it to run the relevant checks and tell you what happened.
For a PHP project, that might be:
Run syntax checks on the PHP files you changed.
If there are tests, run the relevant tests.
If there are no tests for this area, tell me the manual test steps I should perform in the browser.
For a project with no test suite, Codex can still help by producing a practical test checklist:
Give me a manual test checklist for this change.
Include:
- happy path
- validation errors
- permission checks
- empty states
- database edge cases
- what to check in the logs
This is where Codex becomes much more than autocomplete. It can help you remember the fiddly bits: invalid inputs, missing records, bad IDs, permission checks, empty lists, stale sessions, and all the tiny gremlins that live between “it works on my machine” and “someone else clicked it wrong.”
Use Codex for database work, but keep it on a lead
Codex can be very helpful with database work, especially when you ask it to inspect existing schema patterns and write SQL that matches the project. It can help with migrations, indexes, safer queries, reporting views, admin filters, and data clean-up scripts.
The key is to make it propose database changes before running anything. Database changes are not the place for breezy trust. That way lies pain, backups, and muttering at the screen like a haunted lighthouse keeper.
A safer prompt:
Inspect the current schema references in the repo.
I want to add a status field to listings with these values:
- pending
- approved
- rejected
Do not run SQL yet.
Propose:
1. the ALTER TABLE statement
2. any indexes needed
3. the app files that need updating
4. how to handle existing rows
5. rollback SQL if this needs to be reverted
Then read it. Actually read it. Check the default values, existing data, indexes, and how it affects queries. Codex can help with the work, but you’re still the person who has to understand the data shape.
For content directories, dashboards, market tools, and internal apps, database design shapes the product more than people think. The tables decide what the tool can easily answer. Codex can help improve that design, but it needs the product context from you.
Let Codex explain legacy code without shaming it
A nice thing about Codex is that it can explain old code without rolling its eyes, which is more than I can say for some humans and also myself after 10pm.
If you’ve got an old PHP file that does too many things, ask Codex to explain it first:
Explain what this file does in plain English.
Then identify:
- database queries
- request inputs
- validation
- output rendering
- side effects
- security concerns
- parts that would be risky to refactor
This is useful before refactoring, but it’s also useful for getting back into a project you haven’t touched for weeks. Small solo projects often have gaps between work sessions. Codex can act like a memory bridge, helping you re-enter the code without spending half an hour clicking around and quietly resenting your own folder names.
The trick is to ask for explanation before judgement. Don’t start with “refactor this mess.” Start with “explain what exists.” Once you know what it does, you can ask Codex to propose a safe improvement.
Refactor in slices, not heroic rewrites
Codex will happily refactor a file if you ask it to, but “refactor this” is too vague. It can mean anything from renaming a variable to rebuilding the app around a pattern you didn’t invite to the party.
A better refactor prompt is:
Refactor this file in one small step only.
Goal: separate database access from HTML rendering without changing behaviour.
Constraints:
- no new framework
- no new dependencies
- keep URLs and form fields unchanged
- keep output visually the same
- update only the minimum files needed
- after editing, list the behaviours that should be retested
This lets you improve the code without turning the project into a renovation show. You can do the next slice after the first one is tested.
For old-school web apps, this is usually the sane path. First extract repeated SQL. Then clean up validation. Then move shared layout. Then improve error handling. Codex can help with each step, and each step can be reviewed without needing a lie down.
Ask Codex to find duplication
One underrated Codex use is asking it to find repeated patterns. Solo projects collect duplication like sheds collect mystery cables. One admin page becomes three admin pages, then eight, then suddenly you’ve got five versions of the same status badge and none of them agree on what “inactive” means.
Ask Codex:
Scan the admin area for duplicated patterns.
Look for:
- repeated database query logic
- repeated form validation
- repeated status labels
- repeated table rendering
- repeated permission checks
Do not edit anything yet. Give me a ranked list of cleanup opportunities, starting with the safest.
This turns Codex into a project janitor, which is not glamorous but is very useful. You don’t need to fix everything. You just need to know which duplication is making future changes harder.
Use Codex for cron and background scripts
Cron jobs are a lovely fit for Codex because they usually have clear jobs: fetch data, process data, write rows, update summaries, clear stale records, send a notification, or create a log. They also fail in ways that are deeply annoying, especially when the script works from the command line but not from cron because of paths, environment variables, permissions, timezones, or some other little goblin.
A good Codex prompt for cron work:
Inspect this cron script and make it safer to run unattended.
Focus on:
- absolute paths
- error handling
- logging
- database connection failures
- duplicate run prevention
- clear exit codes
Do not change the core data logic unless needed.
Codex can help add logging, lock files, safer exception handling, and useful output. It can also help write a manual command you can run to test the script outside cron.
This is one of the places where old-school web development feels refreshed by AI. You still have the simple scheduled job, but you’ve got a helper that can check the annoying operational details before they bite you at 2am.
Use screenshots and error messages properly
When something breaks, don’t just tell Codex “it doesn’t work.” That’s how you get guesses with confident punctuation.
Give it the exact error, what you clicked, what you expected, what changed recently, and the relevant screenshot if the tool you’re using supports image input. If the problem is visual, show the visual. If the problem is a server error, paste the stack trace or log excerpt. If the problem is database-related, include the query or schema context if it’s safe to share inside your environment.
A useful bug prompt:
This admin edit page now throws a 500 error after submitting the form.
What I expected:
- save the edited listing
- redirect back to the listing page
- show a success message
What happens:
- browser shows a 500 error
- Apache error log says: [paste relevant safe excerpt]
Recent change:
- we added status validation and a new status column
Please inspect the relevant files, identify the likely cause, and propose a minimal fix before editing.
This is where Codex can feel like a useful debugging partner rather than a code slot machine. The better your bug report, the better its first pass will be.
Use code review before you commit
Codex can help review its own work, but it’s better to treat review as a separate task. After a change, ask for a review focused on specific risks.
Review the uncommitted changes.
Focus on:
- security issues
- SQL injection risks
- permission checks
- accidental unrelated changes
- missing validation
- broken redirects
- edge cases
- whether this matches the original request
Do not edit files. Give me findings first.
This is especially useful when Codex has touched more than one file. You’re not asking it to admire its handiwork. You’re asking it to look for mistakes.
For PHP/MySQL projects, I’d put SQL injection, auth checks, CSRF handling, file uploads, and admin permissions near the top of the review list. AI-generated code can look tidy while quietly skipping a check that matters.
Use Git like a seatbelt
Before you let Codex do anything meaningful, make sure the repo is clean or at least that you know what’s already changed. This is not glamorous advice, but it’s the difference between “nice, that saved time” and “which of these 19 files did I already edit by hand?”
A simple rhythm works:
git status
git add .
git commit -m "Checkpoint before Codex changes"
Then run Codex. Review the diff. Commit the good change. Revert the bad one without drama.
You can also ask Codex to inspect the current diff:
Review the current git diff and summarise what changed.
Tell me:
- files changed
- intended behaviour change
- unrelated changes, if any
- risks before commit
That makes Git part of the workflow rather than a panic button.
Give Codex the shape of the product, not just the code task
A lot of AI coding mistakes happen because the tool doesn’t know what the product is trying to do. It can see code, but it doesn’t automatically know the product judgement behind it.
For a decision-first tool, the point may not be to show every data point. It may be to make the next useful action obvious. For a directory, the point may not be adding endless filters. It may be helping someone find the right thing quickly. For a small admin app, the point may be reducing repeated work, not producing a perfect software architecture diagram.
So include the product shape:
Product context:
This app helps users find the best action quickly. Avoid adding extra dashboard clutter unless it directly helps the decision.
Task:
Improve the route details page by adding clearer trust signals for data freshness and confidence.
Constraints:
- keep the page simple
- use existing data where possible
- do not add new charts
- explain any missing data instead of hiding it
That kind of context changes the output. Codex stops treating the task as “add UI stuff” and starts working toward the actual product experience.
Keep secrets and production details out of the conversation
This should go without saying, which means it absolutely needs saying. Don’t paste secrets, live credentials, API keys, private tokens, or production-only config into prompts unless you’re working inside a controlled environment designed for that and you understand the risk.
Use .env.example, fake values, redacted logs, and safe excerpts. If Codex needs to understand a config shape, give it the shape without the secret.
For example:
DB_HOST=localhost
DB_NAME=example_app
DB_USER=example_user
DB_PASS=REDACTED
For deployment issues, describe the environment without handing over the keys. Codex can still help with Apache config patterns, path problems, permissions, cron command structure, and likely causes based on logs.
AI tools are helpful, but they don’t turn private infrastructure into public note-taking material. Keep the sharp bits covered.
Don’t let Codex upgrade your project by accident
This is one of my big rules. Codex should not add dependencies, frameworks, build steps, or architectural patterns unless you asked for them and understand why they’re needed.
A lot of small web projects are good precisely because they’re easy to deploy and understand. A PHP file, a MySQL table, and an Apache vhost may not impress the conference crowd, but they can run for years if you don’t keep stapling unnecessary cleverness to them.
Put this in your project instructions:
## Dependency policy
- Do not add production dependencies without asking first.
- Prefer using existing project utilities.
- Avoid introducing build steps unless explicitly requested.
- If a dependency would help, explain the tradeoff before adding it.
This keeps Codex from solving a small problem by expanding the project surface area. Sometimes a helper function is the answer. Sometimes a small SQL query is the answer. Sometimes the best dependency is none.
Use Codex to write the documentation you’ll need later
A lovely use for Codex is writing the little bits of documentation you know you should write but somehow never do because the kettle boiled, the phone buzzed, and the dog looked emotionally complex.
After a feature lands, ask:
Write a short developer note for this feature.
Include:
- what it does
- files involved
- database changes
- how to test it
- known limitations
- where to extend it later
This can become a section in your README, a /docs note, or a comment in your project journal. It doesn’t have to be a formal manual. It just has to help future-you remember what present-you was trying to achieve.
Codex is also good at making README sections more useful:
Update the README with a practical local setup section.
Use the actual project structure.
Include:
- requirements
- database setup
- config file setup
- how to run locally
- how to run background scripts manually
- common troubleshooting notes
That kind of documentation makes the next Codex session better too, because the project becomes easier for both human and agent to understand.
Use Codex for test scaffolding, even if you don’t have a full test culture
Plenty of small web projects don’t have a lovely complete test suite. That doesn’t mean you should give up and live in the woods. Codex can help add small checks where they matter most.
Start with functions that are easy to test: route scoring, slug generation, data freshness logic, price calculations, validation helpers, parsing functions, and anything that turns input into output without needing the whole app running.
A prompt:
Find a small piece of business logic in this repo that would be easy and useful to test.
Do not add a large testing framework without asking.
Propose a minimal test approach first.
For a PHP project, it might suggest PHPUnit if appropriate, or a simple CLI check if the project is small and not already set up for tests. The point is not to become a test purist overnight. The point is to protect the bits of logic that would hurt if they quietly broke.
Split big changes into Codex-sized chunks
Codex can handle larger tasks, but that doesn’t mean you should hand it a foggy mountain and say “off you go, little robot.” Split features into chunks that can be reviewed.
Instead of:
Add user accounts to the app.
Try:
Phase 1: Inspect the app and propose the smallest user account system that fits the current structure. Do not edit files.
Phase 2: Add the database tables and config changes only.
Phase 3: Add login/logout using the existing layout.
Phase 4: Add permission checks to admin pages.
Phase 5: Review the full change for security and missing edge cases.
That gives you control points. You can stop after any phase, change direction, or reject a plan before it spreads through the repo.
This matters more with old-school apps because they often have a lot of implicit structure. There may not be a neat framework convention telling Codex where every piece belongs. Your phases become the structure.
When Codex gets it wrong
Codex will get things wrong. It may misunderstand the app, miss an edge case, overcomplicate a fix, change a file you didn’t expect, or produce code that passes a quick glance but fails under a real user clicking things in the wrong order. That doesn’t make it useless. It means it’s a powerful tool that still needs someone steering it.
When it goes wrong, don’t just keep prompting randomly. Reset the context around the mistake:
This implementation is going in the wrong direction.
The problem:
- it added a new dependency I did not want
- it changed the routing pattern
- it modified unrelated files
Please stop and propose a smaller version that:
- uses the existing routing
- changes only the admin page and one helper
- avoids new dependencies
- preserves current URLs
If the session has gone properly sideways, use Git to revert and start a smaller task. There’s no shame in that. Well, maybe a tiny sigh, but no shame.
My practical Codex checklist
Here’s the workflow I’d use for most small web projects:
- Start with a clean Git state or make a checkpoint commit.
- Ask Codex to inspect and explain before editing.
- Give product context, not just code instructions.
- Ask for a plan and file list before changes.
- Keep the task small enough to review.
- Use AGENTS.md for project rules.
- Keep sandbox and approvals sensible.
- Make Codex propose database changes before running SQL.
- Ask it to run syntax checks, tests, or manual test planning.
- Use a separate review prompt before committing.
- Commit the change once you’ve checked the diff.
- Ask for a short developer note so future-you isn’t left guessing.
That workflow is not fancy, but it works. More importantly, it keeps you in charge of the project while still getting the benefit of a fast coding agent.
Where Codex really helps old-school web development
The reason Codex feels good with older, simpler stacks is not nostalgia. It’s fit.
A lot of practical web development is clear, contained work: add this admin screen, fix this query, explain this legacy file, make this cron job safer, write the SQL, add validation, improve the README, review this diff, find duplicated logic, and tell me what to test before I deploy.
Codex is good at that kind of work because the boundaries are understandable. The stack isn’t hiding everything behind six layers of build tooling. The app has files, routes, queries, views, scripts, and outputs. You can point at a thing and say, “make this better, but don’t touch the rest of the shed.”
That’s why Codex makes old-school web development feel new again. Not because it turns every small app into a futuristic agent-powered wonder machine, thank mercy, but because it removes some of the friction from practical building. It helps you move faster through the parts that used to slow you down, while still letting you keep the simplicity that made those stacks useful in the first place.
Use it like a junior developer with very fast hands, not a wizard. Give it context. Give it limits. Make it show its work. Keep Git close. Read the diff. Test the result. Then let it take another small job off your plate.
That’s the version of AI coding I can actually get behind.