Skip to content

Worktrees & Daemons

Squeal is built for multi-worktree, parallel-agent workflows.

  • Each Git worktree runs its own lightweight background daemon, writing logs to <git-common-dir>/squeal/logs/daemon-<worktree-id>.log (rotated at 4 MiB, ~8 MiB retained).
  • All worktrees of a repository share one content-keyed store under <git-common-dir>/squeal/.
  • When worktree B has identical file inputs to a test file that worktree A already validated, Squeal inherits that result immediately — squeal status --full reports exactly how many current results were inherited and from which worktree and commit.
  • A daemon idles out automatically after daemon.idleExitMinutes (default 60) with no registered session, and closes idle runner processes after runner.hostIdleMinutes to free RAM.

Inspect all running daemons and runner hosts (local or remote):

Terminal window
squeal ps

Before deleting a worktree, stop its daemon so no background runner process holds open file handles in the directory:

Terminal window
squeal stop <worktree-path>

squeal stop cancels in-flight runs, terminates the daemon and every child process it spawned, and exits 0 once nothing remains.

To keep a daemon stopped across subsequent edits and Git operations until you explicitly start it again:

Terminal window
squeal stop --until-start

Holding a new worktree before an agent starts

Section titled “Holding a new worktree before an agent starts”

Orchestrators creating worktrees for worker agents (where validation should stay paused until ready) should follow this exact order:

  1. Create the worktree (git worktree add <child-root>).
  2. Run squeal stop --until-start <child-root> (verify exit 0 and empty stderr).
  3. Optionally verify with squeal status --json in the child root (daemon.stopped and daemon.untilStart are true).
  4. Start the agent session — hooks will not start a daemon while held.
  5. Release the hold when ready with squeal start <child-root>.

When you need to run a heavy manual gate or browser reproduction without Squeal competing for CPU or shared test fixtures (like a globalSetup lease), use squeal hold instead of squeal stop:

Terminal window
squeal hold -- pnpm run e2e

squeal hold cancels interruptible Vitest runs, closes the slow-tier Vitest instance (triggering globalSetup teardown), keeps recording file edits as revisions, and automatically resumes queued validation once your command exits (capped by --max, default 3h).