Ralph is Squad’s automated triage and execution loop. It runs as a background process, polls your GitHub repository for issues, builds a rich context snapshot for each work item, and hands off to agents — keeping the human team responsive without requiring manual triage every time a new issue arrives. WithDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/bradygaster/squad/llms.txt
Use this file to discover all available pages before exploring further.
--execute, Ralph goes further: it dispatches live Copilot sessions to work on actionable issues and monitors their progress.
Quick Start
All Flags
| Flag | Type | Description |
|---|---|---|
--execute | boolean | Enable agent execution — spawn Copilot sessions for actionable issues |
--interval <N> | number | Poll every N minutes (default: 10) |
--agent-cmd | string | Custom agent command (default: gh copilot) |
--copilot-flags | string | Flags forwarded to the agent runner (e.g. --yolo --autopilot) |
--auth-user | string | GitHub or Azure DevOps account to use for agent auth |
--log-file <path> | string | Mirror all output to a file with timestamps for later review |
--verbose | boolean | Show extra diagnostic output (auth probes, callbacks, git pulls) |
--health | boolean | Print running watch status (PID, uptime, next poll) and exit |
--max-concurrent <N> | number | Maximum number of issues being worked in parallel (default: 1) |
--timeout <N> | number | Maximum minutes to spend on a single issue before giving up (default: 30) |
--dispatch-mode | string | Execution strategy: task, fleet, or hybrid |
--overnight-start HH:MM | string | Pause watch at this time each day (e.g. 18:00) |
--overnight-end HH:MM | string | Resume watch at this time (e.g. 08:00) |
--notify-level | string | Output verbosity: all, important, or none (default: important) |
--state-backend | string | Persistence strategy: local, orphan, two-layer, or external (default: in-memory) |
How Ralph Decides What to Execute
Ralph uses an agent-delegated selection pattern. Rather than choosing which issue to work on itself, Ralph provides a fully assembled context snapshot to the agent and lets the agent decide under the team’s routing rules, review gates, and escalation policy.Ralph calls the GitHub API to find issues that are unassigned, carry the right labels, and haven’t been recently touched. It filters against your team’s routing rules in
.squad/routing.md.Ralph assembles a structured work context document: the prioritized issue list, relevant squad state from
.squad/, recent decisions from decisions.md, and any blocking signals from prior rounds.The snapshot is written to a temporary file. Ralph invokes the agent with the path to that file using the
-p <path> flag:The agent reads the context, evaluates all available issues against the squad’s rules, and selects the one to work on — along with how to approach it. The agent is aware of escalation criteria and can decline to execute if something is too risky.
Issue Selection Scaffold
Ralph provides agents with a structured work context prompt. Here is the scaffold Ralph sends:4-Tier Error Recovery
Watch includes a tiered remediation strategy that prevents Ralph from repeatedly hammering the same failure. When an execution fails, Ralph escalates through the tiers in order:Clear the execution state for the affected issue and retry from scratch. Most transient failures (network blips, rate limits) resolve here.
Re-verify GitHub credentials before continuing. If the auth token has expired or the account has been de-authorized, this tier surfaces it with a clear message.
Pull the latest remote state and retry. Useful when the local repo has fallen behind
origin/main and the agent is making decisions on stale context.State Backends
By default, Ralph keeps its state in memory — cheap and simple, but lost on restart. For long-running overnight automation, choose a durable backend:| Backend | Durability | Branching impact | Best for |
|---|---|---|---|
| In-memory (default) | Lost on restart | None | Short sessions, CI |
local | Survives restarts | None | Overnight automation |
orphan | Survives restarts | Creates a dedicated state branch | Audit trails |
two-layer | Survives restarts | Creates a dedicated state branch | Redundancy |
See State Backends for in-depth configuration, migration instructions, and guidance on choosing the right backend for your team.
Graceful Shutdown
To stop a running watch process cleanly — letting it finish the current round before exiting — create a sentinel file:0. This is preferable to Ctrl+C when execution is running, because it avoids leaving orphaned agent processes.
Monitoring a Running Instance
Check on a running watch process without interrupting it:--health flag reads the persisted state from disk and exits immediately — it does not connect to a running process via IPC.
Overnight Scheduling
Run Watch unattended during business hours and pause it automatically overnight:--overnight-start, Ralph finishes the current round, logs that it is entering the overnight pause window, and sleeps. When --overnight-end arrives, Ralph resumes the polling loop automatically without any human intervention.
Times are interpreted in the system’s local timezone. For servers running in UTC, adjust your
HH:MM values accordingly.Automatic Cleanup
Ralph prunes stale artifacts automatically during each round:- Scratch directories older than 7 days are deleted
- Log files older than 30 days are archived and removed
- Orphaned orchestration state (from sessions that never completed) is pruned
.squad/ directory lean even after weeks of continuous operation. Use --dry-run on squad nap to preview what cleanup would remove across your entire squad state.