Use a plan.md File as a Checkpoint That Survives Context Resets
Context windows run out. Sessions crash. You close a tab by accident. When that happens mid-task, you lose everything and have to brief Claude from scratch.
The solution is a plan.md file written before Claude starts building. Keep it simple:
# Add JWT Authentication
## Goal
Add token-based auth to the Express API.
## Steps
- [x] Install jsonwebtoken and bcrypt
- [ ] Create /auth/login and /auth/register routes
- [ ] Add auth middleware to protect existing routes
- [ ] Write integration tests
## Files to touch
- src/routes/auth.ts (new)
- src/middleware/auth.ts (new)
- src/app.ts (register routes)
As Claude completes each step, it checks the box. If the session dies halfway through, start a fresh one and point it at the plan:
Here is the current plan.md. Continue from the first unchecked step.
Claude picks up exactly where it left off. No re-briefing, no repeated context-setting, no trying to reconstruct where things were up to.
This also works when handing a task between parallel sessions. One session writes the plan, another executes it. The plan.md is the shared contract between them.
This is distinct from Claude Code's built-in Plan Mode (Shift+Tab) — that's for the planning conversation itself. A plan.md is a persistent artefact on disk that outlives any single session.
The plan.md is not just a checklist — it is the memory that keeps long work on track.
Log in to leave a comment.
The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.
The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.
Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.