# crystl server

> Run crystl server on a Linux server as a service, so shells and agents keep running when your Mac sleeps. What it needs, how to set it up, update it, and remove it.

## Overview

crystl server runs on a Linux server, as a service for your account. Your shells and agents run there and keep running when your Mac sleeps. The crystl Mac app connects to the server over SSH and shows its gems beside your other gems.

The new gem panel has three choices:

- **this Mac:** a folder on your Mac.
- **SSH from this Mac:** runs while this Mac is connected.
- **crystl server:** keeps running when your Mac sleeps.

## crystl server or an SSH gem

The new gem panel has both choices. **SSH from this Mac** makes an SSH gem. **crystl server** makes a gem on a server that runs crystl. Both give you cards, status and your files from the Mac app. The difference is what holds the shell open.

| | SSH from this Mac | crystl server |
|---|---|---|
| Where the work runs | On your Mac, which reaches into the server | On the server, in crystl server |
| What holds each shell | An `ssh` connection from your Mac | The service |
| Mac sleeps or the network drops | The shell ends, and the agent ends with it | Shells and agents keep running. An approval waits as a card |
| Hooks reach crystl | Through tunnels inside that `ssh` | On the same machine, with no tunnel |
| The `crystl` command in a shard | Only if you install it on the server | Works in every shard |
| What the server needs | An SSH login and your agent | Linux, systemd and a one-time setup, described below |

An SSH gem (**SSH from this Mac**) needs nothing installed for crystl server on the server. Use it when you want the least setup. Use crystl server when work must outlive your Mac's connection. [Remote SSH sessions](/docs/remote-ssh/) covers SSH gems, and [set up a server](#set-up-a-server) covers crystl server.

## What you need

- **A Linux server** you can reach over SSH from your Mac, with your own account on it. You do not run crystl server as root.
- **glibc 2.35 or later.** Ubuntu 22.04 and 24.04 have it. The Ubuntu releases are the ones crystl server has been tested on. Other Linux systems that pass the check may work, but they are not tested. Alpine and other systems without glibc do not work.
- **An amd64 (x86_64) or arm64 (aarch64) CPU.** Other CPUs have no build.
- **systemd with a user manager.** crystl server runs as a systemd user service. Your SSH login must start a user manager, which `pam_systemd` does on most systems.
- **`sudo` on the server** for two steps: installing packages, and keeping crystl server running after you log out. crystl shows you these commands. It never runs `sudo` for you.
- **curl, bash and python3** on the server. curl is needed to start crystl server. The hooks of Claude Code, Codex, Kimi, Copilot and Antigravity use curl and bash. The hooks of Codex, Kimi, Copilot, Antigravity and Goose also use python3. The setup sheet lists any of the three that are missing and gives you one command that installs them.
- **An SSH login that works without a prompt.** The Mac app signs in with your keys or your SSH agent and checks the server's key. It cannot answer a password, passphrase or key question. Run `ssh <server>` once in Terminal first, so the server is in your `known_hosts` and the login works. Port, key file and jump host settings go in a `Host` entry in `~/.ssh/config`. Type that name as the server.
- **Your agents,** installed on the server for your account.

