Git Hooks
FatHippo can automatically capture every git commit to memory. A lightweight post-commit hook records the repo, branch, commit message, files changed, and diff stats — giving your AI agents full awareness of project history without any manual effort.
Installation
Run this from inside any git repository:
npx @fathippo/connect hooks installThat's it. Every commit in this repo will now be captured to FatHippo memory.
Tip
Removal
To remove the FatHippo hook while preserving any other hooks:
npx @fathippo/connect hooks removeIf FatHippo was the only hook, the file is deleted entirely. If other hooks exist, only the FatHippo section is removed.
What Gets Captured
Each commit creates a memory entry with the following data:
| Field | Example | Description |
|---|---|---|
Repository | fathippo | Name of the git repo |
Branch | main | Current branch at commit time |
Commit message | fix: handle null API key | The full commit subject line |
Files changed | src/index.ts, README.md | Up to 20 modified files |
Diff stats | 3 files changed, 42 insertions(+), 7 deletions(-) | Summary line from git diff --stat |
Hash | a1b2c3d4 | Short commit hash (first 8 chars) |
The memory text looks like:
[Git commit] fathippo/main: fix: handle null API key | Files: src/index.ts, README.md, | Stats: 2 files changed, 12 insertions(+), 3 deletions(-) | Hash: a1b2c3d4How It Works
The hook is a shell script appended to .git/hooks/post-commit. Here's what happens on each commit:
- The hook runs in the background (forked with
&) — it does not slow down your commits - It gathers commit metadata using standard git commands
- It sends a single
POST /v1/simple/rememberrequest to FatHippo - All output is suppressed — the hook is silent on success and failure
- If the API key is missing or the request fails, the hook exits silently
Note
curl and git, both of which are available on any development machine. No Node.js required at runtime.Requirements
The hook needs a FatHippo API key available through one of these methods:
| Method | Details |
|---|---|
Environment variable | Set FATHIPPO_API_KEY in your shell profile |
Config file | Store in ~/.fathippo/config.json as {"apiKey": "mem_..."} |
If no API key is found at commit time, the hook exits silently without sending anything.
Setting up the API key
# Option 1: Environment variable (add to ~/.bashrc or ~/.zshrc)
export FATHIPPO_API_KEY="mem_your_api_key"
# Option 2: Config file
mkdir -p ~/.fathippo
echo '{"apiKey": "mem_your_api_key"}' > ~/.fathippo/config.jsonCustom Base URL
If you're using a self-hosted FatHippo instance, set the base URL before installing:
export FATHIPPO_BASE_URL="https://your-instance.example.com/api"
npx @fathippo/connect hooks installFAQ
Does this slow down my commits?
No. The hook forks to a background process immediately. Your commit completes instantly while the API call happens asynchronously.
Will it overwrite my existing post-commit hook?
No. If a post-commit hook already exists, FatHippo appends its section to the end. Both hooks run. The FatHippo section is clearly marked with start/end comments for clean removal.
What happens if the API is down?
The hook fails silently. Your git workflow is never affected by FatHippo availability. The curl request has no timeout override, so it uses the system default and all output goes to /dev/null.
Can I use this with the MCP server?
Yes. The hook stores commits via the Simple API, which shares the same memory graph that the MCP server's search and build_context tools query. Your coding agent will automatically see relevant commit history when it calls get_cognitive_context.