Ask two AI coding sessions to work on the same repository a week apart and you will often get two different projects. Not because either model is broken, but because each session reconstructs the project from whatever context it happens to load — and that context drifts.
The blank-session problem
A chat session holds a surprising amount of state: which files were already tried, which approach was rejected and why, what the human actually meant by a terse instruction. None of that is in the repository. When the session ends, it evaporates.
The next session sees only the code. It cannot tell a deliberate workaround from a bug, a half-finished refactor from a finished one. So it guesses, and its guesses compound: a convention renamed in one place but not another, a dependency pinned “temporarily” twice for different reasons, a fix that re-opens the bug it was meant to close.
Memory that lives in the repo
AgentFlow’s answer is to treat project memory as part of the project. Under .agentflow/ sit a handful of small files with distinct jobs:
docs/ai-handoff-protocol.md— the single source of truth for how work flows.state/decisions.md— what was decided, and what was rejected and why.state/known-issues.md— dead ends already explored, dated so they are not repeated.state/handoff.mdandstate/current-step.md— where the last session stopped and what to do next.state/tasks.md— the Task Ledger: one row per task, one owner per state.
A new session reads a defined set of these files before doing anything else. It starts with the project’s actual state instead of a reconstruction.
One writer, many readers
Shared writable state invites the second failure: everyone appending to the same notes until they contradict themselves. AgentFlow resolves it with a memory-ownership rule. In team mode the Orchestrator is the only writer of canonical memory; workers — developer, tester, deployer — record a Result in their own Task File and propose memory updates rather than writing them. One writer keeps the record coherent; many readers keep it useful.
What a handoff looks like
The payoff is concrete. A session that ends mid-task leaves behind: the ledger row, the runtime record of the attempt, the branch and worktree it was working in, and a Result or a draft. The next session — a different tool, a different day — picks all of that up mechanically instead of asking the human to retell the story.
Project memory is not documentation for its own sake. It is the mechanism that makes the second, tenth, hundredth session behave like a continuation of the first.