This list is for a Linux server. A Mac server has its own needs, in [crystl server on a Mac](#crystl-server-on-a-mac). Windows, and a browser as the only client, are not supported.

## Set up a server

The setup sheet opens when you choose a server. It does the work in a fixed order. It changes nothing on the server until you click a step's button.

1. In the new gem panel, choose **crystl server**.
2. Type the server's SSH address, such as `you@server`, and a folder on it. The folder must be inside your home folder.
3. If crystl server is not on the server yet, crystl says `crystl server isn't on <server> yet.` and opens the setup sheet.

These are the rows of the sheet, in the order they run.

| # | Row | What crystl does | What you do |
|---|---|---|---|
| 1 | **check the server** | Runs one read-only check over SSH. It finds the CPU, the C library, curl, bash, python3, systemd, linger, and whether crystl server is already there. | Nothing. If the check finds something no step can fix (not Linux, no build for the CPU, an old C library, no systemd), the sheet stops and says why. |
| 2 | **install curl and python3** | Shows one `sudo` command for your server's package tool (apt, dnf or pacman). On another package tool it names what to install. | Copy the command, run it in a terminal on the server, then click **check again**. |
| 3 | **copy crystl server to the server** | Downloads the server build that matches your Mac app's release, for the server's CPU. It checks the file's size and SHA-256 against the release list, copies it over SSH, checks it again on the server, runs it to confirm its version, and puts it at `~/.local/bin/crystl-host`. | Click the step's button. |
| 4 | **start crystl server** | Writes a systemd user service at `~/.config/systemd/user/crystl-host.service`, enables it, starts it, and waits until it says it is ready. It never restarts a server that is already running. | Click the step's button. |
| 5 | **keep crystl server running after you log out** | Shows `sudo loginctl enable-linger "$USER"`. | Run it on the server, then click **check again**. Without linger, crystl server stops when your last SSH session ends. |
| 6 | **your agents** | One row for each agent you use. It says whether the agent is on the server, and shows the agent's install command when crystl has one. | Install the agents you want. Sign in to each one the first time you run it in a shard. |

A missing agent holds nothing back. crystl server and the setup sheet never read, copy or log an agent's sign-in.

When the server is ready, the gem opens. The sidebar shows the server as `on <server> · online`.

You can also type a name for the server in the new gem panel. The name is optional. [Name and manage a server](#name-and-manage-a-server) covers changing it later.

If the service starts and then stops, crystl says `crystl server started, then stopped:` and the last line of its log. [Read the log](#read-the-servers-log) for more.

### Open a folder from the remote picker

Once the Mac has signed in to a server, you can open more of its folders without the setup sheet. The picker is the one you use to open any folder as a gem.

1. Open the picker and choose **remote**.
2. Choose a `crystl server` row under **SERVERS** to browse that server. Or type its SSH destination in the field and click **browse folders on this server**. The field takes `user@host` or a name from your `~/.ssh/config`, and typing filters the list.
3. The picker shows one level of folders, with `..` to go up. You can also type a path and press return.
4. Choose a folder and click **open as gem**. A folder that is already a gem on that server is selected instead of opened twice.

Each row says what crystl knows about that machine:

- `crystl server`: the Mac has signed in to crystl server there. It adds `connected` once it has reached the server in this session.
- `ssh only`: from your SSH config or an earlier SSH gem. Choosing it fills in the server address and moves you to the folder field. Give a folder and submit it to open an SSH gem. To get crystl server there, choose **crystl server** in the new gem panel.
- `paired mac`: a Mac you paired with. It is its own kind of row.

A server stays in the list after its last gem closes. The list has no forget action. Browsing and opening stay inside your home folder on the server. The picker cannot create a folder. Use the new gem panel, or the question below.

If the server is older than your Mac app, or crystl server is not on it yet, the picker says so and points you to **crystl server** in the new gem panel.

The same two steps work from the `crystl` command on your Mac. `crystl fs --servers` lists the servers your Mac knows. `crystl fs --server <server> '<path>'` lists the folders on one. `crystl open --server <server> '<path>'` opens one as a gem, and `--create-folder` lets it make a missing folder. `fs` is free. `open` needs a Guild membership. Run them on your Mac. A shard on a server cannot run them. The [command line reference](/docs/cli/#fs) has the options.

### When the folder does not exist

If the folder is not on the server, crystl asks `<folder> doesn't exist on <server>.` Choose **create the folder** to make it and open it.

## Secure connection

crystl server listens on `127.0.0.1` on the server and on a private socket in `~/.crystl-anywhere`. It listens on nothing else, so nothing on the network can reach it directly.

Your Mac reaches it through SSH, the same login you already use. SSH checks who you are and encrypts the traffic. crystl server opens no port to the network and asks you for no password. The Mac app stores no SSH password and no key. It uses your SSH setup.

crystl server keeps its state in `~/.crystl-anywhere`: its sign-in keys and the list of folders it opened. Only your account can read that folder. crystl signs in to each saved server when it starts and when your Mac wakes, so the gems are ready without a click.

## Name and manage a server

A server has a name in the sidebar. The name is the heading above its gems. Under it, in small text, crystl shows the home folder on the server, such as `/home/dev`. When crystl does not know the home folder yet, the small line is not there.

Hover the heading to see two lines. `login: user@host:port` is the login ssh uses. `saved as <address>` is the address you typed when you added the server.

To change the name, open the heading's menu and choose **rename server…**. The name is a label on your Mac. It does not change the server or its SSH address.

The heading's menu has four items:

- **rename server…** changes the name.
- **copy address** copies the login ssh uses, such as `dev@host:2232`. It is the resolved login, not the text you typed.
- **reconnect** signs in to the server again.
- **check server and agents…** opens the setup sheet and checks both.

## Gems, shards and panes

One server holds many gems. Choose **crystl server** again with the same server and another folder, and it opens as a second gem over the same connection. You sign in once per server.

crystl server remembers the folders it opened, except gems you closed. When the service restarts or the server reboots, it opens them again with the same gem ids, so your Mac finds them.

A gem on a server has a menu with these items:

- **rename gem…** changes the gem's name on your Mac. The folder on the server keeps its name.
- **copy folder path** copies the gem's full folder on the server.
- **close…** stops the gem's shards on the server. [Stop and remove](#stop-and-remove) has the details.
- **check server and agents…** opens the setup sheet and checks both.
- **update crystl server** appears only while the server runs an older version.

Hover a gem to see its full folder on the server.

Each gem has shards, and each shard is a terminal on the server in the gem's folder. From the Mac app a server gem shows its cards with your other cards. Your answer goes to the server the card came from.

These panes work on a server gem:

- The workbench: tasks, toggles, comments and the whole document.
- Links: your project's `LINKS.md`.
- The markdown view: your project's files and markdown list.
- The servers list: the dev servers running on the server.
- Web panes: open a dev server's page from the servers list, or a URL. The server tells the Mac, and the Mac forwards the port over SSH.

The `crystl` command works in every shard. `crystl status`, `crystl shards`, `crystl card`, `crystl notify`, `crystl links` and `crystl web` are examples. A command the server does not run yet says `crystl <command> is not available in crystl server on Linux yet.` For example, `crystl gem`, `crystl shard`, `crystl schedule` and `crystl docs` are not there yet.

## Send a gem to a server

A gem on your Mac can move its work to a server. Open the local gem's menu and choose **send to a server…**. A sheet opens on the gem's window. When you click **send**, crystl copies the gem's folder to a server that runs crystl. Then it opens the copy there as a gem.

The sheet says: "crystl copies this folder to the server. Your Mac keeps its copy." It also says: "The two copies do not sync. A change in one does not reach the other." Your Mac's folder is never changed.

### Choose the server and the folder

The server list holds every server that has a saved gem, and the servers crystl remembers. Choose **a new server…** to type a `user@host` instead.

Type a folder name. The folder goes under your home folder on the server. A line under the name shows where the copy will go, for example "Copies to /home/dev/move-test on <server>." When crystl does not know the home folder yet, the line reads "Copies to a folder named <name> in your home folder on <server>."

The server must already run crystl server. If it does not, the sheet shows **set up crystl server on this server**, which opens the [setup](#set-up-a-server).

### How the copy works

crystl uses rsync over SSH. When rsync is missing, it uses tar over SSH instead. Both send the same files.

### What it leaves out

The sheet shows how many files and how much data it sends, and this line: "Left out: .build, node_modules, DerivedData, .DS_Store, .crystl/worktrees and .env files."

- crystl lists any `.env` files it finds, each with a box that reads "also send <path>". It sends one only if you tick it. A `.env` file often holds secrets, so tick only the ones the server needs.
- crystl does not send links that point outside the folder, and the sheet says how many it skipped.
- crystl does not send files that have a line break in the name, and the sheet says how many it skipped.

### What it never does

- It never overwrites a folder that already exists on the server. If the name is taken, pick another name.
- It never sends to a folder outside your home folder on the server.
- It never changes your Mac's folder.

If ssh does not trust the server's host key yet, the sheet says: "crystl does not know the host key of <host> yet. Run ssh <address> in Terminal, accept the key, then send again."

### When the copy finishes or stops

crystl copies into a temporary folder next to the destination. It renames that folder only when the copy finishes, so a half copy never looks complete. After a good copy, the sheet says: "Copied to /home/dev/move-test on <server>." The new gem opens under that server.

**cancel** and the Escape key close the sheet, also during a copy. During a copy, crystl stops it and removes the temporary folder. The sheet then says "Cancelled. Nothing was left on <host>." If crystl cannot remove the folder, it says "Cancelled. A partial copy is left at <path> on <host>." Delete that folder by hand.

If the files arrive but the gem does not open, crystl says where the files are. Open them with **crystl server** in the new gem panel.

## Agents

Install each agent on the server for your account, the way its maker documents. Then run it in a shard and sign in. The first run of Claude Code or Codex also asks you to trust the folder. Answer in the terminal.

Cards need the agent's hooks. Each time crystl server starts, it writes its hooks for every agent it prepares, even one you have not installed. In a shared settings file, your own entries stay as they are, and a file crystl cannot change safely stays as it is. The log names it. The hooks stay until you [remove them](#stop-and-remove).

Codex also asks once in its own terminal to review crystl's hooks. Answer there.

| Agent | What crystl shows |
|---|---|
| Claude Code | Approval cards, working and idle status, the conversation view, and questions as cards |
| Codex | Working and idle status and the conversation view. Approval cards are not yet confirmed on Linux, so if no card comes, answer in Codex's terminal. Codex has no question hook, so it asks its questions in its own terminal |
| Copilot, Kimi, Goose and OpenCode | The terminal and when the agent is running. Their hooks are in place, but their approval cards are not yet confirmed on Linux. No working and idle status or conversation view yet |
| Antigravity | The terminal and when it is running. It has no approval cards. Its hooks are in place, but its working and idle status is not yet confirmed on Linux |
| Aider, Kiro and Muse Code | The terminal, and when the agent is running |

A note under the terminal says what works for that agent on this server and what is not available yet. Claude Code, Codex and a plain shell get no note.

Without curl or bash, the hooks of Claude Code, Codex, Kimi, Copilot and Antigravity cannot reach crystl. Without python3, the hooks of Codex, Kimi, Copilot, Antigravity and Goose cannot. The agent still runs, but it asks in its own terminal or runs without its hooks, and no card reaches your Mac. Install the missing package, then [restart the service](#restart-crystl-server).

## What survives, and what does not

**Your Mac sleeps or the network drops.** Shells and agents keep running on the server. A tool call that needs approval waits as a card: up to a day for Claude Code, and a shorter time for some other agents. Codex cards are not yet confirmed on Linux. When SSH works again, crystl signs in again and you are back at the same running process. While the Mac cannot reach the server, the sidebar says `on <server> · offline`.

**The service restarts.** A restart ends every shard on the server, in every gem. The shells and agents in them stop. Then crystl server opens the same folders again and starts a new shell for each shard, with the same name and label but a new shard id. It restores up to 64 saved shards in each gem and 256 across the server. The log names any it leaves out. A saved name that is not valid or is already taken gets a new one. What it cannot bring back:

- The old shell's history, scrollback and environment.
- A card that was waiting.
- Any agent other than Claude Code and Codex. Run it again in the shard.

**Claude Code and Codex can resume, with limits.** crystl types the resume command into the new shell once the shell is ready. It does this only when all of these hold:

- crystl saved the agent's session from its hooks.
- For Claude Code, the conversation's file is still on the server and is not larger than 40 MiB. One shard resumes one conversation. A second shard with the same conversation stays a plain shell.
- For Codex, the saved session ran in this shard's folder or in a folder inside it. A session for another folder, or a saved session id with no saved file path, is not resumed. If the saved file is gone, crystl starts a new Codex session instead of resuming the old one.
- The new shell says it is ready within 15 seconds.

When a check fails, the shard stays a plain shell. The server's log says why when the Codex folder check fails or the shell was not ready in time. Do not count on a resume. It is a convenience, and it can be skipped.

A restart happens when you restart the service, when the server reboots, when a new version of crystl server starts, and when the service crashes and systemd starts it again after 5 seconds. crystl never restarts a running server by itself.

## Update crystl server

Updating the Mac app does not update or restart any server. You do both, on purpose.

1. When the server runs an older version of crystl server than your Mac app carries, the gem's menu offers **update crystl server**. Choose it. crystl copies the new build in the same checked way as the first copy.
2. The sheet says that the server still runs the old version, and how many shards a restart ends.
3. Click **restart** when you are ready. Nothing restarts before that.

A newer or different version of crystl server is never replaced. The sheet says why.

Some older builds do not report a release version. If the app can only identify the build as different, it does not offer an update.

crystl has no automatic rollback. To go back, keep a copy of the build you want, then stop the service, put the copy in place and start the service again:

```bash
systemctl --user stop crystl-host &&
  install -m 755 /path/to/saved/crystl-host "$HOME/.local/bin/crystl-host" &&
  systemctl --user start crystl-host
```

Use the saved build for this server's CPU. Stopping the service ends its shards. Do not copy over a running program: Linux can refuse to write to it. The update in the app writes a new file next to the old one and renames it into place, so a failed update leaves the old file in place. After a rollback, **check the server** shows the older version.

The update and a rollback by hand passed on an amd64 test server, an Ubuntu 24.04 container run by systemd. They have not been run on a physical server or on arm64.

## Troubleshooting

### Read the server's log

```bash
journalctl --user -u crystl-host -n 50
```

The first lines say where crystl server listens, which gems it opened, and whether it set up the agents' hooks. A line `Failed to set thread priority for worker thread` at each start is harmless.

### crystl does not trust the key of the server

The gem says: crystl does not trust the key of `<host>` yet, or the key changed. Run "ssh `<host>`" in Terminal. Check that the key is the server's. Answer yes, then try again.

The Mac app cannot answer the host-key question, so it stops. Follow the steps:

1. Run `ssh <host>` in Terminal.
2. Check that the key is your server's key.
3. Answer yes.
4. Try again in crystl.

If the key changed and you did not expect it, stop. Check with whoever runs the server before you answer yes.

### The server shows as offline

The sidebar reads `on <server> · offline`, and the terminal area says `can't reach <server> over ssh. the gem's shards keep running there if the server is up.`

- Check that `ssh <server>` works from Terminal on your Mac, with no prompt.
- The shards keep running while your Mac cannot reach the server. When SSH works again, crystl signs in again.

### crystl server stops when you log out

Linger is off. Run `sudo loginctl enable-linger "$USER"` on the server.

### crystl server does not start, or stops at once

crystl server needs the curl library. Without it, every command stops with `error while loading shared libraries: libcurl.so.4`. Install curl. On a fresh server run `sudo apt-get update` first, or the install says `Unable to locate package curl`.

The service that the setup sheet writes listens on port 19480 on `127.0.0.1`. If another program already holds that port, crystl server does not start. The log says so.

You can also run `~/.local/bin/crystl-host preflight` on the server. It changes nothing. It prints one line for each missing piece and says whether the service can start. Use the full path: a non-login `ssh` command has no `~/.local/bin` on its PATH.

### No approval cards

Install curl, bash or python3 as the last section of [agents](#agents) says. Then [restart the service](#restart-crystl-server). Check that the agent's hooks were set up: the first lines of the log say so.

### Restart crystl server

```bash
systemctl --user restart crystl-host
```

This ends every shard, as [described above](#what-survives-and-what-does-not). From the Mac app, use the **restart** button on the update sheet.

### A shard's shell will not start again

When a gem's last shell exits, crystl server starts a new one. If that fails, the shard says `crystl server could not start this shard's shell again:` and the reason. Restart the service, or close the gem and open its folder again.

### Folders in other places

A gem opened from the Mac app must be inside your home folder on the server.

## Stop and remove

The Mac app closes a gem. It has no one-step remove for crystl server itself. Remove crystl server by hand, over SSH, as your account.

**Close a gem.** In the sidebar, open the gem's menu and choose **close…**. crystl asks "close <gem> on <server>?" and says: "The shards in this gem stop. The gem will not come back when <server> restarts." Choose **close gem** to go on.

If crystl cannot reach the server, it says "Can't reach <server>. The gem is still open there." It then says the gem stays open there, and offers **hide on this Mac**. That hides the gem's row on your Mac only. The shards keep running on the server.

**Stop the service.** Each card that is waiting is closed first with no decision, so no agent is left waiting on crystl. Stopping the service ends every shard on the server.

```bash
systemctl --user stop crystl-host
```

**Remove it from the server.** Run the steps in this order:

```bash
systemctl --user disable --now crystl-host
~/.local/bin/crystl-host hooks remove
rm ~/.local/bin/crystl-host ~/.config/systemd/user/crystl-host.service
```

- `disable --now` stops the service and stops it from starting again.
- `hooks remove` takes out the hooks that crystl server wrote for each agent it prepares, and in a shared settings file it keeps every entry that is not its own. A file it cannot safely change, such as one it did not write, stays in place, and the output names it. Run it after `disable --now`. While the service is enabled, its next start adds the hooks again. It exits with an error when something stays, so read its output.
- The hooks stay after the service stops, until you remove them.
- Delete `~/.crystl-anywhere` to forget the sign-in keys and the list of folders.
- To turn linger off again, run `sudo loginctl disable-linger "$USER"`.

Cleanup is not perfect. Check the output of `hooks remove` and look in your agents' config folders if you need to be sure.

If you moved an agent's config folder with `CODEX_HOME`, `KIMI_CODE_HOME`, `COPILOT_HOME` or `GOOSE_PATH_ROOT`, give `hooks remove` the same value the service had, so both look in the same place. crystl server reads these from the service's own environment, not from your login shell. If you started the service with a different `--state` folder, pass the same `--state` to `hooks remove`, so it finds the OpenCode plugin. Most people never set any of these.

## crystl server on a Mac

A Mac can be a crystl server. It runs crystl as a LaunchAgent, the Mac counterpart of the systemd user service. Your shells and agents run on that Mac. The crystl Mac app on another Mac connects to it over SSH.

This section says "unverified" for each claim that nobody has checked on a real Mac. The checks so far ran on 2026-12-01 on one MacBook Air with macOS 26.7.3, arm64 and FileVault on.

### What a Mac server is for

- Run Claude Code or Codex on a Mac that stays on, such as a Mac mini. Keep working from your laptop.
- Use the Mac's own tools, files and logins from your laptop.
- Shells and agents keep running while your laptop sleeps. The server Mac must stay awake and logged in. [What keeps it running](#what-keeps-a-mac-server-running) says more.

### What a Mac server needs

- **macOS 13 or later.** Only macOS 26.7.3 has been tried. Older versions are unverified.
- **An arm64 Mac (Apple silicon) first.** The Intel (x86_64) build has never run on a real Intel Mac. That is unverified.
- **You are logged in at the Mac's own screen.** crystl server runs in your login session. [Why you must be logged in](#why-you-must-be-logged-in) gives the reason.
- **Remote Login turned on,** in System Settings, General, Sharing. crystl uses SSH to reach the Mac.
- **Claude Code or Codex,** installed on the Mac for your account, if you want to use them. You sign in to each one the first time you run it in a shard. crystl never reads, copies or logs their credentials.

The sheet never runs `sudo`. No Mac step needs it.

### The setup sheet on a Mac

The sheet has the same rows and order as for Linux. Nothing on the Mac changes until you click a step's own button.

| # | Row | What crystl does | What you do |
|---|---|---|---|
| 1 | **check the server** | Runs one read-only check over SSH. It reads the macOS version, the CPU, who is logged in at the screen, and whether crystl server is installed. It runs no agent and reads no Keychain item. | Fix what it reports, then check again. |
| 2 | **install python3** | Shows only when python3 is missing. It says `Codex's hooks need python3. install the command line tools. this opens a window on the Mac's screen.` | Run `xcode-select --install`. It needs no `sudo`. A missing python3 holds nothing back. A Mac has curl and bash already. |
| 3 | **copy crystl server to the server** | Checks the file's size and SHA-256 before and after the copy, as on Linux. It writes a new file and renames it over `~/.local/bin/crystl-host`. It never writes into the old file. | Nothing. The rename rule is a known macOS rule for signed files. It is unverified here. |
| 4 | **start crystl server** | Writes a LaunchAgent, `~/Library/LaunchAgents/dev.crystl.host.plist`, loads it into your login session, and waits for the ready line in the log. It never restarts a running server. | Nothing. When it works, the row says `crystl server is running`. |
| 5 | **keep crystl server running** | Shows one line for each fact it found, with advice for each. | Log in at the Mac, turn off sleep, then click **check again**. |
| 6 | **your agents** | Shows one row for each agent you use. | Install the agents you want. Signing in stays yours. |

The check in row 1 stops the sheet and says why in three cases:

- `this Mac runs macOS <version> on <arch>. crystl server needs macOS 13 or later, on arm64 or x86_64.`
- `nobody is logged in at this Mac. crystl server runs in your login session. log in at the Mac, then check again.`
- `<console_user> is logged in at this Mac, not <user>. crystl server runs in <user>'s login session. switch to <user> at the Mac, then check again.`

If the service starts and then stops, row 4 says `crystl server started, then stopped:` and the last line of its log. If the service gives no ready line in 20 seconds, the row says `crystl server started, but did not say it was ready within 20 seconds.` It adds the last log line. If you had a different plist, crystl keeps it as `dev.crystl.host.plist.bak`, then `.bak.1` and up.

Row 5 shows these lines: `you are logged in at the Mac: yes` or `no`, `automatic login: on` or `off`, and `sleep: never` or `sleep: after <n> minutes`. The row is done when you are logged in and sleep is off. Only "nobody is logged in" stops the sheet. The rest is advice.

For Claude Code, row 6 can say `claude cannot read its login over ssh. start crystl server in your login session.` The Mac sheet does not yet say that Codex needs `node` on its PATH. The next section covers that.

### Why you must be logged in

crystl server must run in your login session. The reason is Claude Code's login.

- Claude Code keeps its login in your login Keychain.
- Over SSH, the Keychain is closed. `claude` prints `Not logged in` and exits with 1.
- The same command in a shard of the LaunchAgent service worked. A LaunchAgent runs inside your login session.
- A background job outside your session gets the same answer as SSH. For this reason, crystl server does not use a LaunchDaemon. That is unverified: the checks ran a LaunchAgent only.

Codex keeps its login in `~/.codex/auth.json`. It needs no login session. It does need `node` on its PATH. Without `node`, Codex stops with `env: node: No such file or directory`. Install node with Homebrew. The LaunchAgent's PATH holds `/opt/homebrew/bin`, so Codex finds node there. Whether Codex finds it in a shard is unverified.

Other ways to sign in to Claude Code are not covered here. Nobody has verified them.

### What keeps a Mac server running

A Mac has no linger. The server runs while you stay logged in at the Mac.

| What happens | Does crystl run? |
|---|---|
| The display sleeps or the screen locks | Yes, the session stays. Unverified. |
| The whole Mac sleeps | No. A sleeping Mac runs nothing. |
| You log out at the Mac | No. The session ends. Unverified. |
| The Mac restarts and nobody logs in | No. It starts at the next login. Unverified. |

So:

- **Stay logged in.** Lock the screen. Do not log out.
- **Stop sleep.** In System Settings, Energy, turn off automatic sleeping. The sheet says `the Mac sleeps after <n> minutes, and crystl server stops with it. turn off automatic sleeping in System Settings, Energy.`
- **Use automatic login on a Mac with no screen.** A Mac mini restarts to the login window, and crystl server stays off. The sheet says `if the Mac restarts, crystl server stays off until someone logs in. turn on automatic login in System Settings, Users & Groups.` Anyone at the Mac then gets your account. crystl does not set this for you.
- **FileVault blocks automatic login.** The sheet says `automatic login is not available while FileVault is on.` Whether the login Keychain is open after automatic login is unverified. No Mac with FileVault off was tried.

A crash leaves a stale `control.sock` in the state folder. An older `crystl-host` then fails to restart. A newer build removes it at start.

### Update a Mac server

The sheet copies the new file as in row 3. It first copies the old file to `~/.local/bin/crystl-host.previous`. A second update replaces that file. Then the sheet asks before it restarts, and says how many shards a restart ends:

`crystl server on the Mac is still running the old version. A restart starts the new one. It ends all <n> running shards.`

For one shard it says `It ends the 1 running shard.` For none it says `No shards are running there.` The restart ends every shard. Nothing restarts until you click.

Whether `launchctl kickstart -k` re-reads a changed plist is unverified. After a plist change, use `bootout` and `bootstrap`.

### Roll back a Mac server by hand

The sheet has no rollback button yet. Run these over SSH, as your account:

```bash
mv ~/.local/bin/crystl-host.previous ~/.local/bin/crystl-host
launchctl kickstart -k gui/$(id -u)/dev.crystl.host
```

This ends every shard. Nobody has run it as a user step. That is unverified.

### Remove a Mac server by hand

Run these over SSH, as your account, in this order:

```bash
launchctl bootout gui/$(id -u)/dev.crystl.host
~/.local/bin/crystl-host hooks remove
rm ~/.local/bin/crystl-host ~/Library/LaunchAgents/dev.crystl.host.plist
```

- `bootout` stops the service. crystl server answers each held card first. That is unverified for held cards.
- Run `hooks remove` after `bootout`. While the plist stays loaded, the next start adds the hooks again.
- Delete `~/.crystl-anywhere` to forget its sign-in keys and folders.
- Delete `~/Library/Logs/crystl-host.log` to delete the log.
- Delete `~/.local/bin/crystl-host.previous` if it is there.
- A Mac has no linger to turn off.

### Folders that ask for permission

macOS may ask for permission when a shard first reads `~/Documents`, `~/Desktop`, `~/Downloads` or an external volume. A Mac with no screen in front of it cannot answer. Whether the prompt comes, and whether it comes again after an update, is unverified. Keep your gems in a folder outside these, such as `~/Projects`.

### Limits on a Mac

- Claude Code needs your login session. It cannot sign in over SSH.
- Other logins for Claude Code are not covered.
- A LaunchDaemon is not offered.
- The SSH tunnel is the only way in.

## Limits

- Linux servers, on amd64 or arm64 with glibc 2.35 or later. Tested on Ubuntu 22.04 and 24.04. A Mac server is covered in [crystl server on a Mac](#crystl-server-on-a-mac). Windows, and a browser as the only client, are not supported.
- Claude Code gets cards, status and the conversation view. Codex gets status and the conversation view, and its cards are not yet confirmed. Other agents get less, as the [agents](#agents) section lists.
- A real Codex has shown working and idle status on Linux. Its approval card has not been confirmed there, so if no card comes, answer in Codex's terminal.
- Schedules and sequences are not available on a server gem: `Schedules and sequences are coming soon to gems on a Linux host.` For another missing feature the app says `This host does not support <the feature> yet.`
- crystl server never updates or restarts itself. There is no automatic rollback.
- A restart ends every shard. Only Claude Code and Codex can resume, and only under the rules above. crystl restores up to 64 saved shards in each gem and 256 across the server.
- You reach the server through SSH from the Mac app. Reaching it from a browser, your phone or a Mac without SSH is not available yet.

## Cost

crystl server is free to install and to use from the Mac app. A Guild membership adds what it adds on your Mac: the `crystl` commands that change something, such as `crystl send`, then work in the server's shards. To use your Guild membership there, copy `~/.config/crystl/license.key` from your Mac to the same place on the server, then restart crystl server.

## Go deeper

- [crystl server feature page](/features/crystl-server/) for the overview.
- [Remote SSH sessions](/docs/remote-ssh/) for gems that live only while your Mac is connected.
- [Work over SSH](/docs/scenario-work-over-ssh/) for a task-first walk through an SSH gem.
- [Gems and shards](/docs/gems-and-shards/) for what a gem and a shard are.
- [Hooks](/docs/hooks/) for what approval hooks are and what they change.
- [Troubleshooting](/docs/troubleshooting/) for problems that are not about servers.

---
Source: https://crystl.dev/docs/crystl-server/
