Repository navigation
Description
A stopped session resumes with Claude's whole conversation only on the runner that keeps its sandbox. On any other runner it starts over:
- a new sandbox;
- a fresh clone of its branch;
- a new Claude conversation that knows only the session's original task.
Uncommitted work is gone too. On a fixed fleet of always-on machines that happens now and then. On an elastic fleet, where machines are retired when idle and replaced by new ones, it becomes the normal case. People see an agent that has forgotten what they discussed an hour ago, and it pushes organizations toward keeping machines up that they'd rather scale away. This is the piece that makes scale-to-zero and one-machine-per-session pools (#615) lose nothing.
How it works now
- Where the conversation lives. Claude Code keeps it in the sandbox, at
~/.claude/projects/<working directory>/<session id>.jsonl, with subagents' files beside it.- fctl-agent resumes it with
claude --resumewhen it finds it:conversation_existsincrates/fctl-agent/src/claude.rs. - Otherwise it sends
prompt::fresh_resume("your earlier conversation is gone", then the task;crates/fctl-agent/src/prompt.rs). The agent numbers its events after those the control plane has (first_agent_seq).
- fctl-agent resumes it with
- Where a resume goes. FleetDO remembers each session's home runner (
sandboxes, in its storage;fctl_domain::schedule::Home).- A resume waits for that runner up to ten minutes while it is busy, and goes elsewhere when it's offline, removed, or no longer gives the sandbox the session asks for (docs/architecture.md#idle-sessions).
- How long a stopped sandbox lasts. A host removes stopped sandboxes after
keep_stopped_hours(72 by default), or sooner when its disk runs low (crates/fctl-host/src/expiry.rs, ADR 0019). - What reaches GitHub. Hosts push after each turn when
push_on_commitis on, and agents push their work before a drain or a shutdown stops them (StopReason::Shutdown). Uncommitted files never leave the sandbox. - Autopilots already avoid resuming their own session this way, and hand off to a fresh session (An autopilot whose runner is gone resumes without a proper handoff #592,
Fresh::Away). Ordinary sessions have nothing like it.
What should happen
-
Saving. As a session's sandbox stops (idle timeout, drain, uninstall, shutdown, stop), fctl-agent saves a snapshot:
- the conversation file and its subagents' files;
- Claude Code's todo list;
- the working tree's uncommitted changes, as a commit on a hidden ref (
refs/fctl/wip/<session>, never pushed to a branch people see) or a git bundle, with the paths of untracked files.
It's compressed (zstd) and encrypted with a key of the session's that the control plane keeps sealed with the master key, so whoever stores it reads nothing. It is saved again at each stop, replacing the one before.
-
Storing.
- By default in the control plane: the project's
FilesObject, chunked as attachments are (ADR 0008: Durable Object storage, up to 10 GB a project), or/dataon the standalone server. - Or in the organization's own S3-compatible bucket, set on the host (
[snapshots] url = "s3://acme-fctl/sessions", with the machine's IAM role or workload identity). The control plane then keeps only where it is, its size and its checksum, and the session's code never leaves the organization's cloud.
- By default in the control plane: the project's
-
Restoring. When FleetDO starts a resume on a runner other than the home one, the
SessionSpecnames the snapshot.- fctl-agent fetches it (through the host's uplink, or from the bucket), checks it, restores the files and the work-in-progress commit, and starts
claude --resume. - The transcript says "Resumed on aws-7 with its conversation" (a notice).
- A snapshot that can't be used (missing, too large, from a Claude Code version that can't read it, failing its checksum) falls back to today's fresh start, and the transcript says why.
- fctl-agent fetches it (through the host's uplink, or from the bucket), checks it, restores the files and the work-in-progress commit, and starts
-
Placement. With a usable snapshot, FleetDO stops waiting up to ten minutes for a busy home runner, and starts the resume on any runner that can take it. The home runner stays the first choice while it has room.
-
Limits and retention.
- A size limit per snapshot, 200 MB say: conversations with many images and long tool outputs grow large.
- Snapshots are deleted with their session, their project or their workspace, and after the session has been stopped for as long as the workspace keeps transcripts (Organizations export audit logs to their own systems and choose how long transcripts are kept #623), or a set time such as 30 days.
-
Docs:
- docs/architecture.md (Idle sessions, A runner that goes away, Sandboxes and drivers);
- docs/security.md (what's stored where, and how it's encrypted);
- docs/self-hosting.md (the bucket setting);
- fctl-site's privacy policy, since app.fctl.sh would store conversations it doesn't store today.
Notes on the design
- The conversation format is Claude Code's, not fctl's, and can change between versions. The snapshot records the Claude Code version that wrote it, and the restore only uses it with the same or a compatible version. The sandbox image pins Claude Code, which helps.
- Restore the work in progress as a commit, then reset it to uncommitted. Git then handles binary files, permissions and deletions, rather than a tarball of the tree.
- The Kubernetes driver (A Kubernetes driver: one isolated sandbox per session in a company's cluster #617) keeps stopped sandboxes on volumes that survive their pod. Within one cluster it needs no snapshot, but snapshots still carry sessions between clusters and pools.
Design and UX
People shouldn't have to know runners exist for this to work: an agent picks up exactly where it left off, wherever it runs, and says so in one quiet line.
- In the transcript. A notice styled like the runner notices that exist: "Resumed on aws-7 with its conversation and uncommitted work (12 MB)". When it couldn't, the notice says why and what the agent got instead: "Resumed on aws-7 without its conversation: it was saved by an older Claude Code. The agent has the task and the branch."
- On the session page. The details rail shows where the session's last snapshot is and when it was saved, for those who look.
- In settings.
- Workspace admins see "Saved conversations: on, in Acme's bucket s3://acme-fctl/sessions" on the Runners tab, with the size used.
- A host that can't write to its bucket shows in amber there, with the error.
- For admins choosing where snapshots go, explain what is stored, where, and that it's encrypted, with a small diagram (sandbox → bucket or fctl), in the "pages that explain" style.
- Follow hyperstructure/design's docs:
docs/principles.md;docs/web-app/explaining.mdfor pages that set something up (a headline that names the outcome, a lead built from this place's facts, a preview of the result, one primary action, and who can act);docs/web-app/kit.mdfor controls. - Design every state before building it: the first visit, loading, errors and refusals, waiting, partial setups and long lists.
- Say what happens, plainly, and never leave someone at a disabled control without saying who can act.
- Prototype the main screens with realistic data (
cargo xtask demo's world) and review them before building the rest. - Check both themes, a phone's width, the keyboard, screen readers and reduced motion, and show screenshots in each pull request.
- Give the CLI the same care: readable output,
--json, and errors that say what to do next. - Add or update the pages of hyperstructure/design's docs for each new component, with the reasons behind its choices.
Compatibility
- Releases. Saving and restoring need a new fctl-agent and host. FleetDO offers a snapshot only to runners whose hello says they can restore one (a new optional feature flag), and otherwise resumes as today.
- Protocol.
SessionSpecgains an optional snapshot reference. Agents that don't know it ignore it and start fresh, as now. - Data.
- A D1 migration for where each session's snapshot is.
- Its encryption key is sealed with the master key, as other credentials are.
- Privacy. app.fctl.sh would newly store conversations: docs/security.md#retention and fctl-site's
legal/privacy.mdchange with it.
Decisions for a person
- Default storage: the control plane (simplest), or nothing until a bucket is set (nothing new stored on app.fctl.sh).
- Size limit: what it is, and whether to drop images from big conversations rather than give up.
- Retention: whether snapshots follow transcript retention, or have their own.
- Fresh resumes: whether a resume that finds no usable snapshot should hand off as autopilots do (An autopilot whose runner is gone resumes without a proper handoff #592), with a summary of the transcript, rather than start from the task alone.
Refs #592
Session: https://app.fctl.sh/s/ses_01M8450BECFP8DN88R0ZP0N0MS
Activity
fctl-sh commentedon Nov 23, 2026
Where this stands (from fctl session #1545): #636 does saving, storing in the control plane, restoring, placement, limits and retention, with the docs, and hyperstructure/fctl-site#138 the privacy policy.
refs/fctl/wip/<session>when the branch moved on), and says so in the transcript, or why it couldn't (older than the last run, a newer or other major Claude Code wrote it, damaged).Still to do: snapshots in an organization's own S3 bucket (
[snapshots] url = "s3://…"on hosts), and the web app's part: the session's snapshot in its details rail, the settings in the workspace's and the admin's settings, and the page that explains where snapshots go.fctl-sh commentedon Nov 23, 2026
#636 merged (fbf9309): sessions save an encrypted snapshot of their conversation and unpushed work as their sandbox stops, the control plane keeps it in the session's SessionDO, and a resume in a sandbox without the conversation restores it; FleetDO no longer makes such a resume wait for a busy or gone home runner. Workspaces keep snapshots for 30 days by default (1 to 365, or off), the instance up to 200 MiB each (or off).
The control plane's part is deployed to app.fctl.sh. The agent's, the host's and the CLI's parts ship with the next release (no tag contains fbf9309 yet), and sessions save snapshots only once their hosts run it: hosts announce that they do, and older ones get no snapshot in their specs.
I ticked Saving, Restoring, Placement and Limits and retention. The privacy policy (hyperstructure/fctl-site#138) is merged and live on fctl.sh. Storing stays open for snapshots in an organization's own S3 bucket, and Docs for that bucket's setting in docs/self-hosting.md.
Left: that bucket option, and the web app's part (the snapshot in the session's details, the settings in the workspace's and the admin's settings, and the page that explains where snapshots go).
fctl-sh commentedon Nov 24, 2026
Where this stands (fctl session #1545). What's left is in these open pull requests, all green:
host.toml([snapshots] url = "s3://…"), or withfctl host install --snapshot-bucket. They use S3's API, signed with SigV4 and the machine's own credentials; R2, MinIO and Google Cloud Storage work throughendpoint. The control plane keeps only where each snapshot is, its size and its checksum. Its docs cover self-hosting, security and architecture, and ADR 0097 records the decisions; docs(legal): say what app.fctl.sh keeps of snapshots in your own bucket fctl-site#140 updates the privacy policy. A runner's bucket, and the last error it met there in amber, show on the Runners tab and infctl runners.GET /api/v1/workspaces/{id}/snapshots,fctl workspaces snapshots). docs(web-app): sessions' snapshots, their settings and the rail's row design#79 has its design docs.Once those merge, Storing and Docs are done.
fctl-sh commentedon Nov 24, 2026
hyperstructure/fctl-site#140 merged (0f166da): fctl.sh/privacy now says what app.fctl.sh keeps of snapshots in an organization's own bucket. That is where each snapshot is, its size and checksum, the bucket's address, and the last error a runner met there.
The bucket itself is still in #641, and the web app's part in #643, stacked on it. #641 is approved and green. While it waited, #637, #640, #642 and #638 took the ADR and migration numbers it had taken, so after four merges of main it now has ADR 0101 and migration 0076.
The review agent's findings since then are fixed in #641:
s3:ListBucket, so that a deleted snapshot reads as missing rather than refused;Storing and Docs are done once #641 merges.
feat(host): keep sessions' snapshots in an organization's own bucket (#…
feat(web): show where snapshots go, their settings and a session's (#643
fctl-sh commentedon Nov 24, 2026
#641 (8fa95e6) and #643 (dce77c7) merged, and hyperstructure/design#79 with their design docs. That finishes this:
host.tomlnames a bucket ([snapshots] url = "s3://…", orfctl host install --snapshot-bucket) keeps them in the organization's own S3-compatible bucket, and the control plane keeps only where each is, its size and its checksum (feat(host): keep sessions' snapshots in an organization's own bucket #641).I ticked Storing and Docs. The control plane's and the web app's parts are deployed to app.fctl.sh. The agent's, the host's and the CLI's ship with the release after v0.37.1, since no tag contains these commits yet. Nothing ran against a real S3, R2 or Google Cloud Storage bucket.