Daemon Architecture
graphd is what makes the graph warm. Instead of rebuilding on every query, it
holds the graph in memory, watches the tree, and folds in changes as they happen.
Lifecycle
start ──> build initial graph ──> serve + watch ──┐
^ │ edits: incremental fold-in
└──────────┘ branch switch: full rescan
│
idle-timeout / shutdown ──┴──> re-persist to cgraph-out/ ──> exitStartup
Launch the daemon against a project root:
graphd --root /path/to/projectOn first run it builds the initial graph (seconds for a typical tree), then begins serving operations and watching the tree.
Watching
While running, the daemon watches the project and folds source edits into the
graph incrementally — usually within a couple of seconds. A large batch, such as
a branch switch, collapses into a single full rescan rather than thousands of
tiny updates. Pass --no-watch to disable watching; updates then happen only via
explicit update operations. See Incremental Updates
for the details.
Flags
| Flag | Meaning |
|---|---|
--root | Project tree to index and watch. |
--idle-timeout | Shut down after this many idle seconds. |
--no-watch | Don't watch the tree; update only on explicit ops. |
The default --idle-timeout value is not stated in the public README and is
left pending rather than guessed.
Persistence and shutdown
Incremental state is re-persisted to cgraph-out/ in the background and on
shutdown, so restarting the daemon resumes from the last graph instead of a cold
rebuild. Shut it down explicitly with the client:
cgraph-client shutdown