Skip to content

Claude agent: support SDK-native session persistence and resume across VM restarts #1831

Description

@atsushi-ishibashi

Request

Make "persist a Claude session and resume it later, across VM restarts" a supported path for the packaged Claude agent:

  1. AgentOs.resumeSession() should perform an SDK-native resume (ACP session/load → SDK resume), restoring full session state (context, tool state, compaction) from the persisted session file — not a "new session + transcript preamble" fallback.
  2. Session persistence should be enabled (or enableable) in the packaged adapter, and CLAUDE_CODE_SKIP_INITIAL_MESSAGES must not be forced in a way that breaks resumed-session replay.
  3. Document how to place the Claude session/config directory (CLAUDE_CONFIG_DIR) on durable storage so persisted sessions survive VM restarts.

The current adapter advertises sessionCapabilities.resume — if the above already works end-to-end, a documented statement plus a regression test would be enough to close this.

Why

Resume built from replayed transcripts is not equivalent to SDK-native resume: it loses compaction state and tool state, and re-sends the full history as prompt input. For any long-lived conversation spanning more than one VM lifetime, native persistence + resume is the only correct primitive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions