I'm no expert on the code, but vacuum comes up a lot when grepping the source. For example, it looks like it always runs vacuum after a remote clone (clone_cmd in
https://www.fossil-scm.org/xfer/file?name=src/clone.c&ci=tip) and after importing from another SCM (import_cmd in
https://www.fossil-scm.org/xfer/file?name=src/import.c&ci=ti...).