SmartMemory
Guides

Local git history as memory

How the local_git connector turns the commits of a repository on your machine into episodic memory, and what it never reads, runs or stores.

The local_git connector reads the commit history of a repository on your computer and adds one memory per commit. The reading happens on your machine through the local runner. Nothing is fetched over the network and no account is needed.

It covers history. The git connector covers the files in the tree, and the code indexer covers symbols. All three agree on the repository name and the commit id, so a commit memory points at the same commit the code index knows.

Settings

SettingMeaning
repoThe name used in memory ids. Required
pathThe checkout folder. Required
branchThe branch to read, main by default
max_commitsHow many of the newest commits to keep, 5000 by default
max_diff_bytesDiff text kept per commit, 65536 by default. Zero keeps diffs out
blameOff by default. When on, records which authors own how many lines of the changed files

What a memory holds

The commit message, the author and committer names with dates, the parent commits, the changed files with added and deleted line counts, and the diff up to the size limit. Email addresses are not stored. Blame stores line counts per author and never the text of a line.

What it never does

  • It never runs anything the repository configures, such as hooks or filters.
  • It never accepts a branch or ref that could be read as a git option. File names that look like options are read as plain names, and a file name with a newline is listed but not blamed.
  • It never writes to the folder you pick, and it reads history only from that folder. At each sync it opens the folder once, refuses it if it is a link, and reads everything after that through the folder it opened. Swapping the folder for a link to another repository during a sync changes nothing it reads. The folders above the one you pick are followed as usual, so pick a path that nobody else can rearrange, and write it as a plain path with no . or .. parts. At each sync it copies the repository's history into a private folder, checks every file as it copies, and runs git only on that copy. The folder must be the top level of an ordinary repository. It is refused when any part of the history it reads is a link or a hard-linked file, when .git is a file (linked worktrees and submodules), when it uses alternates of any kind, and when it is a bare repository, a folder inside another repository, uses the reftable format, or holds more than 2 GiB of history. A clone made with git clone <local path> shares hard-linked files with its source, so clone with --no-hardlinks instead. Shallow clones do not work today.
  • It never prints a branch, path or message in an error.

Secrets

Keys and passwords that match well known shapes are replaced with a marker such as [REDACTED:aws_access_key]. Private key blocks are removed, and the diff of files that look secret (key files, .env, credential files) is left out. This is pattern matching and not a guarantee. If a secret has a shape we do not know, it can still reach memory. Set max_diff_bytes to zero to keep diffs out entirely.

Rewritten history

Each run reads only the commits after the last one it indexed. If you rebase, amend or force-push so that the last indexed commit is no longer an ancestor, the connector reads the branch again from the top. Rewritten commits are new memories. The old ones are removed only after they are missing in two complete reads in a row, and so are commits that fall outside the max_commits window.

On this page