Watchfire
Concepts

Architecture

Understand Watchfire's architecture — a daemon orchestrates coding agents while thin clients connect over gRPC.

Architecture

Watchfire follows a daemon + thin client architecture. A single daemon process (watchfired) manages all orchestration, while lightweight clients (CLI/TUI and GUI) connect over gRPC to display state and accept user input.

Components

ComponentBinaryRoleTech
DaemonwatchfiredOrchestration, PTY management, terminal emulation, git workflows, gRPC server, system trayGo
CLI/TUIwatchfireCLI commands + TUI mode. Project-scoped thin clientGo + Bubbletea
GUIWatchfire.appMulti-project thin client (shows all projects)Electron

Data Flow

The daemon is the single source of truth. Clients are stateless views that subscribe to updates.

PTY and Terminal Emulation

Watchfire uses a real PTY (pseudo-terminal) to run coding agents, with terminal emulation to parse escape codes:

The screen buffer is a 2D grid of cells, each with character, foreground/background color, and style attributes (bold, italic, underline, inverse). The cursor position is also tracked.

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

File Watching

The daemon uses fsnotify to watch for changes to task files:

AspectBehavior
Mechanismfsnotify with debouncing
Global watched~/.watchfire/projects.yaml
Per-project watched.watchfire/project.yaml, .watchfire/tasks/*.yaml
RobustnessHandles create-then-rename pattern (common with AI tools)
Re-watch on chainWhen agents chain (wildfire/start-all), re-watches to pick up new directories
Polling fallbackTask-mode agents poll task YAML every 5s as safety net
ReactionFile changes trigger real-time updates to connected clients

Crash Recovery

ScenarioBehavior
Daemon crashes mid-taskOn restart, user must manually restart task
Agent crashesDaemon detects PTY exit, stops task

Directory Structures

Global (~/.watchfire/)

~/.watchfire/
├── daemon.yaml         # Connection info (host, port, PID)
├── agents.yaml         # Running agents state
├── projects.yaml       # Projects index
├── settings.yaml       # Global settings
├── installation_id     # Stable UUID for analytics
└── logs/               # Session logs
    └── <project_id>/
        └── <task_number>-<session>-<timestamp>.log

Per-Project (<project>/.watchfire/)

<project>/
├── .watchfire/
│   ├── project.yaml    # Project configuration
│   ├── tasks/          # Task YAML files
│   │   ├── 0001.yaml
│   │   ├── 0002.yaml
│   │   └── ...
│   ├── secrets/        # Secrets and setup instructions
│   │   └── instructions.md
│   └── worktrees/      # Git worktrees (one per active task)
│       └── <task_number>/
└── <project files>

On this page