Skip to content

Daemon and queue

The commands that watch the daemon's events live, control the queue and start or stop the daemon itself.

7 min read8 pages in CLI reference

The daemon is the background process that does the actual work. It keeps the queue, starts jobs when your machine has room for them and runs the agents. You rarely start it yourself: any command that needs it starts it on demand. The commands on this page let you watch what it is doing, steer its queue and stop it.

The daemon only listens on 127.0.0.1, on a random port, and only accepts requests that carry the token from $ASTRANIZE_HOME/daemon.json, a file only you can read. Queue and capacity explains how it decides what to run next.

Command Needs --workspace What it is for
events yes Watch the daemon’s events for a workspace, live.
queue yes See the queue, pause it, limit it or empty it.
daemon no Run the daemon in the foreground, or stop it.

events streams everything the daemon does for a workspace, as JSON lines, until you press Ctrl+C. It is the easiest way to watch tasks move without opening the app.

Terminal window
astranize events --workspace notes

The first line is always the current queue. Events follow as they happen:

{"type":"queue_updated","queue":{"paused":false,"maxRunning":null,"memoryFloorBytes":2147483648,"running":[],"queued":[],"room":4,"machine":{"memoryAvailableBytes":9680142336,"memoryTotalBytes":34359738368,"cpuLoad":0.508,"dockerMemoryBytes":3912546385.92},"pendingUpdate":false}}
{"type":"task_updated","task":{"id":"t-0004","title":"Sort notes","status":"backlog",…}}
{"type":"queue_updated","queue":{…,"room":3,…}}

Here a task was created, then the queue changed: there is room for 3 more jobs instead of 4.

Flag Type Default Effect
--once switch off Stop when the stream ends, for example when the daemon restarts. Without it, the CLI reconnects and keeps streaming.
--machine machine key this machine Stream a paired machine’s events instead. See Fleet.

A few things to know about the stream:

  • queue_updated comes every few seconds with fresh machine load, and every time the queue changes.
  • Events of a mission run carry an extra "mission":"<name>" field, and their taskId is the run id, such as r-0001.
  • When this daemon has paired machines, the stream also carries one machine_status line per machine at the start, a machine_status line on every change and a machine_event line for each of their events. These lines are not filtered by workspace.
  • Only writes that go through the daemon show up. Local commands such as instruct or video-caught do not.

Every event type is described in Events.

queue prints the queue: what is running, what is waiting and why. Its actions pause the queue, cap how many jobs run at once, stop everything or restart the daemon.

Terminal window
astranize queue --workspace notes
{"type":"queue","queue":{"paused":false,"maxRunning":null,"memoryFloorBytes":2147483648,"running":[{"workspace":"notes","taskId":"t-0004","command":"ideate","startedAt":"2026-11-20T02:47:50.765Z","waiting":null}],"queued":[],"room":1,"machine":{"memoryAvailableBytes":5404360704,"memoryTotalBytes":34359738368,"cpuLoad":1.76,"dockerMemoryBytes":3904021463.04},"pendingUpdate":false}}

One ideator is running, nothing is waiting, and there is room for one more job. The queue is shared by the whole machine, so it lists jobs of every workspace.

Each action prints the queue as it is afterwards, except restart-now:

Terminal window
astranize queue pause --workspace notes
astranize queue resume --workspace notes
astranize queue limit <n|off> --workspace notes
astranize queue stop-all --workspace notes
astranize queue restart-now --workspace notes
Action Effect Saved in
(none) Print the queue.
pause Start nothing new. Running jobs keep going. queue.json
resume Start jobs again. queue.json
limit <n> Run at most n jobs at once, on top of the memory check. n is a whole number, 1 or more. settings.yaml, max_running
limit off Remove the limit. settings.yaml
stop-all Stop every running and queued job, like stop on each one.
restart-now Restart the daemon now, without waiting for running jobs. Interrupted tasks are picked up again when it comes back.

restart-now prints {"type":"daemon","status":"restarting"}.

Error Cause
Unknown queue action "flush": use pause, resume, limit, stop-all or restart-now Any other action.
queue limit takes a whole number of tasks (1 or more) or "off" limit 0, limit 1.5, or no value.

With --machine, only queue, queue pause and queue resume are accepted. The others fail with queue on another machine takes pause or resume.

Field Type Meaning
paused boolean Set by queue pause.
maxRunning number or null Set by queue limit.
memoryFloorBytes number Memory always kept free. memory_floor_gb in settings.yaml, 2 GB by default.
running[] list { workspace, taskId, mission?, command, startedAt, waiting }. command is ideate or run. waiting says why the job is waiting inside a step, for example for the video slot, or is null.
queued[] list { workspace, taskId, mission?, command, position, reason, reasonKind, enqueuedAt }.
room number or null How many more jobs fit right now.
machine object or null { memoryAvailableBytes, memoryTotalBytes, cpuLoad, dockerMemoryBytes }. dockerMemoryBytes is null without Docker.
pendingUpdate boolean A newer engine is waiting for the running jobs to finish before the daemon restarts.

Each queued job says why it has not started yet. reasonKind is the short form, and reason is the same thing in words, in the language from settings.json:

reasonKind Example reason
paused Queue paused
update Update pending: waiting for the running tasks to finish
memory Waiting for memory: 2.2 GB free, this step uses about 0.5 GB, or Waiting for t-0002, which is ahead in the queue
limit Waiting for a place: the limit is 2 tasks at a time
slot Waiting for the video slot (t-0002 is recording) or Waiting for the e2e slot (t-0002 is using it)
port Waiting for port 5432, which t-0002 is using
provider Claude limit: 92% of the week, 15% kept in reserve. Resumes when it resets, Mon 00:00
spare Reserved. You do not see it today.

daemon runs the daemon in your terminal instead of in the background, which is handy when you want to see it start and stop. daemon stop asks a running daemon to shut down.

Terminal window
astranize daemon

The daemon writes its pid, port, token, start time and version to daemon.json, then runs until it is stopped. It prints one line when it ends:

{"type":"daemon","status":"stopped"}
status When
already_running Another daemon is already running. The new one exits at once, with code 0.
stopped It was stopped by SIGINT, SIGTERM or daemon stop.
restart It is restarting, for a newer engine or after queue restart-now. It starts its replacement in the background before it exits.

To stop it from another terminal:

Terminal window
astranize daemon stop
{"type":"daemon","status":"stopping","pid":27252}

The command returns at once. When no daemon is running, you get {"type":"daemon","status":"not_running"} instead.

There is no daemon restart: any other action fails with Unknown daemon action "restart": use "daemon" or "daemon stop". To restart, use queue restart-now.

  • It starts on demand. A command that needs the daemon and finds none starts node <cli> daemon in the background, with the same environment, and waits up to 15 seconds for it.
  • It updates itself. Every request carries the CLI’s version. When the CLI is newer, the daemon lets its running jobs finish and then restarts, with pendingUpdate set to true meanwhile. The CLI keeps retrying until the new daemon answers.
  • It cleans up when it stops. It kills the processes it started and removes daemon.json. Unexpected crashes are added to $ASTRANIZE_HOME/daemon.log.
  • It recovers when it starts. It reads queue.json and daemon-processes.json, kills processes a previous daemon left behind and puts interrupted tasks back on the queue.