The Deska blog
Can You Leave Claude Code Running While Away From Your Computer? (Yes, Here's How)
Learn how to leave Claude Code running while away from your computer by managing permission prompts and using remote access tools like Deska mobile.
· 10 min read
If you are working on a large refactor or a complex feature, you might wonder if you can leave Claude Code running while away from your computer. The short answer is yes, but it is not as simple as clicking a button and walking away. Because Claude Code is a terminal based tool designed for agentic workflows, it frequently pauses to ask for permission before executing shell commands, writing files, or making web requests. Without a strategy to handle these prompts, you will likely return to a stalled terminal that has made zero progress.
The Challenge of Unattended Agentic Workflows
Claude Code operates by thinking through a problem and then proposing actions. These actions are often destructive or sensitive, such as deleting a directory or running a script. By default, the tool is designed to be human in the loop. This means it expects a person to be present to hit the Enter key or type a confirmation.
When you leave the room, several things can cause the process to stop. Security prompts are the most common blocker. If the agent needs to run a test suite and then fix the errors, it might ask for permission to run the test command. If you are not there to grant it, the agent sits idle. Additionally, your computer power settings might put the machine to sleep, which severs the connection between the CLI tool and the Anthropic API.
Strategies for Running Claude Code Remotely
To successfully run Claude Code while away from your desk, you need to solve two problems. First, you must ensure the process continues to execute. Second, you must have a way to intervene if the agent gets stuck or requires a critical decision.
Managing Permission Prompts
One way to keep the agent moving is to use flags that bypass certain prompts. Many CLI agents have an auto-approve mode. While this is efficient, it is also risky. An autonomous agent could accidentally delete important files or get stuck in a loop that consumes your API credits rapidly. If you choose this route, ensure your git state is clean so you can revert any unintended changes.
Remote Terminal Access
A traditional approach is using a terminal multiplexer like tmux or Screen. This allows you to start a session on a remote server or your local machine and keep it running even if your connection drops. You can then SSH into the machine from another device to check progress. However, this does not solve the problem of the user interface. Reading long terminal logs on a small smartphone screen via SSH is difficult and prone to errors.
Using Deska to Monitor Claude Code on Mobile
Deska offers a modern solution for developers who need to stay mobile while their AI agents work. As a free desktop app for Mac, Windows, and Linux, Deska allows you to run coding agents like Claude Code inside dedicated panels.
The mobile app provides a secure relay to your desktop workspace. Because the devices pair directly and do not expose ports to the public internet, it maintains a local-first security model. When you are away from your computer, you can open Deska on your phone to see exactly what is happening on your canvas.
If Claude Code reaches a point where it needs a permission prompt, you will see it on your mobile device. You can approve the command, type a response, or even use Ask Deska to give the agent new instructions. This transforms an unattended process into a supervised one, significantly reducing the risk of wasted time or API costs.
Technical Considerations for Long Running Sessions
When you plan to leave a tool like Claude Code running for more than a few minutes, you should prepare your environment. AI agents thrive on context, but they can also get overwhelmed by too much noise.
- Clear the Context: Before starting a long task, restart your agent session to clear out old logs. This ensures the agent focuses only on the current task.
- Define the Scope: Be specific in your prompt. Instead of saying "refactor the app," say "refactor the helper functions in the /utils directory and run the unit tests."
- Check Power Settings: Ensure your laptop is plugged in and that sleep mode is disabled for the duration of the task.
- Monitor via Secure Relay: Use the Deska mobile app to check the terminal every twenty minutes. You do not need to be actively watching, but a quick glance can confirm if the agent is still making progress.
Comparing Approaches to Remote AI Management
Different developers have different needs for remote work. Some prefer a purely CLI based approach, while others need a full visual environment.
| Feature | SSH + Tmux | Cloud IDE | Deska + Mobile |
|---|---|---|---|
| Setup Complexity | High | Medium | Low |
| Security | Depends on Config | Third Party Cloud | Local-first Relay |
| UI Experience | Text Only | Full Browser | Native Canvas |
| Permission Prompts | Hard to Manage | Browser Dependent | Mobile Interface |
While SSH is a standard tool, it lacks the visual context of an integrated workspace. Cloud IDEs are powerful but often require moving your code to their servers. Deska allows you to keep your files local while providing the flexibility of remote monitoring through its remote access capabilities.
FAQ
Can Claude Code run in the background?
Yes, Claude Code can run in the background if you use a tool that keeps the terminal session active. However, it will eventually stop if it encounters a prompt requiring user input. Using a workspace manager that syncs to a mobile device is the most effective way to handle these interruptions.
Is it safe to leave AI agents unattended?
It is generally not recommended to leave any AI agent completely unattended for long periods. They can enter infinite loops or make incorrect assumptions about your codebase. A better strategy is to use a monitor that lets you check in periodically without being tied to your desk.
Does leaving Claude Code running use more API credits?
Running the tool itself does not use credits, but the actions it takes do. If an agent gets stuck in a loop trying to solve a bug while you are away, it could potentially use a large number of tokens. Monitoring the session remotely helps you catch these loops early and save on costs.
Getting Started with Deska
If you want to start using Claude Code and other agents more effectively, you can download the Deska desktop app today. By combining a flexible infinite canvas with a secure mobile link, you can manage complex AI workflows from anywhere. Whether you are at your desk or on the move, you stay in control of your code.