Skip to main content
graph keeps its runtime state in one directory, ~/.local/share/graph by default. Set settings.data_dir to move it. graph creates the directory the first time it needs it.

Layout

Every file is plain JSON or JSONL, so cat and jq can read it. Thread IDs are 12 hex characters. In a shape file name, any character other than a letter, digit, _, . or - is percent-encoded.

Share a directory between processes

Several graph processes can use one data directory at the same time. Whole files are written to a temporary file and renamed into place, so a reader never sees a partial write. Appends to a thread are serialized by its lock file. When two processes record the same tool shape, the last write wins. Keep the directory on a local filesystem. File locks aren’t reliable on network filesystems such as NFS.

Back up and reset

  • To back up your state, copy the directory.
  • To discard learned shapes, delete shapes/. graph records them again as tools run.
  • To delete a thread, use graph thread rm.