Yesterday the agent found out why a project test was failing, and you agreed to run it from the package directory. Today you open the terminal. How does the agent learn about that agreement again? It depends on what you open and where the agreement was saved.

Three conversation states

Resuming reopens the previous session. The client finds its saved record and lets you continue the same conversation. Forking creates a separate session based on that conversation’s history. This is useful if you want to start with the same decisions and explore two ideas. If the Git changes need isolation as well, assign separate working directories for each variant. Codex CLI resume and fork · Claude Code CLI options

A new conversation gets context from different places. The client can read repository instructions again and draw on saved memory where the feature is available and enabled. In Claude Code, for example, MEMORY.md indexes the project’s auto memory and separate files hold detailed notes. Local Codex clients have their own memory store. In Codex CLI, /memories controls how the current conversation uses it. Claude Code memory · Codex Memories

CLIHistory and resumeForkingContext compactionCross-session memory
Codexcodex resumecodex fork/compactLocal Memories feature
Claude Codeclaude --resume, --continue--fork-session when resuming/compact and automatic compactionAuto memory
Gemini CLI--resume or the session browser—/compressAuto Memory proposes changes for the user to apply from /memory inbox

A dash indicates a feature outside the coverage of the cited references. Codex commands · Claude Code workflow · Gemini CLI sessions · Gemini CLI commands · Gemini CLI Auto Memory

Why history and context can differ

When a conversation outgrows the model’s working window, the client can replace earlier messages with a summary. OpenCode’s documentation describes compaction this way. The model might still know to run the test from the package directory but lose the exact command and the reasoning behind it. Prompt caching, which OpenCode also uses where the provider supports it, lets the client reuse a processed prefix. Compaction determines which details remain available in later requests. OpenCode compaction

Resume a session to continue an ongoing task. When a decision needs to apply to every future team run, put it in the repository instructions or team documentation. For this example, write down the test command and the working directory it needs. Instruction files for coding agents