Skip to main content

How it works

GitWhy installs a lightweight post-commit hook that tracks commits during your work session. When your agent saves context, the commits are auto-populated — you never have to reference them manually.

What the hook does

The hook runs after every commit and appends one line:
When git why save runs, it reads .active-commits, populates the ## Commits section, and clears the file.

Traceability

Because contexts are linked to commits:
  • On PRs — gitwhy-bot matches contexts to PR commits automatically
  • On the dashboard — click any commit SHA to jump to the GitHub diff
  • In the terminal — git why get shows the linked commits inline

Why it matters

Context isn’t useful if you can’t connect it to the code. Commit linking makes every saved context traceable — you can always go from “why” back to “what.”