# Four habits for stopping and cleaning up a team's coding-agent machines

> A running machine counts toward plan hours whether the agent is busy or waiting. Four habits that keep a team's Claude Code, Codex and Cursor machines from running on after the work is done.

A running machine counts toward plan hours whether the agent is busy or waiting. Four habits that keep a team's Claude Code, Codex and Cursor machines from running on after the work is done.

December 3, 2026 · 3 min read · The Sandscale team

Once every coding agent has its own machine, the next problem is a machine that is still running after the work is done. This is not subtle, and it is not a trick of the pricing page. A running Sandscale workspace counts toward the plan’s hours whether the agent is busy or waiting. Stopping machines is how you keep the hours on the work.

The four habits below are the ones we keep coming back to with teams. They use the CLI forms the product already documents. They are not a substitute for [plan quotas and spend caps](https://sandscale.dev/blog/limits-and-policy-controls-for-a-teams-coding-agents), which are the backstop when a loop does not stop itself. They are the everyday practice that means you need the backstop less often.

This is also not the same topic as pausing or snapshotting a short-lived sandbox between chat turns. That lifecycle is covered in [pause, snapshot or stop](https://sandscale.dev/blog/pause-resume-or-stop-agent-sandboxes). Here the machine is a workspace: a persistent cloud computer for a Claude Code, Codex or Cursor agent, with a disk that can outlive a stop.

## 1. Set a time to live when you create the machine

`--ttl-seconds` is a ceiling on how long the workspace may run from the moment it starts, even if nobody stops it. Keep it inside your organization’s policy. Eight hours is 28800 seconds, which is a reasonable ceiling for a day’s task and a poor substitute for stopping the machine when the task actually ends.

```sh
sandscale workspace create --name pay-1423-refund --template-id TEMPLATE_ID --ttl-seconds 28800
```

Put the ticket or task in the name. You will want that later, when you look at the list.

## 2. Set an idle timeout

An idle timeout stops a machine that has had no activity for the time you set. It does not make idle time free. Until the timeout fires and the machine stops, a running box still counts, busy or idle. The timeout is how you make sure a forgotten machine does not run on until its time to live.

The minimum is 300 seconds, and the value has to sit inside your organization’s limit. This sets it to 1800 seconds:

```sh
sandscale workspace update --ws-id WORKSPACE_ID --idle-timeout-seconds 1800 --yes
```

Pick a window that fits how the agent works. A machine that waits a long time on a human approval needs a longer timeout than a machine whose agent is expected to be busy or done.

## 3. Stop the machine when the task is done

When the pull request is merged, or the task is otherwise finished, stop the workspace. The person who started it is the person who stops it. Agree that on the team; most leftover machines are leftover because nobody owned the last step.

```sh
sandscale workspace stop --ws-id WORKSPACE_ID
```

A stop keeps the disk. The next task on that workspace starts with the repository, the tools and the caches you already installed. When the work is really finished and you do not want the disk either, delete it. Deletion is destructive and the command asks before it runs:

```sh
sandscale workspace delete --ws-id WORKSPACE_ID
```

## 4. Look at the list once a week

```sh
sandscale workspace list
```

Names that include a ticket number make it obvious which machines belong to work that has already shipped. Stop or delete those. If a machine is still running and nobody can say why, stop it.

A weekly pass is also when you notice a pattern: the same kind of task always outliving its time to live, or idle timeouts that are longer than the team meant. Fix the default on the next create, not only the one leftover machine.

## What these habits do not replace

They do not replace a spend cap, a plan quota, or an audit of what the agent did. Those controls are described in the policy post linked above. They also do not replace a [rollout plan](https://sandscale.dev/blog/rolling-out-coding-agents-to-a-ten-person-team-in-four-weeks) for a team that is still deciding who is allowed to start a machine.

They do replace a vague hope that someone will remember. The create flags, the stop command and the weekly list are small, and they are the difference between hours spent on the work and hours spent on machines nobody is using.

If you are still choosing how the machine comes into existence at all, the comparison of a laptop, a Kubernetes cluster you run, and a machine a product provides is in [laptop or a Kubernetes cluster you run, versus a machine per coding agent](https://sandscale.dev/blog/laptop-or-k8s-diy-vs-a-machine-per-agent). [Sandscale](https://sandscale.dev/workspaces) is the last of those: every coding agent gets its own workspace, and there is no control plane to write.

**On this page**

1. 1. Set a time to live when you create the machine
2. 2. Set an idle timeout
3. 3. Stop the machine when the task is done
4. 4. Look at the list once a week
5. What these habits do not replace

**Run your agents in a box of their own**

Each sandbox is a Firecracker microVM. Free includes 100 awake vCPU-hours a month.

[Start free](https://cloud.sandscale.dev/auth/signup)

## Keep reading

- [December 3, 2026 · **A cloud workspace for one developer vs a machine per coding agent** · Cloud IDEs were built around one person and their editor. A team running Claude Code, Codex or Cursor needs a machine per agent. A short contrast, then a signup path to try the second shape.](https://sandscale.dev/blog/a-cloud-ide-vs-a-machine-per-coding-agent)
- [December 3, 2026 · **CI vs the agent's own machine: where each kind of check belongs** · Keep CI as the merge gate. Put a coding agent's edit-test loop on a machine of its own. A short split, and a signup path to give Claude Code, Codex or Cursor that machine.](https://sandscale.dev/blog/ci-vs-the-agents-own-machine)

---
Source: https://sandscale.dev/blog/four-habits-for-stopping-and-cleaning-up-agent-machines
