Friday afternoon. You and the agent spend a long session on the login flow and settle three things: the new flow keeps the old token format, the migration waits until the API team answers, and nobody touches the payments folder until its tests are green again. Good session. You close the laptop.

Monday morning you open a new session and type carry on. The agent answers in the same confident voice, and before your coffee is done it is proposing a new token format. It isn't broken. It was never told. An agent doesn't remember yesterday: only the repo does, so end every session by writing down what was decided, what is half-done and what not to touch.

Why it feels like it remembers

A good agent reads your code quickly, picks up your naming and sounds like the colleague you worked with on Friday. That fluency feels like memory, but the continuity you think you see comes from the files it just read, not from the model.

The documentation says this plainly. In Claude Code, each session begins with a fresh context window, so nothing from yesterday's conversation is in it unless someone wrote it down. Anthropic's engineering team describes long-running agents the same way: they work in discrete sessions, and each new session begins with no memory of what came before.

The comparison fits: engineers on shifts. Each new engineer arrives with no memory of the previous shift. Nobody runs a shift handover by hoping the next person guesses. They leave a note.

What actually carries over: files

What carries knowledge from one Claude Code session to the next is files you write. CLAUDE.md is loaded into every session, and the docs name what belongs there: coding standards, workflows, project architecture.

AGENTS.md is an open, simple format, a README for agents, kept separate so your README stays short and written for humans. One file works across many tools, Codex, Aider, Cursor, Gemini CLI, Zed and VS Code among them. A plain file in the repo is the one memory every tool and every person can read.

But look at what those files hold. Standards. Architecture. Things that stay true for months. Friday's decision about the token format is not architecture. It is state. It needs its own, different kind of file.

Anthropic's own fix is a progress file

In the same engineering article, the answer to blank sessions is a progress file, claude-progress.txt, that logs what the agents have done. It is read together with the git history, so a later session can see the earlier work. The article says the two together let the model revert bad changes and get back to a working state of the code base.

Git tells you what changed. The note tells you why, and what is still open. You need both.

My handoff note: three headings

My version is smaller than a log. At the end of every session, the repo gets a short note with exactly three headings. For that Friday it would read like this:

HANDOFF.md at the end of a session
  • Decided stops the next session from reopening a settled question. Write the reason next to it, so a later reader can tell a decision from an accident.
  • Half-done is the work that looks finished in the code but isn't. A script that exists is not a script that ran.
  • Do not touch is a guardrail in one line, and that line saves an afternoon of undoing a confident change.

What changes on Monday

Before

Without a note

  • You re-explain Friday from memory, and skip what you forgot
  • Settled questions get reopened by a fluent, confident agent
  • Half-done work looks done, so nobody finishes it

After

With a handoff note

  • The first instruction is: read HANDOFF.md, then continue
  • Decisions arrive with their reasons attached
  • The next session, or the next person, starts where the last one stopped

The note isn't only for the agent. Anyone who arrives cold reads the same three headings: a colleague picking up the branch, or you, back after a week on something else. Same file, same few minutes to get going.

The agent is fluent. The repo is the memory.

The short version

Tonight, before you close the laptop, add one file with three headings. Tomorrow, make reading it the first thing the session does.

Free guideThe Claude Code Field GuideHow I run Claude Code on two real AI systems every day: the onboarding file, plans that outlive the chat, agents with one job, guardrails in code, gates before done, and the model bill. Six parts, each with a checklist.Get the field guide Building with AI?Let's talk about your appBook a free intro call