Answer: Mirror the transcript to durable storage using a SessionStore adapter, since default local disk is lost on restart, scale-down, or a move to a different node. Note that SessionStore mirrors transcripts only, not CLAUDE.md memory files or other working-directory artifacts, so mount a shared volume or sync those separately. Status: Confirmed Entry: tool/claude-code/agents-and-automation/persist-sessions-hosting Revision: 1 Digest: sha256:2fcd24787ec25741 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:02:45Z Last changed: 2026-11-13T03:02:45Z Last verified: 2026-11-20T12:16:40Z Next check: 2026-11-21T12:16:40Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Persistence method | SessionStore | [1] | 2026-11-20 What is lost | Default local disk is lost on restart, scale-down, or a move to a different node. | [1] | 2026-11-20 Scope limitation | Transcripts only | [1] | 2026-11-20 Error message type | mirror_error | [1] | 2026-11-20 Sources: [1] Anthropic. "Hosting the Agent SDK". https://code.claude.com/docs/en/agent-sdk/hosting.md Role: primary. Accessed: 2026-11-20T12:16:40Z Quote: "mirror the transcript to durable storage with a [`SessionStore` adapter]" (Supports: Persistence method) Quote: "Default local disk is lost on restart, scale-down, or a move to a different node." (Supports: What is lost) Quote: "**Transcripts only**: `SessionStore` mirrors transcripts, not `CLAUDE.md` memory files or other working-directory artifacts." (Supports: Scope limitation) Quote: "emits a `{ type: "system", subtype: "mirror_error" }` message" (Supports: Error message type) Published: 2026-11-20T02:56:31Z Snapshot SHA-256: 4a2e1e5cdc750b9c5e12273bcb5bf181e6ce36f5aaa930e61455e52b50b36153 (captured 2026-11-20T12:16:40Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. Cross-check: not-available at 2026-11-20T12:16:40Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:16:40Z Last attempt: 2026-11-20T12:16:40Z Notes and limitations: Extracted automatically from a single official source (section "Session and state persistence"). Related: https://latestn.com/tool/claude-code/agents-and-automation/plugin-configuration-values How do I ask the user for configuration values in a Claude Code plugin? https://latestn.com/tool/claude-code/agents-and-automation/python-recipes-cookbook Where are the Python recipes for the Claude Code Agent SDK? https://latestn.com/tool/claude-code/agents-and-automation/query-function-parameters-returns What does the Claude Code Agent SDK query() function accept and return? https://latestn.com/tool/claude-code/agents-and-automation/optional-tool-parameter How do I make a parameter optional in a Claude Code custom tool? https://latestn.com/tool/claude-code/agents-and-automation/output-format-configuration How do I configure the output format for a Claude Code agent? https://latestn.com/tool/claude-code/agents-and-automation/parallel-agent-approaches What are the different ways Claude Code can run multiple tasks in parallel? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:02:45Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/agents-and-automation/persist-sessions-hosting/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/agents-and-automation/persist-sessions-hosting POST: https://latestn.com/dispute/tool/claude-code/agents-and-automation/persist-sessions-hosting with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/agents-and-automation/persist-sessions-hosting?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I persist sessions and state when hosting the Claude Code Agent SDK in production? Revision 1, last verified 2026-11-20T12:16:40Z. https://latestn.com/tool/claude-code/agents-and-automation/persist-sessions-hosting (accessed 2026-11-21T10:06:05Z). @misc{LatestN_tool_claude_code_agents_and_automation_persist_sessions_hosting_r1, title = {How do I persist sessions and state when hosting the Claude Code Agent SDK in production?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/agents-and-automation/persist-sessions-hosting}}, note = {Revision 1; digest sha256:2fcd24787ec25741; last verified 2026-11-20T12:16:40Z; accessed 2026-11-21T10:06:05Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/agents-and-automation/persist-sessions-hosting