AgentKit
DocsKitsCLI ReferenceDesktop App
BetaYou are reading docs for the beta channel (3.4.0-beta.1). Features may change before the next stable release.Switch to stable →

host

ak host status

Sample CPU, memory, disk activity and free space into one verdict

Use ak host status before you start parallel builds, tests, or agents. It is read-only and never reaches the network. When ak host watch is running and its snapshot is under 15 seconds old, the command returns that snapshot at once (source: watcher); --fresh samples now instead. See ak host for what each verdict means.

Command contract

Sample CPU, memory, disk activity and free space into one verdict

Synopsis

Samples the host --samples times, --interval apart, and reports the median CPU busy time, memory use, the busiest physical disk's active time, latency and throughput, and free space on each watched volume. The verdict is the most severe of: hold (disk active >= 90% or latency >= 100 ms, CPU >= 95%, memory >= 95%), clean (a watched volume has less than --min-free-gb free), unknown (no pressure metric could be sampled), throttle (disk >= 70% or >= 50 ms, CPU >= 85%, memory >= 88%) and go. A metric that cannot be sampled is null with a reason, never guessed. Watched volumes default to the working directory, home, the temp directory and, on Windows, every fixed drive; --path replaces that list. Inside WSL the disk scope is wsl-guest (the guest's virtual disk, not the Windows host). macOS reports disk throughput only, so its disk scope is unavailable.

When ak host watch is running and its snapshot (snapshot_path, <AgentKit home>/host/status.json) is under 15 s old, status returns it at once (source watcher) unless --fresh, --caches, --path or --min-free-gb asks for something it does not carry; otherwise it samples (source sampled). top_io lists the five processes moving the most I/O with their worktree and agent runtime; it is null with a reason where the OS does not expose per-process I/O (macOS without cgo). On Windows its rates count all I/O, network and pipe transfers included, and io_scope says so. inbox is the watcher's notice for the current worktree, shown without being consumed. --write-cache also writes the envelope to a file of your choice.

Effects: Read-only. Reads OS performance counters, the process table and free space, and the watcher snapshot and inbox when present; never reaches the network. Removes only inbox entries older than 10 minutes. Windows uses PDH and kernel32, Linux reads /proc, macOS runs iostat and vm_stat. --caches walks the Go build, Go module, golangci-lint, pnpm and npm caches without following symlinks and may run go env to locate them. Apart from that pruning, the only write is the optional --write-cache file, replaced atomically.

Exit status: 0 success; read the verdict from the output (every verdict exits 0) 1 command failure, including an unwritable --write-cache file 2 invalid flags or arguments

ak host status [flags]

Examples

  ak host status
  ak host status --json
  ak host status --caches --samples 5 --interval 500ms --min-free-gb 50
  ak host status --json --write-cache /tmp/agentkit-host-status.json

Options

      --caches               Also report the size of known build and package caches
      --fresh                Sample now even when the watcher's snapshot is fresh
  -h, --help                 help for status
      --interval duration    Length of each sampling interval (100ms-1m) (default 1s)
      --json                 Emit machine-readable JSON (implies --no-interactive)
      --min-free-gb float    Free space in GB below which the verdict is clean (default 25)
      --no-interactive       Disable interactive prompts (CI-safe)
      --path stringArray     Volume to watch for free space (repeatable; replaces the defaults)
  -q, --quiet                Suppress non-error output on stderr
      --samples int          Number of sampling intervals (1-60) (default 3)
  -V, --verbose              Extra diagnostic output on stderr (loses to --quiet)
      --write-cache string   Also write the JSON envelope atomically to this file
  -y, --yes                  Assume yes for all prompts

SEE ALSO

  • ak host - Inspect host pressure before starting parallel work