Skip to main content
You can keep work inside a Celesto computer and come back to it later. Stop the computer when you are done for now, save its ID or name, then start the same computer again to continue from the same files and tools. This saved work is called state.

When to keep state

Keep state when you want to:
  • Continue an agent task after a break.
  • Reuse installed packages instead of installing them again.
  • Keep generated files, source code, or build output.
  • Restart a preview app from the same workspace.
  • Hand the same computer to another job or agent.
Delete a computer when you no longer need its saved work. Deleting a computer removes its files, installed packages, and resources.

Stop and start the same computer

The simplest way to keep state is to stop a computer instead of deleting it. A stopped computer keeps its workspace, which means the files and folders inside the computer. The example below creates a file, stops the computer, starts it again, and checks that the file is still there.
from celesto import Celesto


client = Celesto()
computer = client.computers.create(template_id="coding-agent")
computer_id = computer["id"]

client.computers.exec(computer_id, "echo ready > status.txt")
client.computers.stop(computer_id)

client.computers.start(computer_id)
result = client.computers.exec(computer_id, "cat status.txt")
print(result["stdout"].strip())

client.computers.delete(computer_id)
The command prints ready after the computer starts again, which means the workspace was saved.

Save the computer ID or name

Use the same computer when you want the same state.
  • In SDK code, save the computer ID returned by create().
  • In the CLI, use the computer name shown by celesto computer create.
Store the computer ID or name in the job record, database row, or task metadata that needs to resume the work later.

Choose stop or delete

Stopping and deleting both end a work session, but they have different outcomes.
ActionWhat happensUse it when
StopThe computer turns off and keeps its workspace.You plan to continue the same work later.
StartThe stopped computer turns on again.You are ready to continue the saved work.
DeleteThe computer and its workspace are removed.You are finished with the saved work.

Resume agent sessions

If you use Celesto with OpenAI SandboxAgent, you can also save an agent session and resume it later. A session is the saved connection between the agent and its sandbox computer. Use this when the same agent workflow needs to continue with the same files and identity. See Sandbox an OpenAI agent using Celesto or SmolVM for the session-specific code.

Troubleshooting

If a saved file is missing, check these first:
  • Use the same computer ID or name that created the file.
  • Start the computer before running commands against it.
  • Confirm that the computer was stopped, not deleted.
CLI
celesto computer list
celesto computer run einstein "ls"
Last modified on June 7, 2026