# How to Run Claude Code on a Remote Server From Mac

> Three ways to put Claude Code on a bigger machine and still keep an eye on it from your laptop.

- Canonical URL: https://getedith.pro/guides/run-claude-code-on-remote-machine
- Published: 2026-12-03
- Updated: 2026-12-03

## The short answer

The simplest way is to SSH into the server, start a tmux session and run `claude` inside it, so the agent keeps working after you disconnect. If you use the Claude desktop app, its SSH sessions do the setup for you and give you the app's interface on top. Once you have agents on more than one machine, a fleet view such as Edith's [Machines](https://getedith.pro/extensions/ssh-machines) and [Agents](https://getedith.pro/extensions/coding-agents) extensions shows all of them, and their usage, from your Mac.

## Why run Claude Code somewhere else

- The build or test suite needs more cores, more memory or a GPU than your laptop has.
- The code, data or database only exists on that network, or must not leave it.
- You want the agent to keep working while the laptop sleeps or travels.
- The target is Linux, and you want the agent to test on the real operating system.

## Method 1: SSH and tmux

Free, works anywhere

### A detachable session on the server

Install Claude Code on the server, sign in once, then run it inside tmux so closing your SSH connection does not kill it.

Terminal

Shell

```
ssh dev@build-box
tmux new -s claude
cd ~/code/my-app && claude
tmux attach -t claude
```

Press `Ctrl-b` then `d` to detach and leave it running. Later, SSH in again and `tmux attach -t claude` brings the session back. zellij works the same way if you prefer it.

This costs nothing and works on any Linux box or Mac you can SSH into. The catch is visibility: the agent cannot tell you it is waiting unless you are attached, and each server is one more tmux session to remember.

## Method 2: SSH sessions in the Claude desktop app

The Claude desktop app can run a Code session on a remote machine while you use the app on your Mac. You add an SSH connection with a host, an optional key and a folder for worktrees, and Anthropic's [desktop documentation](https://code.claude.com/docs/en/desktop) says the app installs Claude Code on the remote machine the first time you connect. The server needs SFTP enabled and about 1 GB free in your home folder, and it can run Linux, macOS or Windows.

It is a good choice if you live in the desktop app. The docs list some limits: no browser preview pane for the remote app, merge when ready is off for those sessions, and a session can stop when its sign-in expires. It covers Claude Code only.

## Method 3: keep Claude on your Mac, run the work remotely

Sometimes the agent does not need to live on the server at all, only the commands it runs. Claude Code on your laptop can run builds and tests on a server over SSH if it knows how to reach it. That is what Edith's `edith-remote-work` skill teaches it: find the machine, explore the project there, run builds and tests over SSH and manage containers, while Claude itself stays local. Open [Plugins](https://getedith.pro/extensions/agent-skills) in Edith, press Preview on Edith Remote Work to read exactly what it tells Claude, then press Install and pick Claude Code. The arrow next to Install installs it for a single agent.

## Where the do-it-yourself setup falls short

- **No overview.** Three servers mean three tmux sessions and no single place that says which agent is blocked.
- **Usage disappears.** Tokens spent on the server are not in any report you read on your laptop.
- **The machine itself is invisible.** You only find out the disk is full or the CPU is pinned when the agent's build fails.

## The Edith way: Machines, Agents and Usage together

Machines keeps a list of the computers you reach over SSH, using the OpenSSH client that ships with macOS, so your keys, agent and `~/.ssh/config` work as they do in Terminal. Agents runs coding agents in herdr panes, on this Mac or on any machine in that list with herdr installed, and shows them on one board. [Usage](https://getedith.pro/extensions/claude-code-usage) collects token and cost history from those machines and adds it to your totals.

1. **Install Machines, Agents and Usage**
   Open Library in Edith's sidebar and press Install on Machines, Agents and Usage.
2. **Add the server**
   In Machines, press Add machine and enter its address and username, or pick a host from your SSH config. It shows up with live CPU, memory and disk, and you can open a terminal on it from there.
3. **Start an agent on it**
   On the Agents page, press New agent. Choose the agent, then the machine, then a space. Machines without herdr are dimmed and say Herdr is not installed here, so install herdr on the server first. The agent opens in a pane you can watch and type into from your Mac.
4. **See remote agents next to local ones**
   The board lists both, with the machine named on each card. Edith notifies you when one needs you, finishes or hits an error.
5. **Count the server in your usage**
   In Usage's settings, under Collected over SSH, tick the server and press Collect now. The first run can take a few minutes because it installs what it needs in a cache folder there. After that, the Machines picker on the Usage page shows or hides each machine in the charts.

### From the terminal

The same setup as commands, for scripts:

Terminal

Shell

```
ed machines add build-box --host build.example.com --user dev
ed machines exec build-box -- claude --version
ed agents ls --machine build-box
ed usage machines collect build-box
ed skills install edith-remote-work --agent claude-code --yes
```

Prefer the desktop app's SSH sessions?

They work alongside Edith. Machines still shows the server's health, files, processes and Docker containers, whichever way you started the session.

## Which approach to pick

- **One server, occasional use:** SSH and tmux. Free and nothing to install on your Mac.
- **You already work in the Claude desktop app:** its SSH sessions.
- **The agent should stay local:** Claude Code on your Mac with the `edith-remote-work` skill.
- **Several machines and several agents:** Edith's Machines, Agents and Usage, which also cover Codex, OpenCode and other agents.

## Common questions

### Does Edith run Claude Code in the cloud?

No. Agents run on your own machines only: this Mac and the computers you add over SSH. For sessions on Anthropic's infrastructure, use Claude Code's cloud sessions.

### Which servers does Machines support?

Macs, Linux servers and Windows PCs running an SSH server. Some features, such as service management, depend on the system.

### Do I need a separate Claude plan for the server?

Claude Code on the server signs in with your account like anywhere else, and its usage counts against the same plan limits as your laptop.

### Is there a mobile app?

No. Edith is a Mac app for macOS 14 or later on Apple silicon, with no iPhone app and no sync between devices.

## Go further

[Manage servers from your Mac](https://getedith.pro/use-cases/manage-servers-from-your-mac) covers the rest of Machines: files, Docker, port forwards and snippets. [Running multiple Claude Code agents](https://getedith.pro/guides/run-multiple-claude-code-agents-mac) explains worktrees, and [installing Claude Code skills](https://getedith.pro/guides/install-claude-code-skills) covers the skill above. Machines, Agents and Usage come with one Edith license; see [pricing](https://getedith.pro/pricing).

## Edith extensions used

- [SSH Server Manager for Mac With Docker and Files](https://getedith.pro/extensions/ssh-machines): Watch, browse and run your servers and containers from one place.
- [Run Multiple Claude Code and Codex Agents on Mac](https://getedith.pro/extensions/coding-agents): See every coding agent on your Macs in one board, and step in when one needs you.
- [Claude Code Usage Tracker for Mac: Codex, Cursor](https://getedith.pro/extensions/claude-code-usage): See what your coding agents cost and how close you are to their limits.
- [Claude Code, Codex and Cursor Skills for Mac](https://getedith.pro/extensions/agent-skills): Teach your coding agents how to use Edith with one-click skills.

## Related guides

- [How to Run Multiple Claude Code Agents on Mac](https://getedith.pro/guides/run-multiple-claude-code-agents-mac): Run several Claude Code agents in parallel on a Mac with git worktrees and agent view, then watch every agent on one board and answer the blocked ones.
- [How to Install Claude Code Skills on Mac](https://getedith.pro/guides/install-claude-code-skills): Install Claude Code skills on a Mac by hand, from a plugin marketplace with /plugin install, or into Claude Code, Codex and Cursor at once with a preview.

## Get Edith

Edith is a native Mac app for macOS 14 or later on Apple silicon with 100+ extensions, the `ed` command line and an MCP server. $35 once for one Mac, plus $7 for each additional Mac, with no subscription and a 30-day refund.

- [Buy Edith](https://getedith.pro/pricing): $35 once for one Mac, plus $7 for each additional Mac
- [Download Edith](https://getedith.pro/download): the installer, or Homebrew
