AI WORKFLOWS · PRACTICAL GUIDE
Run AI Agents Overnight When Your Laptop Is Closed
An overnight AI task needs its execution environment to stay awake. Closing a browser window and putting the computer running the agent to sleep are different events.
First, find out where the work actually runs
A phone app or remote-control screen can be a window into another machine. If the agent is still running on your laptop, the phone does not move that work into the cloud. Ask one question before leaving a job: which computer is executing the commands?
Claude Code’s Remote Control documentation describes a connection to a session on your own machine. A sleeping host is not a continuously running host. Claude also offers cloud sessions, which can be a good fit when you want work performed in its hosted environment. A separate cloud computer is another option when you want to maintain your own environment and choice of tools.
Choose the setup that matches your job
| Approach | Best reason to choose it | What to check |
|---|---|---|
| Your local computer | The project and tools are already there. | Power, sleep settings, network, and a way to resume the agent. |
| An AI provider’s cloud session | You want its integrated workflow. | Environment support, session lifetime, permissions, and usage allowance. |
| A persistent cloud computer | You want installed tools and working files to remain across sessions. | Process supervision, reconnect behavior, backups, and both compute and AI costs. |
Use a small acceptance test before leaving it overnight
- Create a disposable project and give the agent one bounded task with an observable result.
- Set a model-spending limit and a maximum run time. Decide which commands require approval.
- Disconnect the viewer, then check from another device that the job is still progressing.
- Close your laptop and reconnect later. Check the actual output and test results, not just a “running” badge.
- Try an approval wait and a failed command. Make sure you can resume or stop the task without starting it twice.
This is our suggested test procedure, not a guarantee that every agent or hosting service passes it. Test the specific combination you intend to use.
An always-on computer does not mean unlimited autonomous work
A machine can remain online while its agent is waiting for permission, a login, an API quota reset, or a failed dependency. “Keep working” needs a defined end condition: for example, produce a patch and a test report, then wait for review. A budget cap should apply across retries and model changes.
Where Spare Computer fits today
Spare Computer is developing a Linux cloud workspace for AI tools, task history, and reviewed actions. Public beta requests are open; paid access is closed. SC Assistant responses and selectable models have passed owner-only dev tests. End-to-end unattended coding with OpenCode is still being verified. Do not use that test status as proof that an overnight production job is ready.
For the hosting decision, read our AI agent hosting vs. VPS guide. For the agent itself, see what to check before hosting OpenCode.