Skip to content

Resume a Codex session with codex resume, --last, and an id

Yesterday you got Codex deep into budgetcli. It knew the original author stored some money values as floats and that you’d decided everything moves to integer cents. It knew the category taxonomy you’d settled on — groceries, rent, subscriptions, and the rest — and which two transactions you’d already hand-checked against the bank statement. Then you closed the laptop.

Now you’re staring at a fresh terminal and all of that shared understanding is sitting on the wrong side of a closed session. The naïve move is to start typing and re-explain it — slow, and worse, you’ll re-explain it imperfectly, and Codex will half-remember a version of yesterday that never happened.

You don’t have to. Codex persists every session to disk; this morning is just a matter of reopening yesterday’s instead of starting over.

Resuming happens at launch, not from inside a running session — you ask for it on the command line:

Terminal window
codex resume # show a picker of past sessions, choose one
codex resume --last # skip the picker, reopen the MOST RECENT session

codex resume --last is the one you’ll use most mornings: same project, straight back to the most recent thread. From inside the repo:

$ codex resume --last
⎿ Resumed session (yesterday 18:40) · budgetcli
Conversation restored.
> where did we leave the cents migration?
You'd converted Account.balance and Transaction.amount to integer cents
and updated the CSV importer to multiply by 100 on the way in. The reports
endpoint still reads the old float column — that's the next edit. The
category list we agreed on is groceries, rent, utilities, subscriptions,
dining, transport, other.

Notice what didn’t happen: Codex didn’t re-derive any of that. It read it straight back from the restored conversation. The float-vs-cents decision you closed yesterday stays closed, instead of getting cheerfully re-litigated an hour into this morning.

Plain codex resume is for the mornings when the most recent session isn’t the one you want — maybe you did a quick README tidy after the migration work, and --last would drop you into that. The picker lets you reach past it:

$ codex resume
Select a session to resume:
budgetcli · README + run notes yesterday 19:10
❯ budgetcli · cents migration yesterday 18:40
budgetcli · CSV date-parse fix 2 days ago 16:22

And when you already know the exact session you want — you wrote its id into a note, or a teammate sent it — you can name it directly and skip the picker entirely:

Terminal window
codex resume <SESSION_ID> # reopen one specific session by its id

The first is scope. codex resume --last resumes the most recent session for the directory you’re standing in — it’s scoped to the current working directory. Run it from your home folder instead of the repo and you’ll resume the wrong thread or none at all. cd into budgetcli first; it’s a five-second habit that saves a confusing minute. (There’s a flag to widen the search across all directories — see the resume reference — but the default is cwd-scoped on purpose.)

The second is subtler and matters more: resuming restores the conversation, not the world. It brings back what was said yesterday — not your uncommitted edits, not the branch you had checked out, not anything you changed by hand overnight. If yesterday-you left the reports endpoint half-edited and unstaged, and then stashed it, this morning’s resumed session will happily talk about that change as though it’s still in the file. Treat the code as whatever git status says right now; treat the conversation as a memory of intent, not a snapshot of the filesystem.

That second point draws the line this whole chapter lives on. Resuming isn’t Codex remembering you the way a colleague would — it’s replaying a saved transcript into a fresh window. Close that transcript without resuming it and the knowledge is genuinely gone. So anything that has to survive no matter which session you open — “money is integer cents, never float,” the category list, the test command — doesn’t belong in a chat you might or might not resume. It belongs in AGENTS.md, where every future session reads it for free. We’ll write exactly that file two chapters from now; for today, notice the gap it fills.

Resuming is the cheapest context you’ll ever buy: a whole window of hard-won understanding, restored by one command. But the same convenience has a failure mode that sets up the next two lessons.

Because resuming is so easy, you’ll be tempted to do it out of habit even when the new task has nothing to do with the old one — drag yesterday’s migration into today’s unrelated tangent just because the session is right there. That’s not continuity, it’s clutter. The discipline is to resume when you’re genuinely continuing, and to start clean when you’re not.

Right now, though, you’re squarely continuing — and the next decision in the migration is a real fork. There are two reasonable ways to build the categorisation engine, and you can’t tell which is better on paper. So instead of betting on one, you’ll build both side by side.