I did start working with agents after all. Of course I did, everybody did. Part of doing that means I have them working on different machines, and agents love markdown files. Memory goes into markdown, plans go into markdown, handoffs are markdown. I wanted to be able to share those notes across devices quickly and not think about it too much. So I thought about it a lot. How should I keep my notes in sync on my work laptop, personal laptop, etc?

Oh yeah I’m a developer and they’re just files I can use git.

So I started telling my agents to commit stuff in the notes repo when they make changes.

But it wasted so many unrelated turns and derailed my sessions.

So I turned it off and figured I’d just handle commit/push/pull myself. But of course I didn’t because I’m also a forgetful human. So I figured it was time to automate it more.

But I’ve also worked with git repos for years, and you can’t just autocommit and expect a push/pull to work. There will be conflicts.

There were existing “git sync” style libraries out there, but they’re generally focused on read-only sync and I wanted to explore a read/write pattern.

I landed on git-tend, built as a small go daemon I can run on any node and easily keep any repo in sync automatically.

What it does

It runs as a launchd agent on macOS or a systemd user service on Linux. It watches a set of directory roots and syncs repos that have opted in. Opting in means putting a .gittend file in the repo root.

Each repo picks a mode:

  • read-only — pull on every tick and nothing else. Dotfiles live here.
  • read-write — stage the working tree, commit, git pull --rebase, push. My notes repo runs this way.
$ git-tend status
REPO                                     MODE STATE    LAST SYNC    AHEAD      BEHIND
------------------------------------------------------------------------------------------
/Users/you/Code/notes                    ro   ok       12s ago      0          0
/Users/you/.dotfiles                     ro   ok       12s ago      0          0

The .gittend file for my notes:

mode = "read-write"
sync_branch = "main"
interval = "2m"
debounce = "30s"

[commit]
strategy = "deterministic"
emoji = "📝"

The debounce exists to avoid a commit in the middle of editing. It allows for changes to settle before syncing that way.

When it breaks it stops

This is the part I actually care about. When a sync fails — conflict, rejected push, hook failure — the daemon writes a .gittend.stuck file into the repo with the reason and the last failing output, and then it doesn’t touch that repo again until I’ve cleared it. It doesn’t clean up, it doesn’t force anything. It writes a note and stops. (I never really read the note, it’s usually easy to clear.)

The naive version of this setup might be a scheduled job that fails every minute forever and hopes you’re paying attention. Not great.

Network failures are tracked separately, because the wifi being down is not the same as a rebase exploding. A repo that can’t reach its remote backs off instead of flagging itself stuck, and the backoff caps out at 30 minutes.

I haven’t configured it yet, but my shell could show me something like ⚠ tend:2 when two repos are stuck, and the daemon could apparently greet me on shell start about anything that’s been stuck more than a few days. (It’s funny to build things and not actually use them, that’s kind of my MO nowadays.)

The agent part

The commit messages come from a local model. The daemon hands the staged diff to a command I’ve configured, gets a commit message back, and runs the commit itself.

I keep going back and forth on how much agency to give this thing. Too little and it’s cron with extra steps. Too much and I’ve rebuilt the job that committed my working tree mid-thought, except now it also gets to make decisions. Right now there’s an opt-in agent-assisted unstick that can clear mechanically recoverable failures, gated on provenance, with a fixed attempt budget per repo before a human has to look at it. The automation can try, twice, and then it’s my problem again.

Try it

It’s a small Go tool. No cloud, no accounts, nothing phones home: sdougbrown/git-tend. The releases page has binaries for macOS and Linux and git-tend install sets the daemon up. If your notes have ever hidden on you, it might help.