Reset a session cleanly with /new and /clear
The cents refactor is finished. The categoriser’s in, the reports endpoint reads integer cents, the tests are green. The next thing on your list — adding a GET /accounts/{id}/balance endpoint — has nothing to do with any of it. Different files, different shape of work, different headspace.
Here’s the trap. The session is right there, warm and full of context, so you just start typing the new task into it. But this thread is saturated with the refactor: float-to-cents conversions, the model edits, the importer, command output from a dozen test runs. All of it is still in the window, and all of it now works against you. You’re paying for it on every turn, and — worse — it’s quietly steering the agent, which now reasons about a read endpoint through the lens of a money-handling migration. Ask it to add the balance route and don’t be surprised when it wonders whether the change affects the cents conversion.
You learned earlier in this chapter not to resume unrelated work, and not to let a tangent bleed into the main thread. This is the same principle one step further: when a line of work is genuinely finished, don’t carry its residue into the next thing. You want a clean slate — without losing your place in the terminal.
Two ways to wipe the slate
Section titled “Two ways to wipe the slate”Codex gives you two resets, and the difference is whether you keep one continuous session or start a brand-new one:
/clear # empty THIS session's conversation, same session, fresh window/new # start a NEW session, a clean thread of its own/clear resets the conversation you’re in — the window drops back to its baseline (the system prompt, your rules, the tool definitions) with none of the refactor chatter, but you’re still in the same session. /new starts a separate session — also a clean window, but a distinct thread that stands on its own in your session list. Either way you describe the actual task into a context that has room for it and no opinions about money handling:
> /clear
⎿ Conversation cleared. Starting fresh.
> add a GET /accounts/{id}/balance endpoint that returns the account's current balance in integer cents
[reads budgetcli/routes/accounts.py, budgetcli/models.py ...]The agent goes straight to the accounts route. It doesn’t reach for the importer, doesn’t ask whether the new endpoint needs a cents migration, doesn’t burn tokens re-reading refactor context it will never need. The reset wiped what the agent knew, not what it had done — every file you changed sits exactly where it was on disk.
Choosing between them
Section titled “Choosing between them”The practical line: reach for /clear when you want to keep working in this session — same terminal, same place, just a clean conversation — and /new when you’d rather the new task live as its own session you can resume later as a distinct thread. For a quick context-switch you’ll never need to find again, /clear is the lighter move. For work you’ll want to pick up tomorrow on its own, /new gives it a clean identity from the start. Check the Codex docs for the precise current behaviour of each — what’s durable is the shape: both hand you an empty window, and they differ in whether you stay in one session or open a fresh one.
One thing both share, and it’s the warning that matters: a reset is not an undo. Anything in the thread you’ll want later — a decision you reached, a useful finding, a TODO the agent surfaced — needs to be on disk before you wipe: in a commit, a note, or AGENTS.md. Reset when you want the thread gone, and only once what mattered has somewhere durable to live.
The decision under the whole chapter
Section titled “The decision under the whole chapter”Step back and almost every move in this chapter has been the same question asked from different angles: am I continuing this line of work, or leaving it?
- Continuing across days → resume it.
- Continuing, but exploring a fork in the road → /fork.
- A disposable detour, then back → /side.
- Continuing, but out of room → /compact it.
- Not sure which → /status and read the answer.
- Done, moving to something unrelated → /clear or /new.
Pick the wrong side of that question and you either throw away context you needed or keep paying for context you didn’t. The skill isn’t any single command — it’s treating the agent’s context as a resource you can see, spend, fork, reclaim, and reset at will.
Now: controlling what the agent can do
Section titled “Now: controlling what the agent can do”The sessions are under control. You can carry days of budgetcli work without the window collapsing, and start clean when clean is what you need.
But notice what you’ve been quietly trusting this whole chapter: that letting Codex read your importer, edit your models, and run your tests against your own financial data is fine. So far it has been — but the moment the work touches the real ledger, the question stops being “can I keep the context tidy” and becomes “what is this agent actually allowed to do with my money’s data.” Now that the sessions are in hand, the next thing to get under control is the agent’s reach: what it can touch, what it must ask before doing, and why the network is off by default when real financial records are on the table. That’s Chapter 3 — approvals and the sandbox.