Jump to content
CodeRelayHub

← All digest entries

What Claude Code Remembers Between Sessions

Claude Code does not carry every conversation into every new session. Continuity comes from several separate mechanisms: saved conversations, instruction files, automatic memory where available, and the repository itself. Understanding those boundaries prevents a familiar failure: assuming the assistant still knows why yesterday’s implementation looks unusual.

1. Separate conversation history from durable memory

During a session, Claude Code works with a bounded context containing messages, instructions, tool results, and other material supplied to the model. That working context is not an unlimited archive. Long conversations can be compacted, and a fresh session does not automatically inherit the full conversation from an unrelated session.

The practical rule: if a decision matters tomorrow, do not leave its only explanation buried in today’s chat. Put it in a suitable instruction file, design note, test, or handoff document.

2. Resume a conversation when you need continuity

Claude Code can save local conversation history. Use claude --continue to continue the most recent conversation in the current directory, or claude --resume to select an earlier conversation. These are ways to return to an existing thread rather than expecting a new thread to remember it.

Resuming does not rewind the filesystem. Files, dependencies, branches, and external services may have changed since the saved conversation. After resuming, ask Claude Code to inspect the current Git status and relevant files before trusting earlier conclusions. Local history also should not be treated as automatically portable across machines or development containers.

3. Use CLAUDE.md for explicit, shared instructions

CLAUDE.md files provide persistent project guidance that Claude Code loads according to its instruction discovery rules. A repository-level file is a useful place for build commands, test conventions, architectural boundaries, and rules that contributors should share. User-level instructions can express preferences that apply across projects.

Keep instructions concrete: “Run the package’s unit tests before proposing a change” is more actionable than “Be careful.” Directory-specific instructions can narrow guidance to a subsystem; files deeper in the tree may be loaded when Claude works in those locations. Use /memory to inspect and manage memory-related instructions rather than guessing what was loaded.

4. Treat automatic memory as selective, not exhaustive

Recent Claude Code versions support automatic memory: notes Claude writes about useful project knowledge, preferences, and recurring lessons. Availability and behavior depend on your version and settings. This is distinct from CLAUDE.md because the assistant maintains the notes rather than relying only on instructions you author.

Automatic memory is not a promise that every correction or decision will survive. Review what was saved, correct stale assumptions, and explicitly request a durable note when appropriate. Keep essential team policy in version-controlled instructions or documentation, not solely in one developer’s local memory.

5. Expect compaction to preserve direction, not every detail

When a conversation grows long, compaction reduces earlier material to a smaller representation. You can also request it with /compact. The resulting context can preserve goals, decisions, and progress without retaining every log line, discarded approach, or exact tool response.

Before a complicated handoff, ask for a concise checkpoint covering the objective, changed files, verified commands, remaining failures, and next action. Save exact error output or reproduction steps in a durable artifact when those details are necessary. A summary is useful navigation, not a substitute for evidence.

6. Remember that disk state and routing are separate

Edits saved to disk survive a session ending, whether or not Claude remembers making them. Unsaved reasoning does not become repository knowledge automatically. Likewise, an API routing layer is not the same thing as Claude Code’s local history and instruction-loading system.

When using CodeRelay Hub, distinguish model access through its shared endpoint from the continuity maintained by your client. Changing a provider configuration or model does not, by itself, establish which transcripts or memory files the next session will load. Verify the client’s configuration and inspect the actual project state.

7. Finish with a deliberate handoff

Before stopping, record what changed, what passed, what remains uncertain, and where to continue. Remove secrets from saved notes, and avoid turning temporary workarounds into permanent instructions. On the next session, start by checking those artifacts against the current repository. Reliable continuity comes from explicit, inspectable state—not confidence that the assistant remembers everything.

Open a free CodeRelay Hub workspace.

Try it on a real task: open a workspace and spend the trial credit.

Sign up