Skip to content

Course · Codex · Daily workflow

Two profiles as a daily habit: budget-audit and budget-build

You met profiles twice in this course. You bundled approval and sandbox into one named profile so you would stop re-typing the two trust flags every launch, and you bundled a model and an effort level so the right gear came pre-selected. This lesson is not a third feature - it is the habit that makes those two pay, and the first habit this chapter drills. A profile you defined once and forgot saves you nothing.

The whole habit reduces to one small idea: keep two profiles for budgetcli (the course’s running example, a small self-hosted personal-finance API in Python and FastAPI), and treat switching between them as part of how you work, not an occasional config change.

Across a real day on budgetcli you are doing one of two fundamentally different things, and they want opposite postures.

Some of the time you are exploring: reading the keyword table in app/services/categorise.py to see why a row landed where it did, tracing where a balance comes from, figuring out what you want to change before changing anything. During this the agent should not write files at all. You are still forming the question, and a wrong answer that changed nothing costs nothing.

The rest of the time you are building: the change is decided, you want the edit, the test run, the iteration. Here a read-only posture is pure friction - every edit stops, and you tune out the stops, which is worse than not having them.

Those two modes want different settings on every dial you have learned, so bundle each into a profile and name them for what they are for, not what they contain:

~/.codex/budget-audit.config.toml
approval_policy = "never"
sandbox_mode = "read-only"
~/.codex/budget-build.config.toml
approval_policy = "on-request"
sandbox_mode = "workspace-write"

budget-audit is the profile you built in the approvals chapter - never paired with read-only. That pairing is safe by construction: nothing under read-only can write, so there is nothing a prompt would be protecting you from, and never lets exploration run at full speed instead of stopping to ask permission for a write it cannot make anyway.

budget-build opens the sandbox to workspace-write so edits and pytest runs happen inside the project, and keeps on-request: work inside the fence flows, and a boundary crossing stops for you.

Be precise about your own file here, because it may be wider than the block above. The minimal budget-build is exactly the two dials shown; if you followed the approvals chapter’s fenced-writing example, your saved file also carries network_access = true and a writable root at ~/budget-data, added deliberately for the one job that needed the reach. That is the line worth re-reading occasionally: the default protects you, and your own overrides decide what budget-build can actually touch.

A profile can carry more than the trust dials - model and reasoning effort belong here too, since a profile is a named config file under ~/.codex/ that takes the same top-level keys config.toml does (the config reference has the list). The two-profile habit covers trust; the models chapter adds a third, budget-design, for design-heavy work - it sits outside this habit because you reach for it by task shape, not as a daily default. Resist going further. The habit works because it is two, not eight; a profile for every micro-mood is the friction you removed, reinstalled.

Defining the profiles took thirty seconds. The skill - the part that is a habit - is reaching for the right one at launch and switching the moment the task changes underneath you.

Launch into a profile with --profile (short -p):

Terminal window
codex --profile budget-audit

You are now exploring with the agent unable to touch anything. When exploring turns into a decision - “right, I know what the change is, let’s make it” - that is the switch. End the read-only session and relaunch into budget-build:

Terminal window
codex --profile budget-build

The trigger to switch is not a clock or a checklist; it is the shape of the task changing. The instant you go from “help me understand this” to “make this change,” your posture changes with it. Run the build, review the diff, commit, and when you drop back into “now what else did this affect,” you drop back to budget-audit.

If you find yourself living in one profile most days, wrap its -p in a shell alias so a bare codex lands you there, and reserve the explicit flag for the switch. Most people on budgetcli will want budget-audit as that default - exploring is the safer place to land by accident.

What the habit buys, in the scenario’s bookkeeping

Section titled “What the habit buys, in the scenario’s bookkeeping”

Put a number on the habit instead of trusting the feel of it. The measured job is the course’s constructed one: onboarding a new bank’s CSV export into budgetcli, a five-step procedure (read the sample, map columns, convert to cents, write the importer, pin the conversion). The scenario’s Monday baseline is a cold session and a plain prompt - no profile, that procedure narrated by hand - and it costs 11 turns. Note what Monday already had: the AGENTS.md was on disk and auto-loaded even then. What it lacked was the profile, the drilled habit, and everything the later chapters added.

By now two things are in place. The rules file, 21 lines and roughly 115 estimated tokens a session, was on disk before the course began - the rules chapter audited it against the code and added the parse-path rule, taking it to about 150. And a named profile means the trust posture is not re-derived at every launch. The skills chapter measured what that leaves: the same job, run as a plain prompt with the rule and the profile in place, costs 6 turns.

Five turns go - and the attribution stays exactly what that measurement measured. The rules file and the profile were tested together against a plain prompt, so the five belongs to the combination, not to either half alone. The four turns left are procedural: you are still describing the five import steps by hand, and a fresh misunderstanding about which column is which still costs a correction turn.

One thing this rung does not have to buy you is the money path. Earlier chapters already hardened the money-handling code and pinned it with tests, so what the habit buys here is measured purely in turns.

The rules-file-plus-profile combination is worth five turns in the scenario’s bookkeeping. The other four turns are still on the table, and closing them is the next lesson’s job.

Next, the other half of daily friction: briefing the agent well and smoothing the editing surface.