Vibe coding is a way to build an app through conversation. You describe what you want in everyday language, try the software the AI writes, and ask for changes. A book club might start with “Make us a reading list where we can add books, mark them as read, and search by title.” After trying the first version, a member might ask, “When I mark a book as read, can it stay on everyone else’s to-read list?”
In agentic coding, you give an AI coding agent a goal and access to the project files it needs. OpenAI’s Codex uses an AI model and tools to carry out that work. It can create the form where a reader enters a title, write the code that saves the book, and run a test to check that the title is still there after the page reloads. If the test fails, the agent can inspect the code, revise it, and try again. You can check its work by adding a title of your own and reloading the page. How language models work · How to give Codex a coding task
This exercise starts with one feature of that larger app. The starter already has three books and a search box. Typing Moon finds Moon Atlas and Moon Journal, but typing moon makes both disappear. You’ll ask Codex to fix the search, check it in your browser, and then use the same process to add a Clear search button.

Open the reading list and see the bug
You’ll need a desktop browser and access to Codex. This fictional reading list is a single HTML file that runs when you open it. You can do the whole exercise locally, without installing packages or setting up GitHub.
- Create an empty folder named
reading-list. Download the reading-list starter (HTML) and save it there asindex.html. If your browser saves it in Downloads, move it into the folder. - Double-click
index.html. You should see Moon Atlas, A Garden at Night, and Moon Journal, in that order. - Type
Moonin Search titles. Two books remain. Change the query tomoon. The page now says “No matching titles.” Clear the field to bring all three books back.
Copy the complete starter HTML
If you prefer to make the file yourself, paste this code into a plain-text editor and save it as index.html in the practice folder.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My reading list</title>
</head>
<body>
<h1>My reading list</h1>
<label for="search">Search titles</label>
<input id="search" type="search">
<ul>
<li>Moon Atlas</li>
<li>A Garden at Night</li>
<li>Moon Journal</li>
</ul>
<p id="empty" hidden>No matching titles.</p>
<script>
const search = document.getElementById("search");
const titles = document.querySelectorAll("li");
const empty = document.getElementById("empty");
search.addEventListener("input", () => {
let count = 0;
for (const title of titles) {
const matches = title.textContent.includes(search.value);
title.hidden = !matches;
if (matches) count += 1;
}
empty.hidden = count > 0;
});
</script>
</body>
</html>
In the ChatGPT desktop app, sign in, open the reading-list folder as your project, and choose Codex from the ChatGPT dropdown. Keep the browser tab open for later. Codex needs to read and edit this practice folder. The sandbox limits what local commands can access, and the approval settings determine when you’re asked for permission. OpenAI’s desktop quickstart · How Codex permissions work
Ask Codex why one letter matters
Send this first prompt while the broken file is still in front of you.
Read index.html. Searching for “Moon” finds two titles. Searching for “moon” finds none. Show me the line that accounts for the difference, explain it in plain English, and suggest the smallest repair. Leave the file as it is for now.
Look for title.textContent.includes(search.value) in the answer. That line asks whether a title contains the exact characters in the search box. JavaScript treats uppercase M and lowercase m as different characters. The program is following its rule. You get to choose a better rule for your readers.
Give Codex the repair and a way to test it
A reader might type a lowercase title or paste one with an extra space. Tell the agent how both should behave and let it carry the edit through testing.
Fix the search in index.html so capitalization and spaces at either end of my query do not affect the results. Keep this a single HTML file and preserve the titles and their order. Check “Moon”, “moon”, mixed-case “mOoN” with two spaces on each side, “river”, spaces alone, and clearing the field. If a check fails, use the result to revise the fix and repeat the checks. Tell me what you changed, what you actually ran, and anything I should try in my browser.
A small repair can trim the ends of the query and compare lowercase versions of the query and each title. The books on screen should keep their original spelling. Read the agent’s report to see which checks it ran. A check of the matching expression can establish that two strings match. Opening the page also checks whether the correct rows and message appear. OpenAI’s guide to prompting Codex
Reload the page and check the results
If Codex reports that it could only suggest an edit, check that you opened the practice folder and gave it permission to edit that file. Once the edit is saved, reload your local index.html in the browser. Replace the contents of the search field for each row.
| Try this search | Look for this result |
|---|---|
Moon, then moon | Both show Moon Atlas followed by Moon Journal. |
mOoN with two spaces on each side | The same two titles appear, in the same order. |
river | All three titles disappear. “No matching titles.” appears. |
| Three spaces | All three titles return in their original order. The message disappears. |
river, then clear the field | The empty message appears for river, then disappears and all three titles return. |
If a search still fails
Suppose lowercase works but surrounding spaces still hide both books. Here’s what to send. If you saw a different failure, substitute your exact input and the result on your screen.
I reloaded the page. Lowercase “moon” shows two titles, but adding two spaces before and after it shows “No matching titles.” Trace that exact input through the filter, fix the cause in index.html, and repeat both searches. Tell me what you observed.
Read the edit before you keep it
A diff shows the lines that changed. Look for the change to the comparison, then check that the three titles still have their original spelling and order. If you’re unsure how the edit handles an empty field, ask for a review.
Walk me through the lines you changed in index.html. Why does an empty search still show all three titles? What happens to the message after I go from “river” back to “Moon”? Name anything you could only infer from reading the code, and give me a browser check I can repeat. Make this a review only.
Try that last transition yourself. With river in the box, select the text and replace it with Moon. The message should disappear as the two matching titles return. Keep the edit once you can explain what changed and reproduce the behavior you wanted.
Choose where to run the next task
For a file you can open on your computer, local work makes it easy to switch between the agent’s edit and the running page. Codex also works in a code editor or terminal. For background work on a shared project, a cloud environment gives the agent its own workspace. Give it the right project version and a way to run the checks there. OpenAI’s guide to local and cloud options
- If you like working beside your files, Cursor provides an editor-based agent. Claude Code runs in the terminal. For individuals coming from Gemini CLI, Google points to Antigravity CLI. Cursor Agent · Claude Code · Google’s terminal guide for Gemini CLI users
- If your project already lives on GitHub, Copilot can propose changes for review in a pull request. Replit offers a hosted environment where you can build and preview an app. GitHub Copilot · Replit’s agent guide
For a shared project, save the actual test command and the team’s conventions with the code. Another contributor can then ask an agent to run the same checks you use before accepting an edit.
Try a feature of your own
After the repair, someone using the list still has to select and delete a query to start over. Give the agent a new task with a clear finishing point.
Add a button labeled “Clear search” beside the reading-list search box. When I search for “river” and activate the button, all three titles should return in their original order, the empty message should disappear, and I should be able to type a new search immediately. Keep the page in one file. Check mouse and keyboard activation where you can, and tell me how to repeat the checks.
Try the button once with the mouse. Then type river again, press Tab to reach Clear search, press Enter, and immediately type moon. If the two moon titles appear without another click, you’ve verified that the button returned keyboard focus to the search field.