# Sextant (`sxt`)

Drive **Claude Code on your computer** from your phone.

Run one command on your computer, scan a QR code with the phone app, and you can
start tasks, watch them run, approve risky tool calls and read the results from
anywhere — the work still happens on your own machine, with your own accounts.

## Install

```sh
npm i -g sextant-cli
sxt up          # headless Linux server: sudo sxt up
```

`sxt up` installs it as a background service (starts on boot) and prints a
pairing QR code plus an 8-digit pairing code.

> - If npm's global dir needs root, prefix the install with `sudo`.
> - **Linux servers (ssh / no desktop):** use `sudo sxt up` — it installs a
>   system-level service (still running as your login user). Plain `sxt up`
>   registers a systemd *user* service, which needs a login session and fails
>   with `Failed to connect to bus` in session-less shells. On macOS, don't
>   `sudo sxt up`.
> - A Node-free installer is also available: `curl -fsSL relay.sextant.top/install | sudo sh`

## Pair your phone

1. Install the phone app.
2. **Settings → Connections → Add device**
3. Scan the QR code shown by `sxt up` — or choose *Enter pairing code* and type
   the 8-digit code.

Pair once and it works anywhere: on the same Wi-Fi it connects directly; away
from home it goes through an encrypted relay automatically. No public IP, no
port forwarding, no router setup.

## Commands

```
sxt help          show all commands and options
sxt up            install as a service + start on boot
sxt start         start in the background
sxt stop          stop
sxt restart       restart
sxt status        is it running, how many phones are connected
sxt logs          tail the logs
sxt qr            show the pairing QR code again
sxt code          mint an 8-digit pairing code
sxt update        upgrade to the latest version and restart
sxt version       print the version
sxt down          stop and remove start-on-boot
sxt uninstall     uninstall
```

### Common options

```
-addr 0.0.0.0:7280       listen address and port (change the port here)
-instance <name>         run several daemons, each with its own state dir
-mode direct|relay|both  direct / relay / both (default: both)
-relay-url <url>         relay: the official one by default; put your own here,
                         or "off" for LAN-only
-apns-key <path>         APNs auth key (.p8), required for phone push
```

Options are only needed when starting; later commands (`status`, `stop`,
`restart`, `qr`) reuse them automatically. If you change `-relay-url` later,
re-pair the phone (`sxt qr` / `sxt code`) — the existing pairing still points
at the old relay.

```sh
sxt up -addr 0.0.0.0:9000     # start on a different port
sxt start -instance work      # a second, independent instance
```

## Requirements

- macOS or Linux (x64 / arm64), Node.js ≥ 16
- [Claude Code](https://claude.com/claude-code) installed and logged in on the
  same computer

## Security

Traffic is end-to-end encrypted (X25519 key agreement + AES-256-GCM) using a key
that never leaves your two devices; the relay only forwards opaque frames and
cannot read them. Risky tool calls can require approval on the phone before they
run.

## Links

- Source & issues: https://github.com/ddos798/claude_control
