AI-Assisted Coding · Module 5Lesson 2

Study explanation · Lesson 02 · 15 min

Set up Codex App and AGENTS.md

Setup is a verification exercise. Select the real repo root, write a short repo-grounded AGENTS.md with Module 5 guardrails, prove with two smoke tests that Codex reads your actual files, and treat every permission click as a judgment call.

Listen to this lesson

Hear the lesson read aloud, with each sentence highlighted as you go.

Narrated by an AI voice.

Setup is a verification exercise

Before you use Codex for judgment-heavy work, the notes ask you to prove it is reading the correct repo and following the correct boundaries. The instructor intentionally uses only the desktop app in this module, not the IDE extension or the CLI, to teach the app surface and the discipline of reviewing changes before applying them.

Key ideaThe real shift is not the interface. It is the posture. Smooth is not the same as safe.

Read with careThe Codex App areas below are described as the notes describe them at their date. Interfaces change; check the current app against the official pages in the readings.

The Codex App surface

The notes name five areas, each with a habit that keeps review honest.

Codex App surface · Lecture notes pp. 3-4
AreaWhat it doesRecommended habit
Project sidebarSelects the Task Tracker repo and shows project threads.Start from the repo root, not a parent folder or unrelated folder.
Thread workspaceContains one bounded task conversation at a time.Use one task per thread. Do not mix setup, security, planning, and playbook work in one long thread.
Review paneShows proposed diffs before they are applied.Read the diff before approving. Discard anything outside docs/ unless explicitly approved.
Git and worktreesHelp isolate tasks and make review safer.Treat isolation as part of the workflow, not as an advanced optional feature.
In-app browserCan preview local pages when visual confirmation is needed.Use it when the task requires visual evidence, not as a substitute for code review.

What AGENTS.md should do

AGENTS.md is the repo-level instruction file for Codex App threads. The notes say it should not be a long essay. It should be specific enough that Codex knows the stack, the commands, the important project rules and the Module 5 boundaries.

What belongs in AGENTS.md · Lecture notes p. 4
SectionUseful content
Stack and commandsHow to install dependencies, run tests, start the API/frontend, and verify the project.
Project rulesTask Tracker business rules, naming conventions, important folders, and scope decisions such as no production auth in the learning project.
Module 5 boundariesPrefer read-only analysis. Required edits should be in docs/. Reject or flag unexpected app/ changes.
Review expectationsCite files, avoid invented structure, ask before broad edits, and explain any proposed diff.

Six setup steps, each with a check

Every step in the notes’ activity flow has something specific to verify before you move on.

Setup activity flow · Lecture notes pp. 4-5
StepWhat to doWhat to verify
1. Select the repoOpen Codex App and select the Task Tracker repository folder.Codex can see app/, tests/, frontend if present, docs/ if present, and project configuration files.
2. Create AGENTS.mdAsk Codex to draft a repo-specific AGENTS.md, then review it before committing.It mentions your real stack and commands. It does not invent a different project structure.
3. Set guardrailsMake the default posture read-first and docs-first.Codex understands that Module 5 deliverables are reports, plans, worksheets, and rules.
4. Smoke test 1Ask Codex to summarize the project with file evidence.Every claim points to a real file you can find.
5. Smoke test 2Ask Codex to identify the three most recently modified files or another repo-specific fact.The answer matches the local repository rather than a generic FastAPI project.
6. Inspect permissionsUse conservative approvals. “Allow once” is the default posture for this module.Every permission click is a judgment call, not a reflex.

Open every thread with the guardrails

The library’s first prompt starts a fresh thread by stating the module goal, the docs-first constraints and a request for file evidence, then asks Codex to restate the task, the files it plans to inspect and whether it needs permission to edit. Prompts 5.1B to 5.1D then draft AGENTS.md and run the two smoke tests.

Prompt 5.1A from the libraryI am working in Module 5 of AI-Assisted Coding with the Task Tracker repository in Codex App. Module goal: I am grading and governing AI-assisted coding work. I am not building new app features in this module. Default constraints: - Prefer read-only analysis first. - Edit files in docs/ only unless I explicitly approve a different path. - Do not modify app/ during Module 5 unless I ask for one specific minimal fix. - Use one bounded task per thread. - When you make claims about the repo, cite actual files you inspected. - If you are uncertain or a file is not visible, say so instead of guessing. Before answering, briefly state: 1. The task you think I am asking for. 2. The files you plan to inspect, if any. 3. Whether you need permission to edit anything.

Four setup pitfalls

Each pitfall in the notes has a visible symptom, which is why the smoke tests come before any real work.

  • Wrong folder Codex cites files that do not exist or describes a project structure you do not have.
  • Generic summary The answer sounds polished but does not cite concrete files.
  • Unexpected edits Codex tries to change app/ during a setup or review task. Reject the diff.
  • Endless thread Several unrelated tasks in one thread make later output hard to trust and hard to compare.

Key takeaways

  • Prove Codex is reading the right repo before trusting anything it says.
  • Keep AGENTS.md short and specific: stack and commands, project rules, Module 5 boundaries, review expectations.
  • Smoke tests pass only when every claim points to a real file you can find.
  • One bounded task per thread; “Allow once” by default; read every diff before approving.

Built from the Module 5 lecture notes, prompt library and additional readings; the videos they accompany were not supplied.

Your study checkpoint

Ready to continue?

Mark the lesson complete once you have read it and tried its idea on something real.

Next · Lesson 3