Skip to content
Agentic Levels
Start hereLevelsTracksPromptsAbout
Get my levelGet my level

  • Start hereYour first useful task with AI.
  • Level quiz8 questions. No AI needed.
  • Fluency ScoreYour Level and a score, from your own AI.

  • LevelsThe 11 levels, in order.
  • LessonsShort lessons, filter by level.
  • TracksGuided paths by tool, role or goal.
  • Set up your AI tool
  • Starter packFree files that help AI remember.

  • PromptsReady prompts to copy and adapt.
  • ChatGPT vs Claude vs GeminiPick the right one for the job.
  • How-tos
  • ReferenceCommands for Claude Code, Codex, Antigravity.
  • ResourcesHand-picked reading and tools.

  • Your progress
  • Your next moveAn interview that picks your next skill.
  • Your next lessonsThe next lessons at your level.
  • Updates

  • Pricing
  • About
  • FAQ & Feedback
  • Work with us
  • How we handle your data
Sign inPreferences
AboutPricingHow-tosPromptsStarter packMy stackHow we handle your data

© 2026 Fuentes Studio

PrivacyTermsRefundsAccessibilityAI content policyCredits
yourCouncil
Ready to help
✦

What do you want to understand?

Ask anything about what you're learning.

←Codex Fundamentals
  1. Tracks
  2. ›Codex Fundamentals: Module 1
  3. ›Write a task brief Codex can finish
2

Level 2 · Lesson 2 of 12 · Free

Write a task brief Codex can finish

Folder check, scope, files, proof, and stop rule

After this, you'll be able to confirm which folder Codex is working in, then give it a coding task with scope, file boundaries, proof commands, and a clear stop rule.

Before you start

Complete Choose the right Codex surface first.

The idea

Codex can only work in the folder you actually opened. Not the one you meant. A bad run often starts with the wrong folder or a branch nobody checked.

Worked example

Before and after

Before: Fix the booking form (Codex must guess the folder, scope, files, and proof). After: Tell me which folder and branch you are in. Then fix the Book a walk button so the chosen date survives a refresh, starting in src/app/booking and src/lib/booking. Do not touch payments, run the booking tests and npm run build, and stop and ask if this needs a database change.

What the AI might say

I'm in the dog-walks folder on branch main, nothing uncommitted. I changed one file in src/app/booking. The booking tests and the build both passed. Not checked: the live payment flow, which you told me to leave alone.

Why it works

The folder question came first, and each line after did one job: scope, bounds, proof, and stop rule. The reply reports against exactly those.

So the first line of every brief is a question, not a task.

Brief ShapeMove through Write a task brief Codex can finish, check proof, then fix only the weak part.
yesnorun it again
StartBegin with the real task
Write a task brief Codex canAfter this, you'll be able to give Codex a coding task with scope, file boundaries,
1Proof visible?The rewritten brief names one outcome
Ready to useRewrite one rough coding request into a Codex brief with scope, boundary, proof, and
Fix the weak partBreaks when Codex chooses the wrong owner file because the brief never named the

Step 1: ask Codex which folder it sees. Ask: Which folder and branch are you in, and which files have uncommitted changes? Codex answers in plain words, so you never have to type a command.

Three words in that question. The working folder is the folder Codex is acting in.

A branch is a named line of work, so changes can be tried without touching the main version. Uncommitted files are ones changed but not yet saved into a commit.

A reply might look like this: I'm in the cafe-site folder on branch menu-update, with two files that have uncommitted changes: package.json and README.md. I'll leave both alone. Here package.json is the file that lists a project's add-on packages.

Read the answer before you go on. Is that the folder you meant, not a parent folder holding several unrelated apps?

Is it the branch you want changed? Are the uncommitted files ones Codex should leave alone?

If any answer is wrong, fix it first. In the app, use Choose project and pick the right folder. Only if you use the terminal version: start Codex from inside that folder.

Step 2: write the brief. Codex does better work when the brief names the finish line. A vague ask like "fix the dashboard" leaves Codex guessing the scope, the risk, and the proof all at once.

No proof, no accepting the change.

A brief has four parts. Scope says what outcome you want, and bounds say which files are in play. Proof says what check has to pass: a command (a line of text Codex types to run an automatic check) that reports no errors, or a page you can open and see working.

The stop rule says when Codex should pause and ask. That keeps Codex from fixing the right thing in the wrong file, or sneaking in cleanup nobody asked for.

Good brief:

What this actually looks like

Fix the save button on the profile page. Start in src/app/profile and src/lib/profile. Do not touch billing.

Run npm test -- profile and npm run build. Stop if the fix requires a database migration.

Here is what those lines mean. A path like src/app/profile is a folder's address inside the project.

npm test runs the project's automatic checks, and npm run build checks that the site still assembles. A migration is a change to how saved data is structured, which is risky to undo.

Don't know your project's paths or commands? Ask Codex: Which commands does this project use to test and build, and which folders hold the profile page? If the project has no tests at all, name a page check instead, such as "open the profile page and confirm the name saves."

A project with several apps in one repo is where the wrong folder bites hardest. A folder can look like the app and still be missing the project's saved commands. Name the target so Codex does not adapt to the wrong one.

