Automation

After the first subnet setup, keep the graph fresh without running commands by hand. Three mechanisms, smallest to largest blast radius: a watch daemon, a Cursor hook, and a daily scheduled job. All route through subnet update, which holds a lock so they never overlap.

contents

The update command

subnet update [path]        # one project, or all registered if omitted
  --fast                    # lean: transcript-only
  --deep                    # all files + legacy enrich (incremental windows)
  --full                    # deep + reprocess every window
  --global                  # also rebuild the cross-project dashboard
  --no-dashboard            # skip dashboard rebuild
  --verify                  # run the verifier pass after ingest
  -y, --yes                 # non-interactive

Profiles trade speed for depth. --fast (lean) only ingests transcripts. The default standard profile runs tier-1 file analyze and fused enrich (two flash calls). --deep analyzes all pending files and runs the legacy eight-agent enrich stack. --full adds re-triage of every window — use after a model change.

Concurrent invocations are serialized through ~/.substrate-net/update.lock; a second update exits rather than racing the first.

Watch daemon

subnet watch                       # background daemon, all registered projects
subnet watch --foreground          # run inline (logs to stdout)
subnet watch --projects /a,/b      # limit scope
subnet watch --interval 120000     # debounce window (ms, default 60s)
subnet watch --global              # rebuild global dashboard after each drain
subnet watch --stop                # stop the running daemon

The daemon watches each project's source tree plus your transcript roots (Cursor / Claude Code / Codex). File changes enqueue the affected project; a transcript change enqueues every watched project. After the debounce window settles, queued projects run a serial update --fast.

Cursor hook

Refresh the graph the moment a Cursor conversation ends. The hook fires on the stop event and kicks a detached subnet update --fast --yes, so it never delays the agent.

mkdir -p ~/.cursor/hooks
cp templates/cursor-hooks/subnet-update.sh ~/.cursor/hooks/
chmod +x ~/.cursor/hooks/subnet-update.sh
# merge templates/cursor-hooks/hooks.json into ~/.cursor/hooks.json

Requires subnet on $PATH (via npm link or a global install). Output is appended to ~/.substrate-net/hook-update.log.

launchd / cron

For a nightly full refresh (heavy agents + cross-project links + the re-synthesized L6 wisdom layer + global dashboard), schedule subnet update --global --yes.

macOS (launchd):

cp templates/automation/com.substrate-net.update.plist ~/Library/LaunchAgents/
# edit the subnet path inside (use `which subnet`)
launchctl load ~/Library/LaunchAgents/com.substrate-net.update.plist

Linux (cron):

crontab -e
# paste, adjusting the subnet path:
0 2 * * *  /usr/local/bin/subnet update --global --yes >> "$HOME/.substrate-net/cron-update.log" 2>&1

Recommended layering: a Cursor hook for instant freshness on the project you are actively working in, plus a nightly cron/launchd job for a full cross-project rebuild. The watch daemon is an alternative to the hook when you work outside Cursor.