Starting Projects with Codex App
You just got the green light on a new service. The product spec is a Notion doc, the deadline is two weeks, and you need a project with TypeScript, a database, tests, CI, and deployment config before you write a single line of business logic. Setting all that up by hand takes a full day. Setting it up in the Codex App takes one thread.
What You’ll Walk Away With
Section titled “What You’ll Walk Away With”- A repeatable process for bootstrapping any project type in the Codex App
- A production-quality AGENTS.md file that makes every future Codex task smarter
- Local environment configuration so worktrees install dependencies automatically
- Your first worktree thread — running isolated from your main checkout
The Workflow
Section titled “The Workflow”Step 1: Create Your Project in the Codex App
Section titled “Step 1: Create Your Project in the Codex App”Open the Codex App and add a new project. Point it at the directory where your repository lives (or will live). If you are starting from scratch, create the directory first and initialize a git repository — Codex needs a git repo to enable worktree mode.
mkdir ~/projects/billing-service && cd ~/projects/billing-servicegit initIn the Codex App, click the project selector in the sidebar and add ~/projects/billing-service. You now have a project workspace where every thread inherits the right context.
Step 2: Scaffold the Project in a Local Thread
Section titled “Step 2: Scaffold the Project in a Local Thread”Choose Local mode for the initial scaffolding since you want the files written directly into your working directory. Send your first prompt with specific constraints — Codex works best when you tell it what “done” looks like.
After Codex generates the files, open the review pane (the diff icon) to inspect what it created. Stage the changes you want, revert anything you do not, and commit directly from the App.
Step 3: Write Your AGENTS.md
Section titled “Step 3: Write Your AGENTS.md”This is the single most impactful file in your repository for Codex productivity. Every cloud task, automation, GitHub interaction, and local thread reads AGENTS.md to understand your project. Invest five minutes here and every future task gets better.
A good AGENTS.md looks like this:
# Billing Service
Express/TypeScript billing API with PostgreSQL via Drizzle ORM.
## Setupnpm installdocker compose up -d # starts PostgreSQLnpm run db:migratenpm run dev # starts on port 3000
## Testingnpm run test # Vitest unit testsnpm run test:integration # requires running PostgreSQL
## Lintingnpm run lint # ESLintnpm run type-check # tsc --noEmit
## Code style- Named exports only- async/await over raw promises- Drizzle ORM for all database access (no raw SQL)- Zod schemas for input validation on every route
## Review guidelines- Flag any raw SQL queries- Flag missing input validation- Flag console.log (use structured logger)- Verify error responses do not leak internal detailsStep 4: Configure Your Local Environment
Section titled “Step 4: Configure Your Local Environment”Local environments tell Codex what setup scripts to run when creating a worktree. Without this, every worktree starts bare — no node_modules, no database, no ability to run tests.
In the Codex App, go to your project settings and create a local environment with a setup script:
npm installdocker compose up -d --waitnpm run db:migrateNow every worktree thread automatically installs dependencies and starts PostgreSQL before Codex begins work. This is what makes parallel development actually work — each worktree is self-contained.
Step 5: Launch Your First Worktree Thread
Section titled “Step 5: Launch Your First Worktree Thread”With infrastructure in place, test the full workflow. Select Worktree mode in the thread composer and choose your main branch as the starting point. Codex creates an isolated git worktree under $CODEX_HOME/worktrees/ so nothing touches your local checkout.
When Codex finishes, you have three options for the worktree changes:
- Create branch here — promotes the worktree to a named branch. Push and open a PR directly from the App.
- Sync with local — applies the changes back to your local checkout. Use this when you need to verify against your running dev server.
- Keep iterating — send follow-up prompts in the same thread to refine the implementation.
When This Breaks
Section titled “When This Breaks”Worktree setup script fails silently. If your local environment setup script has an error (for example, PostgreSQL did not start), Codex continues but cannot run tests. Check the integrated terminal (Cmd + J) to see the setup script output. Fix the script and start a new worktree thread.
AGENTS.md is too long. If your AGENTS.md exceeds a few hundred lines, Codex spends tokens reading instructions instead of doing work. Keep it focused on commands and conventions. Move detailed architecture docs to separate files and reference them only when relevant.
Git submodules in the project. Worktrees do not automatically initialize git submodules. Add git submodule update --init to your local environment setup script if your project uses them.
Scaffolding prompt generates too many opinions. If Codex generates files you did not ask for (README badges, contributing guides, excessive boilerplate), add an explicit constraint: “Do NOT create files I did not list. Only generate the files specified above.”