Skip to main content

The daemon

rt runs a small background daemon that keeps a few things warm so interactive commands feel instant instead of shelling out to GitHub, GitLab, and git on every keystroke.

What it does today

The daemon is a long-lived process (managed by launchd) that:

  • Caches MR/branch data. It refreshes the branch and merge-request cache for every registered repo roughly every 5 minutes, and can be nudged to refresh sooner. Commands like rt status read this cache instead of re-fetching from GitLab/Linear on every invocation.
  • Scans ports. It scans listening ports roughly every 30 seconds, so rt port can show you what's running across your repos with zero configuration.
  • Guards git hooks. For repos where rt manages hooks, it watches each repo's .git/config and re-applies rt's hooks shim path if something else (another tool running git config) clobbers it.
  • Answers status polls. CLI commands and the tray app both query the daemon over a local Unix socket (and a REST/WebSocket API) for cached data and health.
  • Kills a worktree's workload on park. When you park a worktree (its feature is done), the daemon finds the dev servers, watchers, and compilers rooted in that worktree, SIGTERMs them, and escalates any survivor to SIGKILL after about 5 seconds. It deliberately spares AI agent sessions (Claude, Codex, and the like) and everything they spawned, plus shells and .app bundle processes, since those aren't workload.
  • Scans for and notifies on runaway processes. Roughly every 10 seconds it scans system processes for anything rooted in a tracked repo, tracks a rolling CPU sample window per process, and notifies once a process has sustained high CPU for long enough (5 minutes above 80% by default, after a 2-minute grace period). AI agent sessions are excluded from this too.

The tray app (menu-bar icon) shows the daemon's health at a glance, polling its status so you can tell at a look whether it's up.

It does not run or supervise your dev servers for you the way the old managed-process feature did, and it does not provide tunnels: there's no "start this script and keep it alive" concept. The process-related behaviors above are reactive (park-time cleanup) and observational (runaway detection), not a general-purpose process supervisor.

Installing, starting, and stopping

rt daemon install # install and start the daemon (launchd or background process)
rt daemon uninstall # stop and remove the daemon
rt daemon start # start the daemon
rt daemon stop # stop the daemon
rt daemon restart # restart the daemon

rt verify (the command recommended after a fresh install) also completes daemon setup transparently on first run, so you rarely need to run rt daemon install yourself.

Checking health and logs

rt daemon status # pid, uptime, cached repos, cached ports
rt daemon logs # open the log viewer

rt daemon status reports basic liveness: pid, uptime, how many repos are watched, how many cache entries and ports are cached, and how stale the port cache is.

rt daemon logs opens a browser-based log viewer by default; pass --terminal (or -t) for a live tail in your terminal instead. All daemon (and other rt surface) logs live under ~/.rt/logs/; see the logging guide for the file convention and how the viewer discovers them.

See the full command reference: rt daemon, rt daemon status, rt daemon logs, rt daemon install, rt daemon start, rt daemon stop, rt daemon restart, and rt daemon uninstall.