brain_watch
Automatically learn from every git commit by installing a background hook that sends commit details to the Cachly Brain API.
Instructions
Install an ambient git post-commit hook that automatically learns from every commit — no manual brain_from_git needed. After installation every git commit silently POSTs the commit message, SHA, and changed files to the cachly Brain API in the background. Idempotent: running brain_watch twice installs the hook only once. Uses curl (not Node/npx) so it works in any environment. The hook always exits 0 and runs asynchronously — it never blocks a commit. Returns the hook path and installation status (written/upgraded/appended/unchanged/skipped-no-git).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| api_key | No | Optional cachly API key (cky_…) to embed in the hook for authentication | |
| instance_id | No | Brain instance ID to learn into | |
| project_dir | No | Path to the git repository (default: current directory ".") |