Skip to content

Save a plan to disk and resume it in a fresh session

The idempotency fix is the kind of change that doesn’t land in one sitting — research today, implement tomorrow, finish after the migration’s reviewed. Which exposes a quiet fragility in everything you’ve done so far: the plan you just approved lives in the conversation. And you already know from the Sessions chapter what happens to conversations — they get compacted, cleared, and closed. A plan that only exists in the context window is a plan that can quietly evaporate before you’ve built it. For anything spanning more than a session, you want it on disk.

The most direct move is the Ctrl+G you met in the last lesson. It opens the proposed plan in your text editor — so before you approve, you can save it to a real file: docs/idempotency-plan.md, a scratch note, wherever your project keeps design docs. Now the agreed approach is a file you own, independent of any conversation. Compaction can’t touch it; a /clear can’t lose it; you can read it next week without resurrecting the session that produced it.

Once you’ve approved the plan and the session has dropped into a build mode, there’s an even cleaner habit: make writing the plan to disk the first implementation step.

> before you start, write this plan to docs/idempotency-plan.md as a
checklist, then work through it one item at a time, checking off each.
⏵ Write docs/idempotency-plan.md ✓
⏵ Edit src/routes/charges.js ...

Now the plan is both a durable artifact and a live progress tracker — if the session dies halfway, the file shows exactly what’s done and what’s left, and any fresh session can pick up from the checklist instead of from scratch. This is the same instinct the whole course keeps returning to: when something matters, write it down where the context window can’t lose it.

Because the file is on disk, resuming is two independent moves, and you can use either or both:

  • Resume the conversation. Remember from the last lesson that approving a plan auto-names the session from the plan’s content. So when you come back, the session is easy to spot — claude --resume lists it under a name like “Make charge endpoint idempotent” rather than an opaque ID, and you continue with the full history intact. (That’s the resume mechanics from the Sessions chapter paying off — naming was the reason it’s findable.)
  • Re-seed a clean session from the file. Or start fresh and just point a new session at the plan: read docs/idempotency-plan.md and continue from the first unchecked item. No old context, no compaction baggage — just the plan and the code. Often the better choice for a long build, because it keeps the window lean.

Make planning the default where it belongs

Section titled “Make planning the default where it belongs”

If you’ve got a project where almost every change deserves a plan first — a payment system is a fair candidate — you don’t have to reach for Shift+Tab each time. Set plan mode as the project’s default:

.claude/settings.json
{
"permissions": {
"defaultMode": "plan"
}
}

Now every session in this repo starts in plan mode — the agent researches and proposes by default, and building is the deliberate second step you opt into. For a codebase where a wrong edit is expensive, that’s the right floor: plan first unless you say otherwise. The full set of mode and settings options is in the settings docs.

You’ve now got plan mode working end to end inside the terminal: research, review, persist, resume. There’s one more surface worth knowing — for a plan big enough that you’d rather review it like a document, with comments and sections, than scroll it in a terminal. That’s what Ultraplan is for.