devbox exec or from inside a session.
The solution is to tell the Devbox that work is in progress, by creating a task marker. For a process that runs until you stop it, such as a dev server, run it as a service with idle shutdown prevention instead.
Task markers are files stored in the directory given by the
NAMESPACE_DEVBOX_TASKS_DIR environment variable. While at least one marker exists, the Devbox is treated as active and the idle countdown does not start.Keep a Devbox running
The steps below run inside the Devbox, in a shell opened withdevbox ssh or in a session.
Run the work
For example, start the build, test suite, or agent task as you normally would.The Devbox stays running for as long as the marker is in place, whether or not anything is connected to it.
Have an agent mark its own work
An agent working unattended is the case this matters most for: it holds no SSH connection of its own, and a long task can outlast the idle timeout. Ask the agent to create a marker while it works:Agent Prompt
AGENTS.md or CLAUDE.md, applies it to every session without repeating the prompt.
Clean up leftover markers
A marker does not expire, and on a persistent Devbox it survives a restart. If one is never removed, because the work failed before its cleanup ran or the process was killed, the Devbox is treated as active indefinitely and never stops on idle. Stopping it withdevbox stop still works, but the idle timeout no longer does anything for it.
List markers and remove only the one left by your finished task:
- List markers
- Remove marker
See which markers are currently in place:In PowerShell, use
Get-ChildItem $env:NAMESPACE_DEVBOX_TASKS_DIR.An empty directory means no marker is keeping the Devbox running.Mark work from your own machine
You do not have to be inside the Devbox to manage a marker.devbox exec runs a single command in the Devbox and returns. Invoke the shell for the Devbox’s operating system explicitly:
- Add marker
- Remove marker
Create the marker before the work begins:
Linux & macOS
Windows
Related topics
Devbox Lifecycle
Configure the idle timeout and see which signals count as activity.
Agent Skills
Let a coding agent create and drive Devboxes for you.