Skip to Content
ConnectGitCollect

Collect

Collect local git activity from the Git CLI  and send it to Autographical.

Once installed, it runs automatically as a git hook on every commit (and other git events), capturing the activity and sending it to Autographical in the background without slowing git down.

Data collected

Events are produced by the corresponding git hook. Every event carries hostname, cwd (absolute working directory path), gitBranch, and gitRemoteUrl so it correlates with other connectors (e.g. Claude Code sessions running in the same checkout).

HookEvent typeCaptures
post-commitGitCommitCapturedsha, subject/body, author + committer, parents, files changed, shortstat
post-mergeGitMergeCapturedmerge commit details plus the squash flag
post-rewriteGitRewriteCapturedamend / rebase, old→new sha pairs, latest commit
post-checkoutGitCheckoutCapturedprevious and new sha, branch name (branch switches only)
pre-pushGitPushCapturedremote name and URL, local/remote ref+sha tuples

Installation

Homebrew (macOS, Linux)

brew install autographical/tap/autographical-git-collect

Direct binary download

Pre-built binaries for darwin / linux / windows on amd64 and arm64 are attached to every GitHub release . Pick the version and platform from the releases page, then download, extract, and put the binary on your $PATH:

# Set to the version + platform you want (see the releases page). VERSION=0.1.0 OS=darwin # darwin | linux | windows ARCH=arm64 # arm64 | x86_64 # Download and extract (use the .zip asset on windows). curl -L "https://github.com/autographical/git-collect/releases/download/v${VERSION}/autographical-git-collect_${VERSION}_${OS}_${ARCH}.tar.gz" -o agc.tar.gz tar xzf agc.tar.gz # Install into ~/.local/bin and make sure it's on your PATH (bash). mkdir -p ~/.local/bin mv autographical-git-collect ~/.local/bin/ echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc

Then register the hooks. Two modes:

Global — every repo on this machine

autographical-git-collect install

Writes hook stubs to $XDG_DATA_HOME/autographical/git-hooks/ (defaults to ~/.local/share/autographical/git-hooks/) and sets git config --global core.hooksPath at that directory. Executable hook stubs belong under XDG_DATA_HOME rather than XDG_CONFIG_HOME — the latter is for inert configuration, the former for runnable user data.

Pass --skip-config to leave core.hooksPath alone and print the command to set it yourself.

Local — just this repository

cd /path/to/repo autographical-git-collect install --local

Writes stubs into the current repository’s .git/hooks/ directory. Does not touch any git config, so other repos are unaffected. Use this when you want collection on a single project rather than machine-wide.

Removal

autographical-git-collect uninstall # global autographical-git-collect uninstall --local # current repo

Uninstall only removes files carrying our marker, so any unrelated hooks in the target directory are left in place.

Repo-local hooks (husky, lefthook, etc.)

When core.hooksPath is set (global mode), git ignores each repo’s own .git/hooks/ directory. To avoid silently disabling project-local hooks, the collector chains to them: after capturing its event, it looks up <git-dir>/hooks/<name> directly and, if executable, runs it with the original arguments, buffered stdin, stdout/stderr, and exit code.

For pre-push the order is reversed: the local hook runs first, and GitPushCaptured is only emitted on a zero exit — so a rejected push is never recorded as if it happened.

Configuration

Ingest token

The binary needs an ingest token to authenticate with Autographical. Create one in your Autographical user settings .

The token is resolved from the first available source:

  1. Environment variableAUTOGRAPHICAL_INGEST_TOKEN
  2. Config fileingestToken in ~/.config/autographical/config.json

If no token is configured the binary silently no-ops (git operations are unaffected).

Config file example (shared with the Claude Code plugin):

{ "ingestUrl": "https://ingest.autographical.ai", "ingestToken": "your-token" }

Ingest URL

Configure an ingest URL based on your Autographical deployment: Cloud, Cloud alternate data region, or self-hosted.

Defaults to Autographical Cloud US data region (https://ingest.autographical.ai).

Override with:

  • AUTOGRAPHICAL_INGEST_URL environment variable
  • ingestUrl in ~/.config/autographical/config.json

Filesystem layout

All paths sit under a shared autographical/ namespace so sibling collectors co-locate cleanly:

PurposeDefaultNotes
Shared config~/.config/autographical/config.jsonShared with the Claude Code plugin
Hook stubs (global)~/.local/share/autographical/git-hooks/$XDG_DATA_HOME if set; executable, so not under .config/
Hook stubs (local)<repo>/.git/hooks/Git’s default; no config change needed
Debug log~/.cache/autographical/git-collect/log.jsonl$XDG_CACHE_HOME if set

Debugging

Set AUTOGRAPHICAL_DEBUG=1 to log dispatch decisions and errors to the debug log above. Errors are always logged; debug entries are gated on the env var.

Last updated on