Skip to content

Paths and Environment

Roost resolves all of its filesystem state once at startup. Other components read the paths from this resolution; nothing should derive its own.

There are three UI bundle profiles — Mac, Linux, and Iced (slugs mac, linux, iced) — and each running UI resolves exactly one of them; each owns its own workspace + PTY supervisor in-process, so there is no daemon a UI depends on. A fourth profile, Session, is resolved by the headless roost-session daemon (HS-1a, plan 035) — a workspace + PTY supervisor with no UI attached, opt-in via roostctl session start (see Session profile below). It is a legal roostctl --target value (--target session, explicit only — #475) but not a legal ROOST_BUNDLE_PROFILE value, and auto-detect never probes it; roostctl session start|stop|status keep their own carve-out, addressing its socket directly ahead of that ladder. The definition lives in crates/roost-ipc/src/paths.rs.

Profile Who resolves it app_label app_id
Mac the shipped macOS Roost.app (bundle id ai.stridelabs.Roost) Roost ai.stridelabs.Roost
Linux the packaged Linux UI (/usr/bin/roost) Roost-linux ai.stridelabs.Roost on Linux; ai.stridelabs.Roost.linux on macOS
Iced a dev build of roost-iced, and the dev macOS Roost-Iced.app (make bundle-iced) Roost-iced ai.stridelabs.Roost.iced
Session the headless roost-session daemon (/usr/bin/roost-session on the Linux .deb) RoostSession (RoostSessionDev in debug builds) ai.stridelabs.Roost.session

app_label is fixed per profile on every platform — it is the string identify and roostctl doctor report, and on macOS it is also the directory component of the profile's paths. app_id is the only field that resolves per platform: on Linux the Linux profile shares ai.stridelabs.Roost with the Mac profile, which can never run there and already shares that platform's path namespace; on macOS every profile stays independently resolvable (so their paths and identities can never collide), even though nothing ships or launches the Linux one there.

The Linux .deb ships roost-iced built with the roost-iced/linux-package Cargo feature, which flips its compiled-in default profile from Iced to Linux on Linux. The Linux profile's paths are byte-identical to the ones the pre-iced Linux package resolved (it is the same profile, renamed), so an installed Roost upgrades in place with no migration and no change to roostctl or Claude hooks. Dev builds (no feature) and every non-Linux platform keep the isolated Iced profile. ROOST_BUNDLE_PROFILE overrides the compiled-in default in every build, packaged or not.

The profile defaults to:

Binary Default profile Override
Roost.app (macOS) Mac the app's bundle id (ai.stridelabs.Roost) picks Mac
roost (Linux .deb, built --features roost-iced/linux-package) Linux ROOST_BUNDLE_PROFILE=iced to keep the isolated profile in a packaged build (or =mac to dial another profile's namespace)
roost-iced (dev build, any platform; macOS Roost-Iced.app) Iced ROOST_BUNDLE_PROFILE=mac / =linux to dial another profile's namespace
roostctl (binary from the roost-cli crate) auto-detect ROOST_BUNDLE_PROFILE / --socket / ROOST_SOCKET / --target {mac,linux,iced,session}

The two sides treat an unrecognized ROOST_BUNDLE_PROFILE value differently, on purpose. A UI logs a warning and falls back to its compiled-in default rather than refusing to launch; roostctl hard-errors with unknown ROOST_BUNDLE_PROFILE value … (expected mac, linux, or iced). A stale ROOST_BUNDLE_PROFILE=gtk left over from an older install therefore starts the UI on its normal profile (with a warning in the log) but stops the CLI outright. session gets that same roostctl rejection from ROOST_BUNDLE_PROFILE — it names a real profile kind internally, but is deliberately not one of ROOST_BUNDLE_PROFILE's legal values, by design (see Session profile), not because it is unimplemented. --target is the exception: --target session is accepted, explicitly only (#475) — auto-detect still never probes it either way.

File locations

The user-editable config file lives under XDG on both platforms — ~/.config/roost/config.conf (or $XDG_CONFIG_HOME/roost/config.conf if set). Set ROOST_CONFIG to an absolute path to read config from there instead (used by the E2E harness to drive the command launcher off a seeded config). A config.lock sits beside it, after symlinks are resolved: the UI, roostctl and a connecting client can all rewrite config.conf, and an atomic rename stops a torn file but not a lost update, so every Roost writer takes that lock first. It moves with ROOST_CONFIG. The state files (state.json, socket) follow each platform's native convention. The directory component on macOS is the profile's app_label — Roost, Roost-linux, Roost-iced, or RoostSession/RoostSessionDev for a headless session.

Set ROOST_STATE_DIR to an absolute path to redirect only the state directory (where state.json and its state.lock live) — the socket, the socket lock, and the log dir stay on the default profile path, so roostctl and the E2E harness still find the running UI by its unchanged socket. A roost-session under the override also puts its upload store inside that directory rather than on the cache path, which is the point: an isolated session must not sweep a developer's real one at start. Note the consequence: two UIs with different ROOST_STATE_DIR values no longer collide on state, so a collision that used to be loud is now silent isolation; the socket lock is what still catches a genuine second instance on one socket. The E2E harness uses this to give each run an isolated, throwaway state.json without touching a developer's real saved tabs. Unlike ROOST_CONFIG (which accepts any non-empty value), ROOST_STATE_DIR requires an absolute path: a relative value is ignored (a relative state dir would resolve against the process's working directory).

One derivation rides on top of the seam, and it is asymmetric on purpose. When something launches a headless roost-session for you — the UI's Connect on a localhost host, or roostctl session start — and ROOST_STATE_DIR is set to a value the resolver honours, the daemon is handed <that directory>/session instead of inheriting the value verbatim. Without it the daemon would resolve its launcher's own state dir, find that launcher's state.lock already held, and refuse to start ("another session (pid N) is using this state directory") — the isolation seam colliding with itself. roostctl session start prints the derived path on stderr when it does this; the UI records it in its log. The daemon stays addressable either way, because the socket does not move with ROOST_STATE_DIR — roostctl session status|stop find it by socket. The other half of the asymmetry: the daemon's own reading of the variable is unchanged, so running ROOST_STATE_DIR=/tmp/x roost-session start directly still puts its state in /tmp/x verbatim. Only a launcher derives, and only from a value that would redirect its own state dir — an empty or relative value derives nothing and is passed through untouched.

This is a deliberate divergence from Apple's HIG on macOS: Roost matches the convention used by Ghostty, nvim, fish, and most CLI-adjacent tools, which keeps user-edited config alongside the rest of one's dotfiles. State files (which the user does not edit) stay in ~/Library/Application Support/<app_label>/ and the socket lives in ~/Library/Caches/<app_label>/.

macOS — Mac profile (Roost.app)

These are the paths the Swift Roost.app used before v0.1.0, unchanged, so an upgrade keeps its state, socket and logs.

Path Purpose
~/.config/roost/config.conf User-editable config; see Config keys below
~/.config/roost/config.lock flock serialising every Roost writer of config.conf; moves with ROOST_CONFIG
~/Library/Application Support/Roost/state.json UI-owned workspace state (projects, tabs)
~/Library/Application Support/Roost/state.lock flock guarding state.json (moves with ROOST_STATE_DIR)
~/Library/Caches/Roost/roost.sock Unix socket the UI listens on
~/Library/Caches/Roost/roost.lock flock guarding the socket's bind + lifetime
~/Library/Logs/Roost/roost.log App log

macOS — Iced profile (Roost-Iced.app, or cargo run -p roost-iced)

Same shape as the Mac profile with Roost-iced in place of Roost, so a dev build runs beside an installed Roost.app without touching its state:

Path Purpose
~/Library/Application Support/Roost-iced/state.json Iced workspace state
~/Library/Application Support/Roost-iced/state.lock Iced state lock
~/Library/Caches/Roost-iced/roost.sock Iced Unix socket
~/Library/Caches/Roost-iced/roost.lock Iced socket lock
~/Library/Logs/Roost-iced/roost.log Iced log (also teed to stdout)

macOS — Linux profile

The Linux profile still resolves on macOS (Roost-linux / ai.stridelabs.Roost.linux, same shape as the two above), but nothing ships or launches it there. You only see these paths if you set ROOST_BUNDLE_PROFILE=linux by hand: ~/Library/Application Support/Roost-linux/, ~/Library/Caches/Roost-linux/, ~/Library/Logs/Roost-linux/.

Linux

Linux follows XDG conventions for everything. The Mac and Linux profile kinds both resolve to the production roost namespace, and the packaged .deb resolves Linux (see above), so the installed package lands here. A dev build of roost-iced stays in a separate roost-iced namespace so it can run beside the installed package.

Path Purpose
$XDG_CONFIG_HOME/roost/config.conf User-editable config; defaults to ~/.config/roost/
$XDG_CONFIG_HOME/roost/config.lock flock serialising every Roost writer of config.conf; moves with ROOST_CONFIG
$XDG_DATA_HOME/roost/state.json UI-owned workspace state; defaults to ~/.local/share/roost/
$XDG_DATA_HOME/roost/state.lock flock guarding state.json; moves with ROOST_STATE_DIR
$XDG_RUNTIME_DIR/roost/roost.sock Unix socket; falls back to /tmp/roost-<uid>/roost.sock when XDG_RUNTIME_DIR is unset
$XDG_RUNTIME_DIR/roost/roost.lock flock guarding the socket's bind + lifetime
$XDG_STATE_HOME/roost/roost.log app log (also teed to stdout); falls back to ~/.local/state/roost/

For a dev build of Iced, replace each roost path component with roost-iced; its socket fallback is /tmp/roost-iced-<uid>/roost.sock. A packaged (.deb) build uses the roost paths above, unchanged.

These are the paths every previous Linux release used, and the rename of the profile kind deliberately did not move any of them. In the same spirit the package installs its desktop entry as /usr/share/applications/ai.stridelabs.Roost.desktop plus a NoDisplay alias at ai.stridelabs.Roost.gtk.desktop — the id v0.0.17 and earlier shipped, which a launcher pin created back then references forever. The alias has no menu entry of its own; it exists so those pins keep launching.

The directories are created at first launch with mode 0700.

switch-journal.json lives beside state.json, in whichever UI profile above is running — not in the Session profile below, since the journal belongs to whichever iced UI is driving a local-backend switch (see Switching the local backend), not to the daemon it switches onto. It only exists while a switch is in progress or was interrupted mid-flight; a UI that starts up and finds one resumes or rolls it back before doing anything else, then deletes it.

Session profile

Session resolves paths the same way the three UI profiles do, and is now live: the headless roost-session daemon (HS-1a, plan 035) resolves it — the Linux .deb ships it as /usr/bin/roost-session and Roost.app ships it at Contents/MacOS/roost-session (HS-4b), opt-in via roostctl session start or the palette's Connect Host: localhost. It is a legal roostctl --target value — roostctl --target session resolves to this profile's socket — but explicitly only (#475): it is still not a legal ROOST_BUNDLE_PROFILE value (ROOST_BUNDLE_PROFILE=session is rejected the same as any other unrecognized value) and auto-detect never probes it, by design (see session.rs's module doc: a session is not a UI). roostctl session start|stop|status keep their own pre-connect carve-out ahead of all of this — they never consult --target / ROOST_BUNDLE_PROFILE / auto-detect at all, resolving this profile's socket directly, since start has to work when nothing is listening yet. Any other op reaches a session through roostctl --target session or an explicit roostctl --socket <path>; an op the session does not serve fails with the server's own error for that op — unknown-op for host.* and agent.set_hooks, internal: no UI attached for app.* window/UI ops (app.activate alone answers {} and does nothing) — not a session-specific one. Debug builds substitute RoostSessionDev / roost-session-dev for the directory name in all of the paths below (socket, state, logs, and the upload store), so a dev session can never collide with a real one — unless ROOST_SESSION_SOCKET_DIR names the socket directory, which takes no namespace.

Platform Socket State Logs Uploaded files
macOS ~/Library/Caches/RoostSession/roost.sock ~/Library/Application Support/RoostSession/ ~/Library/Logs/RoostSession/ ~/Library/Caches/RoostSession/files/
Linux <passwd home>/.local/state/roost-session/run/roost.sock (see below) $XDG_DATA_HOME/roost-session/ $XDG_STATE_HOME/roost-session/ $XDG_CACHE_HOME/roost-session/files/, defaulting to ~/.cache/roost-session/files/

The files column is where session.put_file lands what a client uploads for a host tab — a pasted image, a dropped PDF. Each file gets a directory of its own named from 16 hex characters of OS entropy, so the basename an agent displays survives while two drops of the same name never collide; the root and those directories are 0700 and the files inside them 0600. It is a cache root on purpose, and not the state dir: the bytes are reproducible from the client and disposable, the session sweeps the whole directory at start and on a clean stop, and 512 MiB of screenshots does not belong in ~/Library/Application Support or $XDG_DATA_HOME. It is deliberately not $XDG_RUNTIME_DIR either — that is tmpfs, and an upload has to outlive the memory a session can spare for it.

When ROOST_STATE_DIR is set to a value the resolver honours, the store follows it (<state dir>/files/) rather than staying on the cache path. That is the one place the override reaches past state.json, and it is what keeps a spawned dev session's sweep-on-start away from a developer's real ~/.cache/roost-session-dev/files.

A path that cannot be pasted bare is not used. session.put_file answers with a path the client pastes into a shell unquoted, so at start the session checks the entire absolute path it resolved against [A-Za-z0-9._/-]. One space in $HOME — /Users/charlie k/… — one accented character, or one byte that is not valid UTF-8 anywhere in it, and every upload would paste as something the agent on the far side parses as two arguments. So the store moves instead, to the profile's own /tmp root, and logs the substitution once: /tmp/RoostSession/files on macOS, /tmp/roost-session-<uid>/files on Linux (RoostSessionDev / roost-session-dev in debug builds, as everywhere else here). That Linux fallback stays in /tmp and does not follow the socket directory: it exists to avoid a home whose path cannot be pasted bare, and the socket now lives under that home. Per profile, never one shared directory — a debug and a release session on the same box would otherwise sweep each other's live uploads at start.

Before creating any of the above, the daemon installs umask 0077, so the state dir, log dir, and socket directory it creates land at 0700 and state.json at 0600 (the socket file itself gets 0600 the same way every profile's socket does — see ipc.md). A session socket additionally checks the connecting peer's UID at accept time and drops any connection from a different user, which no UI socket does. validate_runtime_dir rejects rather than repairs a socket directory some other mode or owner already created, so a session's lock-acquisition step never silently inherits a loosened directory.

Session launch hints

Two environment variables pass one-time information into a roost-session process at the moment it is spawned. Both are consumed once: the daemon reads and removes each from its own environment before doing anything else, specifically so a shell it later spawns can never inherit either — a hint about how the session itself started has no business leaking into a tab.

Variable Set by Effect
ROOST_SESSION_LAUNCH_CWD roostctl session start, and the UI's own spawn-if-missing connect The directory the daemon was launched from. The daemon chdir("/")s immediately, so this is the only way to log where a session came from — it is logged and then discarded, never used to seed anything (a first-ever session seeds Untitled 1 at $HOME like every UI, regardless of where it was started from — see config.md's local-backend).
ROOST_SESSION_NO_SEED Only a spawn made for a local-backend switch's own destination: the forward switch you ask for, and the launch-time migration a session start performs over an in-process workspace that still has a layout. Both dial that destination the same way, so both withhold. Tells a first-ever session not to seed itself a project. Set because that spawn is immediately followed by the switch's own replay — a session that seeded itself first would hand you a stray empty project sitting beside the layout you just moved over. Every other spawn — roostctl session start, an ordinary launch-time connect to the same session, a Connect you press — gets the ordinary seeded behavior.

Session socket (Linux)

On Linux the session socket does not follow XDG_RUNTIME_DIR. That variable is a different value in a desktop login, an SSH login and sudo (and absent in a container), so a daemon started in one was invisible from another. It lives under this uid's passwd home instead:

<pw_dir>/.local/state/<ns>/run/roost.sock
<pw_dir>/.local/state/<ns>/run/roost.lock     (the bind lock)

<ns> is roost-session, or roost-session-dev in a debug build. <pw_dir> comes from getpwuid_r(getuid()), looked up once per process — never $HOME, which sudo and su can leave pointing elsewhere, and never /tmp. With the default XDG_STATE_HOME, <ns> is also the session's log directory, so the socket sits beside the logs. macOS keeps ~/Library/Caches/RoostSession/; this section is Linux only.

The directories are checked one level at a time, each step tolerant of a concurrent creator:

  • ~/.local and ~/.local/state are made 0700 if missing and otherwise only required to be directories. They are the user's own: a dotfile-manager symlink is followed, and a group-writable ~/.local (umask 002) is accepted.
  • <ns> must be owned by you, not a symlink, and not group- or world-writable. 0750 is your call — it is also the log directory.
  • run/ must be owned by you, not a symlink, and exactly 0700. A run/ created earlier at 0755 is refused, not repaired.

Every refusal names the offending path and ROOST_SESSION_SOCKET_DIR. The check holds only while the home's own ancestors (~/.local, ~/.local/state) stay put; whoever can rename entries there can already replace ~/.local/bin/roost-session, so that is the trust boundary, not a hole the check could close.

Three ways resolving the path can fail, each a startup error rather than a fallback:

  • No passwd entry, or a relative pw_dir — typical of a minimal container running as an arbitrary uid. Set ROOST_SESSION_SOCKET_DIR.
  • A path that is not UTF-8. identify.local_session_socket advertises the path as a string, and a lossy one would send clients elsewhere, so a non-UTF-8 home (or override) is refused.
  • A path that does not fit sun_path. The literal socket path is length-checked when it is resolved — 107 bytes on Linux, 103 on macOS — and refused naming the path and the override. A long home directory is the usual cause.

Session socket override

ROOST_SESSION_SOCKET_DIR names the socket's directory itself, on Linux and macOS, for the session profile only (no UI profile reads it):

  • An absolute value is the directory: the socket is <dir>/roost.sock and the lock <dir>/roost.lock. No namespace is appended, so a debug and a release build given one value share one socket.
  • Empty is the same as unset. A relative value is an error naming the variable.
  • The directory is validated at bind time like any runtime directory: owned by you, 0700, not a symlink.
  • It moves the socket and its lock only. State and logs keep their XDG_DATA_HOME / XDG_STATE_HOME paths. roostctl session start and the UI's spawn-if-missing hand it unchanged to the session they spawn, so roostctl session status|stop find that session.

It is the way to run a session somewhere other than the default: a container with no passwd entry, a test, a second isolated session. A daemon built before this variable existed ignores it; see the upgrade note below.

Test-only knobs

Two variables exist for the test harness. Both must be absolute, and both are read by debug builds only; a release build ignores them. (A third, ROOST_TEST_USER_RUNTIME_DIR, follows its own rule and is described with XDG_RUNTIME_DIR below.)

Variable Effect
ROOST_TEST_PASSWD_HOME Replaces the getpwuid_r lookup: the session default becomes <value>/.local/state/<ns>/run/roost.sock.
ROOST_TEST_OLD_SESSION_DIR Makes <value> the one and only old-path candidate (below), so a test can plant a scratch daemon without ever looking at the real runtime directories.

A test-shaped process fails closed on the session socket. With ROOST_TEST_MODE=1, resolving the default socket without ROOST_TEST_PASSWD_HOME is an error naming ROOST_SESSION_SOCKET_DIR (only the override or the knob satisfies it), and a debug build with ROOST_TEST_SESSION_DIR_NAMES=release and neither is refused too. That keeps a harness that forgot to isolate itself away from the developer's real session.

Upgrading from an older build

Builds up to 0.0.26 bound the session socket at $XDG_RUNTIME_DIR/<ns>/roost.sock, else /tmp/<ns>-<uid>/roost.sock. A daemon one of those started keeps running at its old path after an upgrade, and the new build never attaches to it: it is found, reported and restarted. Discovery looks at the candidates $XDG_RUNTIME_DIR/<ns>, /run/user/<uid>/<ns> and /tmp/<ns>-<uid> (none on macOS), deduplicated by canonical path and never this build's own socket. A candidate must be a socket of this uid in a directory of this uid that nobody else can write, and must answer session.identify within two seconds.

  • roostctl session start and roost-session start refuse, while nothing answers at the new path and an old-path session is found, naming it and the command below. An old daemon with its own state directory would otherwise run beside the new one.
  • roostctl session status prints running at an old path: <socket> (session <id>, protocol <n>) for each one and still exits 3 when nothing answers at the new path; --json adds an old_paths array.
  • roostctl doctor warns on session.old_path, and skips the check, saying why, where the probe may not run.
  • The iced UI shows the section as needs-restart (host.status reason old socket path, detail the socket) and offers Restart. The restart stops the old daemon where it was found and starts a session at the new path. The layout is kept; running processes are not.
  • roost-session client-bridge (what an ssh host runs) reaches an old-path session only as a restricted proxy: it forwards session.identify and session.stop and answers every other op with an error naming the old path and the fix. Upgrade the laptop together with the remote: an older laptop reaching an older daemon through a newer remote roost-session is refused past session.identify, while an up-to-date laptop shows the restart prompt.
  • roostctl session stop only ever stops this build's own socket. roostctl session stop --old-path <socket> stops a session at one of the discovered candidates: it refuses this build's own socket, any path that is not a candidate, and a session that reports no session id. It prints the socket and id first and stops only if that id still answers when the stop is sent.

The probe does not run when ROOST_SESSION_SOCKET_DIR is set, when ROOST_TEST_MODE is set to anything, or in a debug build that resolves the shipped names. This compatibility code is temporary: #652 retires it, and with it --old-path and the doctor check.

SSH scratch directories

A saved host reached over SSH (host-sessions HS-3 — see Host sessions (development) → Transport: SSH hosts) does not use the session profile's paths above; the client owns a per-attempt scratch directory of its own, one per connect attempt rather than one per host, under whichever of the following candidates leaves room for a 103-byte AF_UNIX sun_path:

$TMPDIR/roost-ssh-<host_id>-<pid>-<seq>/     (preferred)
/tmp/roost-ssh-<host_id>-<pid>-<seq>/        (fallback, if $TMPDIR doesn't fit)

<host_id> is the saved host's own id, <pid> the client process's, <seq> a per-process counter — the combination is unique per attempt, so a double Connect, a disconnect racing its own reconnect, or a superseded establish landing late each own a directory nothing else is touching. Each holds a generated ssh_config, the ssh ControlMaster's control socket (ctl), and the local bridge's own listening socket (bridge.sock, 0600, the address a client dials to reach the remote session). The directory (0700) and everything in it are removed on disconnect (ssh -O exit first, then the directory) or reclaimed by the next connect attempt's sweep; a one-shot host add --verify / Add Host dialog probe against an SSH target uses the same candidates under a roost-ssh-verify-<pid>-<nanos>-<n> name instead, which a sweep never mistakes for a host's own leftovers.

ROOST_SSH_BIN overrides the ssh binary these directories' invocations exec (default: ssh on PATH) — see cli.md.

Two single-instance locks

A running UI holds two flocks, because the two things a single instance must own move independently:

  • <socket dir>/roost.lock — the socket/bind lock. Guards the probe→unlink→bind sequence and the bound socket's lifetime. Follows XDG_RUNTIME_DIR for a UI (macOS: ~/Library/Caches/<app_label>/); the session's follows its socket directory.
  • <state dir>/state.lock — the state lock. Guards state.json. Follows ROOST_STATE_DIR / XDG_DATA_HOME.

Neither is legacy. One lock beside the socket let two processes with the same ROOST_STATE_DIR and different runtime dirs both write one state.json; one lock beside state.json would let two processes with different state dirs both bind one socket, the second unlinking the first's. Acquisition order is socket first, then state, and release is the reverse — mixed orders would let two starting processes refuse each other.

The filenames differ on purpose: state_dir can equal the socket's directory (the HOME-less /tmp/<app_label> fallback, or a ROOST_STATE_DIR aimed at the runtime dir), and one shared name would make the two locks one file — flock is per-open-file-description, so the app would contend with itself and refuse to start. When both paths do resolve to one file, acquisition degrades to a single lock.

Contention on the socket lock activates the running window and exits 0. Contention on the state lock refuses to start with a message naming the holder PID and the state lock path: taking the socket lock first proves nothing is listening on our socket, so the holder is on a different runtime dir and there is no window to activate.

Cross-version exclusion holds only when the runtime path agrees — a new binary cannot contend with an older one whose XDG_RUNTIME_DIR differs, because it has no way to discover that path. The session's socket directory no longer depends on XDG_RUNTIME_DIR; there the gap is closed by old-path discovery instead.

No migration from pre-rewrite lowercase paths

Pre-rewrite builds stored their state under lowercase ~/Library/Application Support/roost/ and ~/Library/Caches/roost/. The current builds use capital Roost. There is no auto-migration — state in the lowercase directories is intentionally orphaned, and a pre-rewrite build's SQLite database is not migrated into state.json. Start empty.

Config keys

config.conf is a tiny key = value file (no sections, no nesting). Lines starting with # are comments. Missing file → built-in defaults; unknown keys are ignored, with a warning in the log (Ghostty's own keys stay silent, so a pasted Ghostty config is fine). Keybindings use Ghostty's keybind = trigger=action syntax — see Keybindings for the full action list. The full reference (including the copy-on-select semantics) lives in config.md.

Keys use Ghostty-style hyphens (font-family, not font_family); an unknown key is ignored with a log warning. The warning names the key you likely meant only when the slip is case or _ for - (Font_Size for font-size); any other misspelling, such as font-szie, gets the warning without a suggestion.

Key Default Effect
font-family system monospace (macOS) / JetBrains Mono, Monospace (Linux) Terminal cell font. See Fonts for how each UI resolves it.
font-size 13 (Linux) / 14 (macOS) Points.
theme roost-dark Bundled color theme name. See Themes.
keybind (built-in defaults; see Keybindings) Repeatable. <trigger> = <action>; later lines override.
command (none) Repeatable. A command-launcher entry (Cmd/Alt+Shift+T). See Command launcher below.
copy-on-select true off / true / clipboard. Controls what a mouse-drag selection writes on release. See config.md for per-platform behavior.

Tab-strip pill widths are fixed; see Tab Strip.

An unresolvable font-family degrades to the platform's system monospace rather than failing to launch; Fonts has the per-UI resolution rules.

Example config.conf:

font-family = "JetBrains Mono"
font-size   = 13

# Add a second trigger for new_tab without removing the default Cmd-T.
keybind = super+j = new_tab

# Disable the default rename-project shortcut.
keybind = super+shift+r = unbind

# Command-launcher entries (Cmd/Alt+Shift+T).
command = label="Lazygit" run="lazygit"
command = label="Logs" run="docker compose logs -f" hold=true

Command launcher

Each command = line adds an entry to the command launcher (Cmd-Shift-T / Alt-Shift-T). Activating one spawns a new tab in the active project and runs the command through your login shell. The value is a record of quote-aware key="value" tokens:

Token Required Effect
label yes The text shown in the launcher list.
run yes The shell command to run.
title no The tab title (defaults to label).
hold no hold=true keeps the shell open after the command exits (otherwise the tab closes when it finishes).
env no env="KEY=VALUE" exported before run. Repeat the token for more.

A line missing label or run is skipped (logged, not fatal). The launcher reads the config fresh each time it opens, so edits take effect without a restart.

Environment variables Roost sets

When Roost spawns a tab's shell, it injects the following. The rest of a tab's environment is built per tab, not inherited verbatim: it is the serving process's environment minus DISPLAY, WAYLAND_DISPLAY, DBUS_SESSION_BUS_ADDRESS, SSH_AUTH_SOCK, SSH_CONNECTION, SSH_CLIENT and SSH_TTY, which come only from whoever opened the tab (a desk opener's display, bus and agent; a remote opener's two SSH_* values) — see Tab environment for who that is. SHELL is the passwd shell. (The UI and roost-session.) The variables below are set on top — the user's own values for TERM_PROGRAM_VERSION etc. would be overwritten; ROOST_SHELL_FEATURES is the only one that defers to a pre-existing value (you can opt out of the default features by setting it in your rc — see Feature flags).

XDG_RUNTIME_DIR in a tab

XDG_RUNTIME_DIR belongs to the machine and the user, not to whoever opened the tab. On Linux every tab gets /run/user/<uid> when that is a directory (not a symlink) owned by the process uid, whether a desk opener or a remote one opened it; this keeps systemctl --user and podman working in remote tabs. When it is not, the tab keeps the serving process's own value. It is computed at each spawn, because logind creates and removes the directory at login and logout. macOS has no /run/user and leaves the value alone.

Variable Effect
ROOST_TEST_USER_RUNTIME_DIR An absolute directory standing in for /run/user/<uid>; the same directory-and-owner check applies. Read by debug builds, or any build with ROOST_TEST_MODE=1 (the release e2e lane sets it). An empty or relative value derives nothing, so the tab keeps the process's own XDG_RUNTIME_DIR. The harness sets it to each launched process's own runtime directory so no test tab points at the real /run/user/<uid>.

LANG in a macOS tab

An app started from Finder or the Dock inherits no locale, so on macOS a tab whose LANG, LC_ALL and LC_CTYPE are all unset or empty gets LANG=<language>_<region>.UTF-8 from the system's preferred languages and region (the first preferred language with an installed pair wins), or en_US.UTF-8 when no such pair is an installed locale. A locale already set, even LC_ALL=C, is kept. This applies to the UI's own tabs and roost-session's; Linux tabs keep the locale they inherit.

Terminal advertisement

Variable Value Purpose
TERM xterm-256color Terminfo entry the shell should use. Roost emulates xterm-256color faithfully.
COLORTERM truecolor Signals 24-bit color support to modern TUIs (opencode, neovim, lazygit). Stripped at the SSH boundary unless ssh-env wraps ssh to forward it.
TERM_PROGRAM Roost Lets remote tools detect they're running inside Roost.
TERM_PROGRAM_VERSION bundle short version Same use case; tracks the running Roost build.
FORCE_HYPERLINK 1 Advertises OSC 8 hyperlink support. CLIs that gate on the supports-hyperlinks library (Claude Code, anything on chalk/terminal-link) only allowlist known terminals by TERM_PROGRAM, and Roost isn't one — without this they emit plain text instead of clickable links (e.g. Claude Code's footer PR #N). Roost renders + opens OSC 8 links (Cmd/Ctrl-click), so the override is honest. Forwarded over SSH via ssh-env.

Tab identity + IPC routing

Variable Purpose
ROOST_TAB_ID Integer tab id (used by roostctl to route notifications). Gate any shell-integration extension you write on this.
ROOST_SOCKET Absolute path to the Unix domain socket (roostctl auto-detects it from this).
ROOST_ROOSTCTL Absolute path to the roostctl of the Roost serving the tab; unset when it has none. When that roostctl is in its app bundle, the bundle's Contents/Resources/bin is also put first on the tab's PATH, and a bundle bin an enclosing Roost put there is taken out. See Where roostctl lives.
ROOST_PATH_BIN The app bundle's Contents/Resources/bin that Roost put first on this tab's PATH, set only when the Roost serving the tab found its roostctl in its own bundle, and unset otherwise (an inherited value included). The shell integration's path feature puts it back in front at the first prompt.
ROOST_CLAUDE_PLUGIN_DIR The Claude plugin folder Roost added to CLAUDE_CODE_PLUGIN_DIRS for this tab, and unset when it added none. The shell integration's path feature puts it back if a startup file replaced the list.

Shell integration

Variable Value Purpose
ROOST_SHELL_INTEGRATION 1 Marker that the shell-integration env contract is in effect.
ROOST_SHELL_FEATURES cwd,title,marks,prompt,ssh-env,path* Comma list of features the shipped scripts enable. Prefix any feature with no- to disable it (e.g. cwd,title,marks,prompt,no-ssh-env). See Feature flags.
ROOST_RESOURCES_DIR absolute path Directory holding the shipped shell-integration/ scripts. Source $ROOST_RESOURCES_DIR/shell-integration/roost.bash (or .zsh) to load them manually.

* Default only when ROOST_SHELL_FEATURES is unset in the inherited env; set it in your rc / launch config to override.

Internal bootstrap (don't depend on these)

Roost also sets ZDOTDIR (zsh) and ENV + a few ROOST_BASH_* helpers (bash auto-bootstrap) to inject the shell integration without requiring the user to edit their rc. These are reserved internals — read them if you're debugging Roost's startup, but don't build on them from user code.

ssh-env and the SSH boundary

Without intervention, macOS's default /etc/ssh/ssh_config.d/100-macos.conf only forwards LANG LC_* over ssh — COLORTERM (and TERM_PROGRAM / TERM_PROGRAM_VERSION) silently drop, so modern TUIs on the remote host fall back to 256-color rendering. The ssh-env feature (default on) defines an ssh shell function that adds -o "SendEnv COLORTERM TERM_PROGRAM TERM_PROGRAM_VERSION FORCE_HYPERLINK" to every invocation. The remote host has to accept the forwarded vars (sshd_config::AcceptEnv); Debian/Ubuntu defaults only accept LANG LC_*, so the server-side setting often needs updating too. See Feature flags for the opt-out (no-ssh-env).

Environment variables Roost reads

roostctl reads:

Variable Effect
ROOST_SOCKET Override the socket the CLI dials
ROOST_TAB_ID Default tab id when --tab is not given
ROOST_SSH_BIN Override the ssh binary a host's SSH transport execs (default: ssh on PATH) — see SSH scratch directories above. Read by both roostctl host add --verify and the UI's own tunnel.

roostctl also honours ROOST_BUNDLE_PROFILE=mac|linux|iced (the env form of --target; an unrecognized value is a hard error, not a fallback). --target itself additionally accepts session, but only there — ROOST_BUNDLE_PROFILE does not, and neither knob's absence changes auto-detect, which never probes the session socket (see Session profile above). With no explicit selector it probes every distinct UI socket, chooses the only live one, or names the live candidates when selection is ambiguous. The candidates are the three UI profiles' sockets in mac, linux, iced order, deduplicated by path — so macOS probes three and Linux probes two, where mac and linux collapse onto the same production socket.

Resetting state

To wipe Roost's persistent state and start fresh:

# macOS — Mac profile (Roost.app)
rm "$HOME/Library/Application Support/Roost/state.json"

# macOS — Iced profile (dev Roost-Iced.app, or cargo run -p roost-iced)
rm "$HOME/Library/Application Support/Roost-iced/state.json"

# Linux (uses XDG_DATA_HOME with the spec-default fallback)
rm "${XDG_DATA_HOME:-$HOME/.local/share}/roost/state.json"

# Linux — Iced dev build
rm "${XDG_DATA_HOME:-$HOME/.local/share}/roost-iced/state.json"

state.json is the UI-owned persistent store. Relaunch the UI — it will recreate default state on first run.