Claude agent: support SDK-native session persistence and resume across VM restarts
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 4.6k
- Forks
- 251
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 34
Description
Request
Make "persist a Claude session and resume it later, across VM restarts" a supported path for the packaged Claude agent:
AgentOs.resumeSession()should perform an SDK-native resume (ACPsession/load→ SDKresume), restoring full session state (context, tool state, compaction) from the persisted session file — not a "new session + transcript preamble" fallback.- Session persistence should be enabled (or enableable) in the packaged adapter, and
CLAUDE_CODE_SKIP_INITIAL_MESSAGESmust not be forced in a way that breaks resumed-session replay. - 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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing AgentOs.resumeSession() through the ACP session/load and SDK resume path, then inspect how the packaged adapter handles persistence and CLAUDE_CODE_SKIP_INITIAL_MESSAGES. Verify whether CLAUDE_CONFIG_DIR can be placed on durable storage and add or run a regression test covering resume across VM restarts; done means native state, including context, tool state, and compaction, is restored.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- ai, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100