# Claude --continue

> Source: https://aiwiki.ai/wiki/claude_--continue
> Updated: 2026-09-02
> Fact-checked: 2026-09-02
> Categories: Anthropic, Developer Tools
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) - attribute to "AI Wiki (aiwiki.ai)"
> Cite as: AI Wiki. "Claude --continue." aiwiki.ai, 2 Sept 2026. https://aiwiki.ai/wiki/claude_--continue
> From AI Wiki (https://aiwiki.ai), the free encyclopedia of artificial intelligence. Reuse freely with attribution.

**`claude --continue`** is a command-line option for [Claude Code](https://aiwiki.ai/wiki/claude_code), [Anthropic](https://aiwiki.ai/wiki/anthropic)'s coding agent. It reopens the most recent eligible conversation associated with the current directory. The short form is `claude -c`. In an ordinary interactive launch, Claude Code keeps the session's existing ID, restores its saved conversation and selected state, and appends later messages to the same transcript.[1][2][3]

The option is a convenience form of session resumption. It chooses a session by recency and directory, without asking the user to select an ID or name. That makes it different from [`claude --resume`](https://aiwiki.ai/wiki/claude_--resume), which can open a session picker or target a particular session. Anthropic introduced both options in Claude Code 0.2.93, published on April 30, 2025.[1][8][9]

## Syntax

The interactive forms are equivalent:

```bash
claude --continue
claude -c
```

Claude Code also permits the option in non-interactive print mode and with session forking:[1][2]

| Command | Result |
|---|---|
| `claude --continue` | Resume the most recent eligible session for the current directory |
| `claude -c` | Use the short alias for the same interactive operation |
| `claude -c -p "Check for type errors"` | Send a prompt to the most recent session selected under print-mode eligibility rules, print the result, and exit |
| `claude --continue --fork-session` | Copy the selected conversation into a new session ID and continue the copy |

If Claude Code cannot find an eligible conversation, it prints `No conversation found to continue` and exits.[4]

## How Claude Code chooses the conversation

The general CLI and session references describe the target of an interactive `claude --continue` launch as the most recent interactive session in the current directory. Claude Code also considers sessions that began elsewhere but added the current directory through `/add-dir`.[1][2] The command does not open the session picker, search for a name, or ask which of several conversations to use.

Background-session selection changed in Claude Code 2.1.257. Anthropic's version-specific changelog says the command can now open a finished background session and no longer reopens the stalled copy left from before that conversation moved to the background. As of version 2.1.258, the newest eligible target can therefore be either an ordinary interactive session or a finished background session.[8][9]

Anthropic's general session page, accessed September 2, 2026, still says that `--continue` skips all background sessions. That statement conflicts with the newer 2.1.257 change record. The release note is narrower: it establishes eligibility for finished background sessions, but does not say that a background session still running is an automatic `--continue` target. Running sessions have an explicit `claude attach <id>` command. The general page also continues to say that the print-mode form skips background sessions, while the 2.1.257 note does not state whether its change applies to print mode.[1][2][8][10]

The documented selection rules can therefore be summarized as follows:[1][2][8][10]

| Session type | Interactive `claude --continue` | `claude -p --continue` |
|---|---|---|
| Ordinary interactive session associated with the directory | Eligible | Eligible |
| Session created with `claude -p` | Excluded | Eligible |
| Session created through the [Claude Agent SDK](https://aiwiki.ai/wiki/claude_agent_sdk) | Excluded | Eligible |
| Session whose first prompt was `/loop` | Excluded | Eligible |
| Finished background session | Eligible in version 2.1.257 and later | General session documentation says excluded; the 2.1.257 note does not distinguish print mode |
| Background session still running | Not documented as an automatic target; use `claude attach <id>` to open it | General session documentation says excluded |

Apart from the background-session documentation conflict, the distinction between the two columns is explicit. The `-p` form can continue a scripted or SDK-created transcript that the interactive form omits. Starting `/loop` later in a conversation does not make that session ineligible; the exclusion applies when `/loop` was the first prompt.[2]

The directory rule is narrower than the lookup available through `--resume`. A session ID passed to `claude --resume <session-id>` can be resolved from another directory because current versions search the active project and its git worktrees first, then other projects on the machine. `--continue` instead answers a simpler question: which eligible conversation associated with this directory was most recently active?[1][2]

This difference matters when several tasks are in progress. A user who needs a particular named session, a session from another project, or anything other than the newest eligible local conversation should use `--resume` rather than depend on recency.[2]

## What is restored

Continuing a session does more than recover the visible text of the chat. Claude Code restores several pieces of recorded session state, although some launch-time configuration is deliberately re-evaluated.[2]

| State | Behavior on a direct terminal `--continue` |
|---|---|
| Conversation | Restores the saved history, including tool calls and tool results |
| Session ID | Reuses the existing ID and appends new messages, unless `--fork-session` is present |
| Model | Normally restores the model used by the session, subject to retirement, administrator allowlists, explicit launch overrides, and provider-specific deployment IDs |
| Agent | Normally restores the configured agent, its system prompt, tool restrictions, and model; an explicit `--agent` overrides it |
| Permission mode | Normally restores the stored mode, with documented exceptions and any explicit launch override |
| Active goal | Carries the goal into the resumed session, but resets its turn count, timer, and token-spend baseline |
| Scheduled tasks | Restores unexpired scheduled tasks; background Bash jobs and monitor tasks do not return |
| Checkpoints | Keeps checkpoints associated with the conversation available after resumption |

Agent restoration depends on the definition still being available. Claude Code looks in the session's original directory, if that workspace is trusted, and in the directory from which it is resumed. If the definition cannot be found in either location, the session opens with the default tools and system prompt and displays a warning.[2]

Permission restoration has several exceptions. A session that ended in `bypassPermissions` does not silently regain that mode, and a session that ended in plan mode does not automatically reopen in plan mode through the ordinary terminal path. Auto mode returns only if the account still meets its requirements. A launch option such as `--permission-mode` or [`--dangerously-skip-permissions`](https://aiwiki.ai/wiki/claude_--dangerously-skip-permissions) overrides the stored mode when the option is allowed by policy.[2]

The rules differ again for `claude -p --continue`. A print-mode continuation ordinarily starts with the permission behavior of a new print-mode run. A stored plan-mode session resumes in plan mode only when the invocation supplies `--permission-prompt-tool`, supplies no permission-mode or bypass override, does not fork the session, and is not started through a channel.[2]

## Configuration that is read again or must be repeated

A transcript does not preserve every argument from the process that created it. Anthropic's session documentation identifies `--mcp-config`, `--settings`, `--plugin-dir`, `--fallback-model`, and `--add-dir` as launch options that must be passed again when resuming if the session still depends on them. Directories added during the earlier session with `/add-dir` also are not restored as working directories, even though their association can help Claude Code find the session.[2]

Ordinary settings files, including `settings.json` and `settings.local.json`, are read again when Claude Code starts. A resumed conversation can therefore run under configuration that has changed since the previous process exited.[2] This is one reason to check the working directory, active branch, loaded integrations, and permission mode before allowing a long-resumed session to perform consequential work.

The same boundary applies to the filesystem. `--continue` restores recorded conversation state, not an old copy of the checkout. Claude sees the files and branch that are present when the resumed process runs.[3] Checkpoints can restore files previously changed through Claude Code's file-edit tools, but they do not cover every filesystem change or any remote side effect.[3][7]

## Continuing, resuming, and forking

Claude Code provides three related operations that should not be treated as synonyms:[1][2][3]

| Operation | Selection | Session identity | Effect on original conversation |
|---|---|---|---|
| `claude --continue` | Most recent eligible session associated with the current directory | Reuses the selected ID | Appends new messages to it |
| `claude --resume` | Picker, name, generated title, or session ID | Reuses the selected ID | Appends new messages to it |
| `claude --continue --fork-session` | Same automatic selection as `--continue` | Creates a new ID | Leaves the original transcript unchanged |

Forking is useful when the prior history is relevant but the next work should not alter the original conversation. The corresponding in-session operation is `/branch`, which copies the conversation up to that point and switches the running client to the copy.[2]

Opening the same session in two terminals without forking is not equivalent to creating two independent branches. Anthropic states that messages from both processes interleave in one transcript. Separate experiments should therefore use `--fork-session`, `/branch`, or distinct sessions rather than concurrent writes to one session ID.[2]

## Context and long conversations

The saved transcript and the model's active [context window](https://aiwiki.ai/wiki/context_window) are related but not identical. A continued session restores the recorded history, including any summaries produced by earlier compaction. As the active context approaches its limit, Claude Code first clears older tool outputs and can then replace older conversation material with a summary. Anthropic warns that detailed instructions from early turns can be lost, and recommends placing durable project rules in `CLAUDE.md` rather than relying on conversation history alone.[3]

For Pro and Max accounts, current Claude Code versions can show an extra dialog when a resumed session has been inactive for more than about one hour and contains more than 100,000 tokens. The choices are to resume from a summary, resume the full session unchanged, or resume the full session and stop showing the dialog in the future.[2]

The summary choice runs `/compact` immediately. Claude Code sends one summarization request over the full history, then carries forward the summary, the most recent exchanges, and up to five recently read files. The full-session choice keeps all recorded conversation content available. The choice affects later requests, but it does not avoid the first full-history processing after the session's [prompt cache](https://aiwiki.ai/wiki/prompt_caching) has expired. Anthropic states that the next request processes the full history once regardless of the selected option; a full resume then re-caches it while the cache remains warm.[2]

These mechanics separate three forms of persistence. The transcript stores a conversation on disk. The context window determines what the model can inspect on a request. Prompt caching can reduce the cost of repeatedly processing an identical prefix while a cache entry remains valid. Continuing a transcript does not guarantee that every early detail survives compaction, nor does it guarantee a warm prompt cache.[2][3]

## Transcript storage and retention

Claude Code continuously writes local CLI sessions as JSON Lines files. By default, a transcript is stored at `~/.claude/projects/<project>/<session-id>.jsonl`. The `<project>` component is derived from the working-directory path by replacing non-alphanumeric characters with hyphens. Very long derived names are truncated and receive a hash so that the directory name stays within filesystem limits.[2]

Each transcript line is an internal JSON object representing a message, tool use, tool result, or metadata entry. Anthropic does not treat this format as a stable public interface and warns that it can change between releases. `/export` produces a readable transcript, while print mode and the Agent SDK provide supported structured interfaces for software that needs session data.[2]

The files are plaintext and are not encrypted at rest by Claude Code. The operating system's file permissions are their local protection. File contents read by tools, pasted text, command output, prompts, and model responses can therefore appear in a transcript.[5] Anthropic's server-side retention is a separate policy that varies by account type and data-control settings.[6] Continuing a session reintroduces recorded local material into the conversation, so transcript access and retention are part of the security boundary rather than only a convenience setting.

`cleanupPeriodDays` controls the age-based cleanup of local session material. Its default is 30 days and its minimum valid value is 1. Claude Code performs the cleanup at startup when it can determine the applicable setting safely.[2][5] Removing the project transcript directory also removes the data needed for continue, resume, and conversation rewind.[5]

Session persistence can be turned off. The `CLAUDE_CODE_SKIP_PROMPT_HISTORY` environment variable suppresses transcript and prompt-history writes in all modes. In print mode, `--no-session-persistence` disables saving for one run. Claude Code documents such sessions as unavailable for later resumption, so `--continue` cannot reconstruct them.[1][2][5]

The Visual Studio Code extension and standalone CLI share the same conversation history. Anthropic documents `claude --resume` as the terminal command for continuing a conversation begun in the extension. The Claude desktop application and Claude Code on the web maintain separate histories.[2][11]

## Non-interactive use

The `-p` combination lets a script submit another prompt to a recent transcript and receive a result without opening the interactive interface. Output can be plain text, a JSON result, or a stream of JSON events, depending on `--output-format`.[1] Because `--continue` selects by recency, its target can change when another eligible session becomes newer. Anthropic's documented scripting example for addressing an existing conversation uses `claude -p --resume <session-id>`, which removes that ambiguity.[2]

A session ID can be collected from JSON output when the original print-mode run is created. A later process can then pass that exact ID to `--resume`. `--continue` remains useful for a local workflow where "the latest eligible session" is the intended target, while ID-based resumption is the precise form for automation that must continue one known transcript.[1][2]

## Checkpoints and recovery limits

Checkpoint data persists with a session and remains available after `--continue`. Every user prompt creates a checkpoint, and Claude Code snapshots files before its file-edit tools change them. From a resumed conversation, the rewind interface can restore code, restore conversation state, or restore both.[7]

This recovery mechanism has defined limits. Checkpoints do not track files changed by Bash commands. Manual edits and changes from concurrent sessions are normally not captured, unless they happen to modify the same files as the current session. File checkpoints also do not reverse database writes, deployments, API calls, or other remote effects.[3][7] Continuing a conversation therefore does not make its earlier actions transactional or fully reversible.

## See also

- [Claude Code CLI Flags](https://aiwiki.ai/wiki/claude_code_cli_flags)
- [Claude Code](https://aiwiki.ai/wiki/claude_code)
- [Claude --resume](https://aiwiki.ai/wiki/claude_--resume)
- [Claude --dangerously-skip-permissions](https://aiwiki.ai/wiki/claude_--dangerously-skip-permissions)
- [Claude Agent SDK](https://aiwiki.ai/wiki/claude_agent_sdk)
- [Context window](https://aiwiki.ai/wiki/context_window)
- [Prompt Caching](https://aiwiki.ai/wiki/prompt_caching)

## References

1. Anthropic. "CLI reference." Claude Code documentation. Accessed September 2, 2026. https://code.claude.com/docs/en/cli-reference
2. Anthropic. "Manage sessions." Claude Code documentation. Accessed September 2, 2026. https://code.claude.com/docs/en/sessions
3. Anthropic. "How Claude Code works." Claude Code documentation. Accessed September 2, 2026. https://code.claude.com/docs/en/how-claude-code-works
4. Anthropic. "Common workflows." Claude Code documentation. Accessed September 2, 2026. https://code.claude.com/docs/en/common-workflows
5. Anthropic. "Explore the .claude directory." Claude Code documentation. Accessed September 2, 2026. https://code.claude.com/docs/en/claude-directory
6. Anthropic. "Data usage." Claude Code documentation. Accessed September 2, 2026. https://code.claude.com/docs/en/data-usage
7. Anthropic. "Checkpointing." Claude Code documentation. Accessed September 2, 2026. https://code.claude.com/docs/en/checkpointing
8. Anthropic. "Changelog." Claude Code documentation. Version 0.2.93 and version 2.1.257 entries. Accessed September 2, 2026. https://code.claude.com/docs/en/changelog
9. npm registry. "@anthropic-ai/claude-code" package metadata. Version publication timestamps and current distribution tag. Accessed September 2, 2026. https://registry.npmjs.org/@anthropic-ai%2fclaude-code
10. Anthropic. "Manage multiple agents with agent view." Claude Code documentation. Accessed September 2, 2026. https://code.claude.com/docs/en/agent-view
11. Anthropic. "Use Claude Code in VS Code: Switch between extension and CLI." Claude Code documentation. Accessed September 2, 2026. https://code.claude.com/docs/en/vs-code#switch-between-extension-and-cli

