ChatGPTCode generationLevel 2: Context

Why Shouldn't You Ask ChatGPT for a Whole App at Once?

You can't review it, so you can't trust it. Ask for a plan first, then build one piece you can run and test before you ask for the next. In Codex, /plan does this for you, and a Git commit after each step gives you a place to roll back to.

Prompt to copy
I want to build [what it does, for whom].
Stack: [language, framework and versions]. Existing code: [paste key files, or "none yet"].

Don't write the code yet. First:
1. List the units to build, in order. Each one should be small enough to run or test by itself.
2. For each unit, say how I'll know it works.
3. Name the decisions you need from me before starting, such as the data model.

Stop there and wait. After I approve the plan, build only unit 1 and give me the command to test it. Don't start unit 2 until I say so.
Hard to reviewEasy to review
  • Whole app
  • One feature
  • One screen
  • One tested function
A rule of thumb, not an OpenAI figure. Positions show rough order only. Small steps let you find out exactly which change broke things.

Try it now

  1. 1Paste the prompt into New chat with a real feature. In Codex, enter /plan in the composer first, then describe the feature.
  2. 2Change anything in the plan that's wrong, then approve only the first unit. Run its test, and commit it if you're in a repo.
  3. 3Move to the next unit. It worked if each diff is small enough to read in a few minutes, and a failure points to a single step.

Use it when

Any change you'll keep and maintain, particularly when more than one file is involved. It also fits work with an order to it, like schema, then logic, then interface, where a change to the first would mean redoing the rest.

Skip it when

A quick prototype you plan to throw away, where seeing a rough result is the entire point. On Plus and up, Sites can also host a generated app. Long autonomous runs have their place too: /goal in Codex is built for them, as long as you've set clear completion criteria and have tests to check against.

Why it works

A wrong assumption early on, such as a data model, gets copied into everything that follows. OpenAI's Working with agents page says to start with a manageable assignment, and that if you can't judge the result yet, you should narrow the scope. It also says a strong first result doesn't establish reliability across all the work, so expand scope gradually.

The context window matters as well. OpenAI's pricing page lists GPT Instant at 54K on Go and Plus, about 40 pages of input, and a long code thread fills that quickly in Chat. In Codex, the Prompting guide recommends /plan for multi-step tasks, so it can "investigate and propose an approach before editing." Its tested pull request use case asks for the smallest change that meets the criteria, then a rerun of the checks.

Example

You want a booking page with a calendar, a form and confirmation emails. In the plan, the first unit is a bookings table and a function that rejects double bookings, tested with two overlapping slots. Only then come the form and the email. If the table needs a time zone column, you find out with 30 lines written, instead of after every screen has been built on the wrong assumption.

Going further

To explore two designs without tangling them, /fork copies a local chat into a new local chat or worktree, and --worktree starts a session in a managed Git worktree. Don't run parallel tasks on the same files: OpenAI's Long-running work page warns against giving two tasks write access to the same source. For larger runs, /plan first and then /goal, whose goal text serves as both the first prompt and the completion criteria. Goal mode keeps the same sandbox and approval policy, and it pauses when it needs a decision. OpenAI also warns that interrupting has limits: changing an instruction won't undo an action that's already done.

Common mistakes

  • Reading only the last file it wrote. If you can't review the whole diff, the unit was too big.
  • Approving a plan without reading the data model. It's the most expensive thing to change later.
  • Saying "continue" over and over without running anything, so unverified code piles up on unverified code.
  • Skipping commits between units in Codex. A commit gives you a clean point to return to when a later unit goes wrong.

Sources

Checked 6 November 2026. Products change often, so confirm details with the vendor.

Related

Beyond the course