← Back to What's New

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 stop

Configuration

Add to ~/.sessioncast.yml or use sessioncast config set:

daemon:
  capacity: 5
  worktree:
    enabled: true
    baseDir: ~/projects

Or via CLI:

sessioncast config set daemon.capacity 5
sessioncast config set daemon.worktree.enabled true

How It Works

  1. daemon start spawns a background process and writes a PID file to ~/.sessioncast/daemon.pid
  2. The daemon scans tmux sessions and streams them to the relay — just like sessioncast agent
  3. When capacity is reached, new session creation requests are rejected
  4. With worktree mode enabled, each new session gets its own git worktree for isolation
  5. daemon stop sends SIGTERM, waits for graceful shutdown, then removes the PID file

Compared to Claude Code Remote

FeatureClaude RemoteSessionCast Daemon
Max sessions32Configurable
AI toolsClaude onlyAny (Claude, Codex, Ollama, ...)
Worktree isolationBuilt-inBuilt-in
Background modeYesYes
Capacity controlFixed--capacity N
PID managementInternal~/.sessioncast/daemon.pid

Update

sessioncast update

Requires CLI v0.1.20 or later.

Loading...