for agents/docs/llms.txtv0.6.83 · 7 Oct 2026

Docs / Guides

Agents sharing one vault

For a team of agents that keep one vault between them: several of them cloning, committing and pushing at the same time, each many times a day, with a vault that has grown to hundreds of commits. Everything on this page was worked out on exactly that setup, a shared CRM vault maintained by around ten agents, and the numbers are from it.

For sgit-ai 0.18.0 or newer. The practices here depend on behaviour that older versions do not have; check with sgit version, upgrade with sgit update (what changed).

The loop

Each agent, each session:

$ sgit clone --path mail/<my-account> --depth 1 <vault-key> workspace   # once per session, 5 to 15 s
$ cd workspace
# … read and write files inside mail/<my-account>/ …
$ sgit status                       # what changed, and whether the remote moved
$ sgit commit -m "what I did"
$ sgit push                         # pulls first, merges, uploads only what is new

Why each line is the way it is:

Clone scoped and shallow. An agent that works in one folder has no use for the other agents' folders or for months of history. On the example vault the full clone is 80 s and 173 MB; one folder with one commit of history is 14 s and 3 MB, two small folders are 5 s. Agent harnesses often give a command two or three minutes; a full clone of a growing vault crosses that eventually, a scoped clone does not. Details and limits: Partial clones.

Keep the clone for the session, not forever. A clone directory is cheap to make. An agent that resumes an old clone starts with a stale working copy and an old sgit; a fresh clone starts current.

sgit status before you commit. It says what the remote has done since you cloned, with real numbers:

On branch: branch-clone-… → branch-named-…
  Remote: remote has 3 new commits — run: sgit pull

50+ means more than status fetched to count; it is a lower bound, not a guess. Before 0.18.0 this line could say your fresh clone was hundreds of commits ahead when it was one commit behind. That is fixed.

sgit push pulls first. It merges what others pushed, then uploads. Only new objects go up: your commit, the folders on the way down to your change, and the changed files.

What happens to work you have not committed

This is the behaviour the team most needed and the one that changed in 0.18.0. A pull used to write the whole incoming tree over the working copy, so an edit you had not committed yet was replaced by the committed version, even when the incoming commits never touched that file, and sgit status then reported the vault in sync. Three agents reported losing work that way in one week.

A pull now follows git's rules, and decides before it writes anything:

Your working copyThe incoming commitsResult
changed threads/today.md, not committeddid not touch itkept; pull reports Kept 1 uncommitted change(s) the incoming commits did not touch
changed threads/today.md, not committedchanged it toopull refused, nothing written
deleted old.md, not committeddid not touch itstays deleted
deleted old.md, not committedchanged itpull refused
created new.md, not trackedcreated new.md with the same bytesfine
created new.md, not trackedcreated new.md with different bytespull refused
created scratch.md, not trackednothingleft alone

A refused pull looks like this and has changed nothing, on disk or in the store:

$ sgit push
error: your local changes would be overwritten by pull:
  mail/crm.example/threads/today.md  (your uncommitted edit would be overwritten)
commit them (sgit commit) or stash them (sgit vault stash) and pull again; nothing was changed

Do what it says: sgit commit, then push again; the merge happens on committed work, where a conflict is visible and resolvable (sgit resolve). An agent should treat this message as a normal outcome, not an error to retry.

"Changed" is measured the way sgit status measures it, by content rather than timestamps, so the two never disagree.

Re-run by this site on 7 October 2026 on a throwaway vault with sgit-ai 0.18.0: a scoped clone with an uncommitted edit pulled a teammate's commit to another folder and kept the edit; a full clone with an uncommitted edit to a file the incoming commit changed was refused by name, and the file was untouched afterwards. sgit status on both read remote has 1 new commit.

Staying out of each other's way

When something is slow or fails

A session, end to end

$ sgit update && sgit version
sgit-ai v0.18.0
$ sgit clone --path mail/crm.example --depth 1 <vault-key> work && cd work      # 14 s
$ sgit cat mail/crm.example/contacts.md
…
$ printf '\n- 2026-10-07: called, left message\n' >> mail/crm.example/threads/acme.md
$ sgit status
  ~ mail/crm.example/threads/acme.md
$ sgit commit -m "crm: acme call"
$ sgit push
Merged (no file changes).

Push complete. Named branch updated.
  Pushed 1 commit(s), 6 object(s) uploaded.
  commit obj-cas-imm-…

Six objects: the commit, the new root tree, the new mail/ tree, the new mail/crm.example/ tree, its new threads/ tree, and the one changed file. Everything else in the vault was carried by id.

The team this was worked out on is described in The agent team as it runs and The Mandate Stack; the vault is their shared memory layer.