Watchfire
Components

Daemon (watchfired)

The Watchfire daemon is the backend brain — managing projects, spawning agents, handling git workflows, and serving clients over gRPC.

Daemon (watchfired)

The daemon is the backend brain of Watchfire. It manages multiple projects simultaneously, watches for file changes, spawns coding agents in sandboxed PTYs with terminal emulation, handles git worktree workflows, and serves state to thin clients over gRPC.

Lifecycle

AspectBehavior
DevelopmentRun watchfired --foreground for hot reload (tray still active)
ProductionRuns in background, started automatically by CLI/TUI/GUI if not running
PersistenceStays running when thin clients close
ShutdownCtrl+C (foreground), CLI command, or system tray quit

The daemon starts automatically when you run any watchfire command. It persists in the background even after the CLI/TUI exits, so agent sessions keep running.

Network

AspectDecision
ProtocolgRPC + gRPC-Web (multiplexed on same port)
PortDynamic allocation (OS assigns free port)
DiscoveryConnection info written to ~/.watchfire/daemon.yaml
ClientsCLI/TUI use native gRPC, GUI uses gRPC-Web

Multi-Project Management

AspectBehavior
Projects index~/.watchfire/projects.yaml lists all registered projects
RegistrationProjects added via CLI (watchfire init) or GUI
ConcurrencyOne active task per project, multiple projects in parallel
Client trackingTracks which clients are watching which projects
Task cancellationTask stops only when ALL clients for that project disconnect

File Watching

The daemon uses fsnotify to watch for changes:

AspectBehavior
Mechanismfsnotify with debouncing
RobustnessHandles create-then-rename pattern (common with AI tools)
Per-project.watchfire/project.yaml, .watchfire/tasks/*.yaml
Polling fallback5s polling as safety net for missed watcher events
Re-watch on chainRe-watches directories created during earlier phases

Task Lifecycle

The daemon manages the reactive task lifecycle:

1. Client calls StartTask(task_id)
2. Daemon creates git worktree for task
3. Daemon spawns coding agent in sandboxed PTY (inside worktree)
4. Daemon streams screen buffer to subscribed clients
5. Agent updates task file when done (status: done)
6. Daemon detects via fsnotify OR polling fallback (5s)
7. Daemon kills agent (if still running)
8. Daemon processes git rules (merge, delete worktree)
9. Daemon starts next task (if queued and merge succeeded)

Phase Completion Signals

The daemon detects phase completion via signal files:

PhaseSignal FileDaemon Response
TaskTask YAML status: doneStop agent, merge worktree, start next
Refine.watchfire/refine_done.yamlStop agent, start next phase
Generate.watchfire/generate_done.yamlCheck for new tasks or end wildfire
Generate Definition.watchfire/definition_done.yamlStop agent (single-shot)
Generate Tasks.watchfire/tasks_done.yamlStop agent (single-shot)

System Tray

The daemon runs a system tray icon with a menu:

Menu ItemContent
Status header"Watchfire Daemon"
Port"Running on port: port"
Running agentsList with project name
Open GUILaunches Electron GUI
QuitShuts down daemon

Daemon Commands

# Start the daemon (no-op if already running)
watchfire daemon start

# Show daemon status
watchfire daemon status

# Stop the daemon
watchfire daemon stop

On this page