Build your practice project (once, about 5 minutes). The later lessons need something Codex can change and check, and this one needs nothing installed. In your codex-practice project, paste:

What this actually looks like

Build a tiny practice site here. Make one file, index.html, with a page title, a heading that says "Codex practice" and one short paragraph. Then make one simple check I can run by asking you: it confirms index.html has a title and a heading (any wording, so you can change the words later). Use only tools already on this computer. If you would need to install anything, stop and tell me first. Then run the check and show me the result.

Done means Codex reports the check passed, and you can open index.html in your web browser and see the page. If Codex says it needs something installed, ask it what and why, then approve once or ask for a plainer check. The lessons call this the practice site and its check.

In Claude Code and Antigravity: Claude Code starts in the folder where you run claude, and Antigravity works in the project folder you open. The same check applies: ask the agent which folder it is working in before the first task. The four-part brief works in all three tools.

Now Codex has a task it can finish and you can review. Check the folder, then state the proof, or the task isn't ready for Codex to touch alone.

Try it (12 min)

Paste this into Codex

Rewrite this rough request into a Codex task brief. First ask Codex: Which folder and branch are you in, and which files have uncommitted changes? Paste its answer on the first line.

Folder check: [paste Codex's answer. If the branch is main on a real project and you didn't expect that, ask Codex to make a new branch first. On the practice folder, main is fine.]
Rough request: [paste your vague coding ask]
Known files or route: [paste any known path, a route (one page address, like /booking), or write unknown]
Do not touch: [paths, APIs (how one program talks to another), auth (sign-in code), secrets, data, or none]
Proof I can run: [test, build, page, screenshot, or unknown]
Stop if: [condition that should trigger a question]

Return:
1. A one-paragraph Codex brief that starts with the folder check.
2. A file boundary.
3. A proof list.
4. One stop rule.

No project of your own? Use the practice site: change its heading, name index.html as the file, and give "run the check and open index.html" as the proof.

If you wrote unknown for files or proof, make the first task a read-only look (Codex reads and reports, changing nothing). The next lessons show how.

What a good response looks like

Folder check: I'm in codex-practice on branch main, and nothing is uncommitted. index.html and the check file are the only files. Brief: Change the heading in index.html from "Codex practice" to "Hello from Codex practice". Work only in index.html and leave the check file alone. Proof: run the check and show me it passing, then I will open index.html in my browser and read the new heading. Stop and ask if the check needs anything installed, or if the change would touch any other file.

Check yours against

  • You asked which folder and branch Codex sees before writing the task
  • The rewritten brief names one outcome
  • The boundary includes files, folders, routes, or unknowns to inspect first
  • The proof list contains at least one concrete check
  • The stop rule prevents risky guessing
  • Running Codex from a parent folder that contains several unrelated apps.
  • Ignoring uncommitted files because they are not yours. Codex still has to work around them.
  • Giving Codex a business goal with no code boundary.
  • Leaving proof as 'make sure it works.' That is not a command or observation.
  • Asking for refactors (reorganizing code without changing what it does) in the same task as a behavior fix.

When this breaks

  • Breaks when Codex edits the wrong folder or overwrites your unsaved changes because nobody checked the folder, branch, and uncommitted files first.
  • Breaks when Codex chooses the wrong owner file because the brief never named the route or module.
  • Breaks when the proof step is missing because review becomes a vibes check instead of evidence.

AI can help with this

Use Codex to help you confirm which folder Codex is working in, then give it a coding task with scope, file boundaries, proof commands, and a clear stop rule. Start with the exercise prompt and your real input. Ask for one draft, then check it against this proof: You asked which folder and branch Codex sees before writing the task. Accept only the version you can verify yourself.

You can now

✓

You can ask Codex which folder and branch it sees, and read the answer

  • ✓You can name a finish line
  • ✓You can bound the files or discovery area
  • ✓You can name proof commands or page checks
  • ✓You can decide when Codex should pause

Try it from memory

Pulling this out of your own head now is the part that actually moves it into long-term memory. Re-reading only feels like it does.

Think of a change you'd want Codex to make on your own project, not the one from the exercise. Write the brief in four lines: the outcome, what not to touch, how it proves the work, and when it stops to ask.

One good answer: 'Outcome: add a phone field to my florist's order form. Do not touch: the payment page. Proof: run the order form test and show it passing. Stop and ask if the field needs a new service.' If your stop line names a situation, not 'be careful', that works.

Key takeaways

A Codex brief starts with a folder check and is a contract. It tells Codex where to work, how to prove it, and when to stop.

  1. 1Ask which folder and branch Codex sees before the first task.
  2. 2Scope names the outcome.
  3. 3Bounds protect unrelated code.
  4. 4Proof turns review into evidence.
  5. 5A stop rule prevents risky invention.

Go deeper

  • Codex app featuresdevelopers.openai.com (opens in a new tab) ↗
Up nextMake AGENTS.md useful→

Was this helpful?

Related lessons

Plan Before You CodeDefine the Blast Radius
← Back to Codex Fundamentals