skip to content

You resume yesterday's Claude Code session with `claude -r flaky-test` and its MCP servers and extra directory are missing — what does a resume restore, and what must you pass again?

level: seniorimportance: must knowfreq 12%

answer

  1. the transcript versus the command line
  2. history, model, agent, mode
  3. launch-only flags are not saved
  4. settings files are re-read anyway
  5. system prompt recorded on first request

basics

~20 s

A resume restores what the transcript saved: the full history, the model, the agent and, on terminal routes, the permission mode, with exceptions. Launch flags such as --mcp-config, --settings, --plugin-dir, --fallback-model and --add-dir are not saved, so pass them again.

solid answer

~40 s

Resume reloads the conversation from its transcript: full history including tool calls, the model it was using (unless that model was retired, is excluded by `availableModels`, a `--model` flag or `ANTHROPIC_MODEL`-family variable picks one at launch, or the provider uses its own deployment IDs), the agent from `--agent`, the permission mode on terminal routes with listed exceptions, an active goal and unexpired scheduled tasks. Configuration that came only from the original command line is not restored: `--mcp-config`, `--settings`, `--plugin-dir`, `--fallback-model` and `--add-dir` must be passed again, and directories added with `/add-dir` are gone too. Settings files such as `settings.json` are re-read at every launch, so config that lives there needs nothing. A system prompt is recorded on the first request and reused until compaction, so changed `--append-system-prompt` text waits.

code

bash · 5 lines
bash
# resume restores history, model and agent, but not these launch flags
claude -r flaky-test \
  --mcp-config ./mcp-debug.json \
  --add-dir ../shared-fixtures \
  --plugin-dir ./tools/debug-plugin

go deeper

for a junior

Recall that a resume brings back the conversation, but flags like --mcp-config and --add-dir from the original command line must be typed again.

for a middle

Explain where each piece of state lives: the transcript restores history, model, agent and, on some routes, the permission mode; settings files are re-read; launch-only flags are not saved anywhere.

for a senior

Diagnose a bad resume quickly: missing servers mean an unrepeated flag, a changed model means one of the listed exceptions, and stale system prompt text means the recorded prompt has not been compacted yet.

for a principal

Push teams to keep durable configuration in settings files rather than launch flags, so resuming does not depend on anyone remembering yesterday's command line.

## Two sources of state When you resume a Claude Code session, its state comes from two places. The **transcript**, a JSONL file saved continuously while you worked, holds the conversation and some state recorded alongside it. The **launch** you are doing now supplies everything else: the command-line flags you type, the environment, and the settings files Claude Code reads at startup. Anything that existed only on yesterday's command line and was never written into the transcript is not there today. That is the whole explanation for missing MCP servers after `claude -r`. ## What the transcript brings back - **Conversation history**: the full history, including tool calls and their results. A tool that was still running when the previous process ended, for example in a crash, does not run again; Claude sees it marked as cut off and is told to check whether it took effect before retrying. - **Model**: the session continues on the model it was using, regardless of the current `model` setting, so another session's `/model` choice does not leak in. Exceptions: the model was retired or is not allowed by `availableModels`, a `--model` flag or an `ANTHROPIC_MODEL`-family environment variable picks one at launch, or the provider (Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry) uses provider-specific deployment IDs. - **Agent**: a session started with `--agent` or the `agent` setting continues as that agent with its tool restrictions and model; pass `--agent` to switch. - **Permission mode**: restored on the terminal routes (`claude -c`, `claude -r <id>`, `claude -r <name>` with a single match), with exceptions for elevated modes; the picker and in-session `/resume` do not restore it. - **Active goal** and **scheduled tasks** that have not expired carry over. Background Bash and monitor tasks do not; background work that died with the old process appears as a note that it did not finish. ## What you must pass again | Configuration from the original launch | Restored? | What to do | | :- | :- | :- | | `--mcp-config` | No | Pass the same file again | | `--settings` | No | Pass it again | | `--plugin-dir` | No | Pass it again | | `--fallback-model` | No | Pass it again | | `--add-dir` and directories added with `/add-dir` | No | Pass `--add-dir` again | | `settings.json`, `settings.local.json` | Re-read at launch | Nothing | | `--system-prompt`, `--append-system-prompt` | Recorded prompt reused | See below | `/add-dir` directories still help the session picker locate the session, which can make it look as if they were restored; they are not added back as working directories. The practical rule is to move configuration you depend on **into settings files**, which every launch reads, and to keep a wrapper or shell alias for the flags you cannot move: ```bash claude -r flaky-test \ --mcp-config ./mcp-debug.json \ --add-dir ../shared-fixtures \ --plugin-dir ./tools/debug-plugin ``` ## System prompt flags behave differently System prompt flags are neither simply restored nor simply dropped. By default Claude Code builds the system prompt once, on the conversation's **first request**, and records it in the session. Every later request reuses the recorded prompt until the conversation is compacted, including after `--resume` or `--continue`. So: 1. Passing different `--append-system-prompt` text on resume changes nothing yet. 2. The new text takes effect once the conversation is compacted, or in a new conversation. 3. To rebuild the prompt on every request while you iterate on its wording, pass `--system-prompt-snapshot off`. ## A long pause adds one more choice On a Pro or Max plan, resuming a session that has been idle for more than about an hour and is over 100,000 tokens opens a dialog: **Resume from summary** compacts immediately, **Resume full session as-is** keeps every detail at full per-request cost, and **Don't ask me again** always resumes in full. The prompt cache has expired by then, so the first request processes the whole history whichever you pick; the choice is about what later requests carry. ## Diagnosing a resume that feels wrong - Missing tools or servers: a launch flag was not repeated. - Unexpected model: one of the model exceptions applies, often `--model` on the resume command line. - Unexpected permission prompts: the route did not restore the mode, or an elevated mode was deliberately not re-armed.

  • You resume with a new `--append-system-prompt` text and Claude ignores it. Why?
    Claude Code records the system prompt on the conversation's first request and reuses it until the conversation is compacted, including across `--resume` and `--continue`. New flag text takes effect after compaction or in a new conversation. While iterating on the wording, pass `--system-prompt-snapshot off` to rebuild the prompt on every request.
  • Your resumed session came back on a different model than it used yesterday. What explains it?
    Normally the transcript's model is restored regardless of the `model` setting. It is not when that model was retired or is excluded by `availableModels`, when `--model` or an `ANTHROPIC_MODEL`-family variable picks a model at this launch, or on providers with deployment IDs such as Amazon Bedrock, where the normal precedence order decides.
  • On a Max plan you resume a large session after two hours and a dialog appears. What are you choosing?
    Between compacting now (Resume from summary), keeping the full history (Resume full session as-is) or never being asked again. The prompt cache has expired, so the next request processes everything once either way; the choice decides whether later requests carry the summary or the full history.

  • Resume replays every flag the session was originally launched with
  • Config in .claude/settings.json must be passed again with --settings on resume
  • A /model change in another session switches this session's model on resume
  • A tool call cut off by a crash simply runs again on resume
  • Directories added mid-session with /add-dir come back on resume
  • New --append-system-prompt text applies from the first resumed request