Claim Your Free Project
Session Continuity

How We Keep an AI Agent From Losing the Plot Across Sessions

Long sessions eventually exceed the context window, and anything that only ever lived in conversation is at risk of being thinned out. A living plan file on disk is what survives that, and what lets a new session pick up cold, days later, without re-deriving context that already existed, no matter which agent opens it.

Blue Shark Tech Field Notes · 6 min read

Every AI coding session has a limit on how much it can hold in view at once. When a long session eventually exceeds that limit, older turns get summarized or dropped so the session can continue, a process usually called compaction. That's not a bug, it's how these tools stay usable over a long working session. But it has a real cost: anything that only ever lived in the conversation itself, and never made it to a file, is at risk of being thinned out or lost the moment that happens.

Why a file on disk is different

A living plan file is not subject to compaction at all. It's read back in fresh at the start of every session, which is what makes it the actual source of continuity, not the conversation history sitting behind it. Whether a session ends normally, gets interrupted, or runs long enough to compact twice over, the plan file is what's still there afterward with an accurate account of what's done, what's in progress, and what's still missing. This holds regardless of which agent you're running, and it's the one piece of continuity that's genuinely portable if your team uses more than one.

What the file needs to carry

  • Status tiers: what is actively being worked now, what is decided but not started next, and what is lower priority and not yet scheduled, in a backlog.
  • For each item: the literal fact or decision, the reasoning behind it so a future session can judge whether it's still relevant, and its current status, done, in progress, or explicitly still missing.
  • Named people, dollar figures, and decisions from conversation, not just code or build work, captured the moment they come up rather than deferred to the end of a session.

We call ours PROJECT_PLAN.md, name it whatever fits your own workflow, the convention matters more than the filename.

Where automated enforcement fits in

Without a technical check, "update the plan proactively" is itself just advisory, easy to skip under a run of fast tool calls, and exactly the kind of gap that lets a real decision or contact go uncaptured for days without anyone noticing. A session-start check, or an on-demand audit run the same way, can compare the plan file's last-modified timestamp against other recent activity in the project and flag it as stale before any other work happens, catching the drift instead of relying on memory.

What the file carries

  • NOW, NEXT, and BACKLOG status tiers
  • The fact, the why, and the current status for each item
  • Names, figures, and decisions, captured as they come up

Where enforcement helps

  • A session-start check for staleness against recent activity
  • A checkpoint before context gets thinned, to write conversation-only facts to disk first
  • An audit routine that runs the same check on demand

How this looks in the tools we actually use

Both tools now ship some form of native memory on top of whatever plan file discipline you bring yourself. Neither one replaces it, and neither one's memory reaches the other tool.

Claude Code

Auto memory is written by the agent itself as it learns preferences and project context, one memory location per project, read back in at the start of every session. A living plan file on disk sits alongside it, our own convention, not a built-in feature, and is what actually survives a compaction event mid-session since it's read fresh rather than reconstructed from a summarized transcript.

The point of maintaining it

A plan file is what keeps an AI agent working from what is done, what is in progress, and what is still missing, instead of quietly re-deriving or re-asking for context that already existed. That's the whole reason it's worth the discipline of updating it as things happen, not at the end of a session when half of what happened is already gone, and it's the one habit that pays off no matter which agent you hand the file to next.

Try Us First. On Us.

Losing context across long AI-assisted work sessions?

We'll scope one focused problem, capped at two hours of real work, completely free. Building real continuity into an AI-assisted workflow is exactly the kind of work we do.