Daemon Mode — Run SessionCast as a Background Service
SessionCast CLI now supports daemon mode — run the agent as a background service with capacity limiting and automatic worktree isolation.
Why Daemon Mode?
Previously, sessioncast agent ran in the foreground. Close the terminal, and the agent dies. Daemon mode solves this:
- Background execution — survives terminal closure
- Capacity limiting — control how many sessions can run simultaneously
- Worktree auto-creation — each session gets an isolated git worktree
- PID file management — clean start/stop lifecycle
This is SessionCast's answer to Claude Code's remote server mode — but tool-agnostic. Works with Claude Code, Codex CLI, Gemini CLI, Ollama, or any terminal tool.
Quick Start
# Start daemon with capacity limit
sessioncast daemon start --capacity 5
# Check status
sessioncast daemon status
# View logs
sessioncast daemon logs
# Stop daemon
sessioncast daemon stopConfiguration
Add to ~/.sessioncast.yml or use sessioncast config set:
daemon:
capacity: 5
worktree:
enabled: true
baseDir: ~/projectsOr via CLI:
sessioncast config set daemon.capacity 5
sessioncast config set daemon.worktree.enabled trueHow It Works
daemon startspawns a background process and writes a PID file to~/.sessioncast/daemon.pid- The daemon scans tmux sessions and streams them to the relay — just like
sessioncast agent - When capacity is reached, new session creation requests are rejected
- With worktree mode enabled, each new session gets its own git worktree for isolation
daemon stopsends SIGTERM, waits for graceful shutdown, then removes the PID file
Compared to Claude Code Remote
| Feature | Claude Remote | SessionCast Daemon |
|---|---|---|
| Max sessions | 32 | Configurable |
| AI tools | Claude only | Any (Claude, Codex, Ollama, ...) |
| Worktree isolation | Built-in | Built-in |
| Background mode | Yes | Yes |
| Capacity control | Fixed | --capacity N |
| PID management | Internal | ~/.sessioncast/daemon.pid |
Update
sessioncast updateRequires CLI v0.1.20 or later.