This guide explains how to restore long-running Claude Code Projects work after a disconnect, restart, or failed task. It separates session state, project files, shared memory, parallel agents, build artifacts, and recovery reserve so you can choose between local execution and a persistent cloud development workspace.
The official Projects documentation identifies project files, instructions, and memory as separate project inputs, while Claude’s cloud task workflow can run work away from your local machine (official Projects management guide). That distinction leads to the decision that matters:
Suitable for persistent cloud recovery: long tasks, multi-agent parallel work, large builds, and workflows that must survive sleep, disconnection, or a local restart.
Usually not worth expanding: short, single-agent edits that finish in one sitting and do not produce large artifacts.
Claude Code Projects cloud session recovery should not be planned from the number of sessions alone. Track active tool calls, suspended work, project files, memory, build output, and a separate recovery reserve. If the local Mac often sleeps or loses network access, use a persistent cloud development workspace. If the task is short and isolated, local execution may remain simpler.
This guide is for:
- Developers running long Claude Code Projects tasks on a machine that sleeps or disconnects.
- Small teams assigning multiple agents to one repository.
- Administrators responsible for cloud Mac capacity, permissions, retention, and recovery.
Capacity starts with task shape, not session count
A session is only a container for work. It does not tell us how much hardware or storage the work consumes.
A short interactive request may open a session, call a tool, edit a few files, and finish quickly. A long build task may keep processes, logs, caches, test output, and generated files alive for much longer. Two sessions can therefore have very different resource profiles.
We classify work into five planning categories:
- Short interaction: quick edits, inspection, or a small test.
- Long execution: migration, indexing, test suites, or code generation that runs unattended.
- Multi-agent parallel work: several agents inspect, edit, test, or review at the same time.
- Build and test work: compilers, simulators, containers, package managers, and test runners compete for CPU, memory, and disk I/O.
- Cross-day recovery: work must resume after a disconnect, restart, timeout, or human handoff.
The main mistake is treating the fifth category as an afterthought. A workspace that can run a task but cannot preserve its state is not a recovery-ready workspace.
For each category, record:
- Peak active sessions, not the daily average.
- Peak simultaneous tool calls.
- Whether agents share one checkout, use separate worktrees, or duplicate the repository.
- Dependency and cache growth.
- Build and test output.
- Required artifact retention.
- The cost of repeating an external action.
- The time needed for a person to verify and resume the task.
This produces a capacity model based on workload shape rather than a misleading session total.
Session states need separate accounting
We use four session states when planning Claude Code Projects cloud session recovery.
Active sessions are currently executing or waiting for a tool result. They consume the most operational attention because a tool call may still change files, start a process, or contact an external service.
Suspended sessions are not currently progressing, but their workspace, logs, process state, or pending work may still need preservation. A suspended session can consume storage even when it consumes little CPU.
Waiting sessions have reached a dependency such as a build, test, network request, review, or human approval. These sessions should not be counted as idle if they hold a process, lock, temporary file, or queued result.
Completed sessions with retained records no longer need execution resources, but their logs, diffs, screenshots, generated files, and decisions may be needed for audit or later recovery.
The capacity table should use the highest simultaneous count in each state. Daily task volume hides bursts. A team may complete many small tasks during a day but still need capacity for a short period when several builds and agent calls overlap.
We also reserve space for failure recovery. Without that reserve, a failed build can fill the workspace with logs or artifacts just when the team needs room for a retry. The reserve is not a luxury. It covers the difference between “the main task fits” and “the main task can be diagnosed and resumed.”
A useful session record contains:
- Session identifier and project name.
- Current Git branch or worktree.
- Last completed operation.
- Active processes and expected outputs.
- Files changed but not committed.
- External actions already performed.
- Last known credentials or service status, without exposing secrets.
- Recovery point and next safe operation.
This record prevents a common failure: restarting the whole workflow because nobody knows which steps already succeeded.
Workspace storage has more layers than the repository
Project files are only one part of physical capacity. We separate the workspace into distinct storage classes:
| Storage class | What it includes | Recovery question |
|---|---|---|
| Source checkout | Repository files, branches, worktrees, generated source | Which version is authoritative? |
| Dependencies and caches | Package downloads, compiler caches, SDK data, container layers | Can agents share them safely? |
| Temporary files | Scratch files, intermediate output, tool state | Can stale data be deleted before retry? |
| Test and build output | Binaries, coverage, logs, reports, simulator data | Which artifacts must remain? |
| Screenshots and generated files | Images, exports, model output, recorded evidence | Is the output reproducible? |
| Session records | Logs, task ledgers, diffs, decisions | What must survive a restart? |
A shared read-only dependency cache can reduce repeated downloads, but it does not make every workload cheaper or safer. A build tool may create locks, indexes, or writable metadata. Two agents may also request incompatible dependency versions. We therefore test whether a cache is genuinely shareable instead of assuming that “shared” means “free.”
The same rule applies to source code. Git worktrees can provide separate working directories linked to one repository, but they still occupy disk space and can create independent build output. The Git worktree documentation explains the relationship between linked working trees and a repository. A separate worktree is logical isolation, not zero physical cost.
Git stash is useful for preserving uncommitted changes, but it is not a complete workspace backup. It does not preserve every external process, generated artifact, credential, service, or remote side effect. Use the official Git stash reference as part of a recovery procedure, not as the only recovery layer.
Containers add another storage boundary. Persistent Docker volumes can keep data beyond the lifetime of a container, as described in the Docker volumes documentation. That persistence must be included in the workspace inventory. Otherwise, deleting a container may appear to free capacity while volumes, layers, and caches remain.
Parallel agents must map to real resource pressure
Multi-agent parallel work is valuable only when the tasks can progress independently. More agents do not automatically produce more throughput.
We divide parallelism into three modes:
- Serial mode: one agent edits or runs a task at a time.
- Limited parallel mode: several agents work on separate, low-conflict tasks while builds are scheduled carefully.
- Peak parallel mode: agents, builds, tests, indexing, and external tool calls overlap.
For each mode, record peak CPU use, memory pressure, disk I/O, network activity, and build queue length. The objective is not to fill every available resource. The objective is to keep the workflow recoverable and predictable.
A practical mapping looks like this:
| Parallel mode | Typical coordination pattern | Main bottleneck | Planning response |
|---|---|---|---|
| Serial | One coding or review task at a time | Human approval or tool latency | Keep the workspace lean; prioritize persistence |
| Limited parallel | Separate tasks with shared repository context | Memory, dependency locks, or test queue | Use explicit ownership and scheduled builds |
| Peak parallel | Several agents edit, test, and generate output | CPU, memory, disk I/O, and artifact growth | Add recovery reserve and limit simultaneous heavy jobs |
Do not count an agent as a full hardware unit without measuring what it does. An agent waiting for a tool result may use little CPU but still hold a session, process, file lock, or network connection. A build agent may consume substantial memory and disk I/O even if its conversation is quiet.
Task dependency should control parallelism. Independent documentation edits can run together. Multiple agents rewriting the same configuration file should not. A shared repository with frequent overlapping edits creates merge work, abandoned output, and recovery ambiguity. In some cases, fewer agents finish sooner because the team avoids repeated conflict resolution.
Recovery requires checkpoints across five states
Claude Code Projects cloud session recovery fails when teams preserve only the chat history. We check five separate states before calling a workspace recoverable.
Project state: Are the project files, instructions, and shared memory still available? The official Project creation and management guide explains how project content is organized. Treat that project layer as context, not as a substitute for repository backups.
Session state: Is the thread still available? Was the tool call completed, interrupted, or left ambiguous? A tool call with an unknown outcome must be verified before retrying.
Git state: Which branch, commit, stash, or worktree contains the latest safe change? Confirm with repository commands. Do not infer state from the conversation alone.
External service state: Did a deployment, ticket update, database migration, package publication, or remote API call already happen? A retry can duplicate an external side effect even when the local code is unchanged.
Workspace process state: Are builds, test runners, containers, or background jobs still alive? A restart may terminate them, while a reconnect may reveal that they are still running.
Use the following recovery sequence:
- Confirm workspace identity. Verify the project, repository, branch, and expected environment before opening a new task.
- Check lifecycle status. Determine whether the workspace is running, paused, stopped, or recreated. Cloud development environments can have lifecycle and timeout behavior; the Codespaces lifecycle documentation provides a useful model for why workspace state must be checked separately from session state.
- Inspect processes and locks. Find active builds, test runners, containers, and package operations before launching replacements.
- Inspect Git state. Compare the last commit, working tree, stash entries, and worktree list. Save unknown changes before cleanup.
- Read the task ledger. Mark each operation as completed, failed, pending, or unknown.
- Verify external effects. Check the remote service, deployment target, ticket, or database before repeating an operation.
- Resume from the smallest safe checkpoint. Retry only the failed or unverified step.
- Save a new checkpoint. Commit, stash, upload an artifact, or update the ledger before starting another high-risk step.
A workspace timeout is also part of capacity planning. Review the cloud workspace timeout settings and align them with the longest unattended task. If the timeout is shorter than the task, add an explicit checkpoint before the expected interruption or move the workload to a persistent environment.
Build artifacts and logs need an explicit retention policy
Build output often determines whether a recovery succeeds. Logs show where the task stopped. Test reports show what already passed. Screenshots or generated files may be the only evidence that a UI task completed.
We use three retention classes:
| Retention class | Keep for | Examples | Capacity action |
|---|---|---|---|
| Immediate recovery | Until the task is accepted | Current logs, diffs, failed test output, active artifacts | Protect from cleanup |
| Short review window | Until human review or handoff | Test reports, screenshots, packaged previews | Remove after acceptance |
| Long-term record | Only when audit or release needs it | Release artifacts, decision logs, final reports | Store outside the active workspace when possible |
GitHub’s artifact retention guidance shows why artifacts should be treated as a separate lifecycle from the working directory. The corresponding artifact removal guidance reinforces the need for cleanup rather than unlimited accumulation.
Do not delete logs immediately after a failed task. First capture the failure signature, command, environment, and last successful checkpoint. Then remove redundant output. Capacity planning should include both the temporary space needed during a build and the retained space needed for diagnosis.
A variable-based capacity model avoids invented hardware numbers
We do not assign a fixed memory, disk, or agent count without measuring the actual workload and workspace configuration. Instead, use variables:
S: peak active sessions.W: peak waiting or suspended sessions that retain state.A: average active tool processes per session during the busiest period.R: repository and worktree footprint.D: dependencies, caches, containers, and volumes.B: peak build and test output.L: logs, screenshots, generated files, and session records.K: recovery reserve.T: required artifact retention period.P: peak parallel build processes.
A first storage estimate is:
Required storage = R + D + B + L + K
The recovery reserve should be measured from the largest failed-task cleanup and retry event, not guessed from the daily average. If the team cannot measure it yet, start with a separate reserve line item and do not allocate the entire workspace to normal files.
A first concurrency estimate is:
Peak workload = S × A + P
This is not a hardware specification. It is a measurement target. Collect CPU, memory, disk I/O, and network observations during serial, limited-parallel, and peak-parallel runs. Then compare the results with the available workspace.
A first recovery estimate is:
Recovery capacity = active workload + retry workload + retained evidence
This explains why a task can run successfully in normal conditions but fail during recovery. A retry may need the original logs, a second build directory, a fresh dependency operation, and space for a new artifact.
The three planning choices have different trade-offs
The best option depends on task duration, parallelism, persistence, and hardware requirements.
| Option | Best fit | Strength | Limitation | Recovery score |
|---|---|---|---|---|
| Local Mac | Short, interactive, low-parallel tasks | Direct access and simple feedback | Sleep, shutdown, network loss, and local storage interrupt work | Medium |
| Persistent cloud workspace | Long tasks, parallel agents, remote handoff | Can remain available while the local device is offline | Requires lifecycle, storage, access, and cleanup planning | High |
| Temporary remote environment | Short experiments and disposable builds | Fast isolation and low local impact | State may disappear unless explicitly persisted | Low to medium |
Our scoring uses a five-point scale for decision support, not a benchmark. A high recovery score means the workflow has a better chance of resuming without repeating completed work. It does not guarantee that the provider preserves every process or file.
A persistent workspace is usually the better choice when the task spans a long unattended period, multiple agents share a repository, or a failed build would be expensive to repeat. A local Mac remains sensible when the work is short, requires direct physical interfaces, or depends on local peripherals. A temporary environment is appropriate only when the workflow is deliberately disposable and all valuable output is saved elsewhere.
For teams considering a remote Mac, review the available Mac support options before choosing a recovery design. The relevant questions are not only CPU or memory. Ask how the workspace is delivered, how access is controlled, how long it remains available, and where project state is stored.
A five-step operating procedure for every long task
We use this procedure before assigning long Claude Code Projects work:
- Define the recovery target. State what must survive: code, session records, logs, artifacts, memory, credentials, or external status.
- Measure a representative run. Record peak CPU, memory, disk I/O, network activity, storage growth, and build queue behavior.
- Choose the isolation model. Decide between one checkout, separate Git worktrees, or separate workspaces. Document shared caches and writable directories.
- Create checkpoints before risky steps. Commit or stash code, save logs, record external actions, and preserve the latest accepted artifact.
- Run a forced recovery test. Disconnect the local client, stop or restart the workspace according to policy, reconnect, inspect every state, and resume without repeating completed operations.
The last step is the one most teams skip. A written recovery plan is only an assumption until it survives a controlled interruption.
When capacity changes, repeat the measurement after adding a new agent type, dependency set, build target, or artifact retention rule. A small change in generated output can alter storage growth more than the conversation count suggests.
FAQ
The following answers cover the common recovery decisions that do not fit into a single capacity formula.
Is a persistent cloud workspace always the right answer?
No. A persistent environment is a strong fit for long-running tasks, multi-agent parallel work, and recovery after local sleep or network loss. It is less attractive for short edits, hardware-bound workflows, or stable heavy workloads that run continuously and justify owned equipment. Compare persistence, storage, access, lifecycle behavior, and total operating cost before moving the entire workflow.
Does adding more Claude Code sessions require proportional capacity?
No. Session count is only one variable. A waiting session may use little CPU but retain logs and workspace state. A build-heavy session may consume substantial memory and disk I/O. Measure peak active tools, repository isolation, dependency caches, build processes, network traffic, and retained artifacts. Increase capacity when those measurements show pressure, not merely because the session list is longer.
Can shared memory replace Git commits or workspace backups?
No. Shared memory helps agents retain project context and operating instructions, but it does not represent every uncommitted file, process, generated artifact, credential, or external side effect. Use Git commits or stashes for code checkpoints, artifact storage for evidence, and a task ledger for external operations. Keep these layers separate during recovery.
Should every agent use a separate worktree?
Not always. Separate worktrees reduce direct file collisions when tasks are independent, but they add physical storage and can duplicate build output. A shared checkout can be more efficient for read-heavy inspection, but it requires strict ownership and coordination. Choose based on file overlap, dependency conflicts, build behavior, and the cost of merging changes.
Current setup versus a Mac cloud workspace
A local Mac is convenient, but it has three recurring weaknesses for this workload: sleep or shutdown can interrupt long tasks, a single device creates a local availability bottleneck, and concurrent agents compete with normal desktop work for memory, storage, and I/O. A persistent cloud workspace does not remove the need for checkpoints, but it gives long-running Claude Code Projects work a more suitable place to remain available and recoverable.
If you need a remote Mac environment for temporary agent runs, build testing, or a handoff between developers, review Mac VPS options from ZekVPS and compare them against the variables in this guide. For a short-lived project, renting can be more practical than changing the whole local setup; for permanent, predictable heavy workloads or workflows requiring physical hardware access, buying and operating a dedicated Mac may still be the better choice.
Before choosing a rental, fill in the peak session count, task duration, repository footprint, artifact retention period, and recovery reserve. Then use the ZekVPS Mac rental page only if the measured workload benefits from a persistent remote workspace. That keeps the decision tied to recovery requirements rather than an assumed agent count.
Restore Your Claude Code Workspace on a Dedicated Mac
Rent a dedicated Apple M4 Mac from ZekVPS and keep your project files, tools, and build artifacts in one remote workspace.
Reconnect through SSH or VNC after a disconnect or restart without rebuilding your macOS development environment from scratch.
If you are moving MCP or Agents from demo to daily use, a snapshot-ready cloud Mac node beats swapping frameworks again. View ZekVPS cloud Mac mini plans — Separate lab from daily driver for calmer deployments.