Skip to main content
GitWhy — the context layer for git

What is GitWhy?

Finish a coding session. Tell your agent “save this with GitWhy.” The reasoning — what was done, why, what was rejected — gets saved as structured markdown, linked to the commits that produced it. Browse context locally with git why log. Share it with git why push. GitWhy’s GitHub App posts it on your PRs. Works as a Git extension, an MCP server, or both.

Get started

Quick Install

Install the CLI

Install git-why with a one-line script, Homebrew, Scoop, or Winget.

Quickstart

Save your first context in under five minutes.

Integration guide

Connect GitWhy to Claude Code, Cursor, Windsurf, or any coding agent.

Context format

The structured markdown template your agent fills out.

How it works

1

Install and connect your agent

Run git why setup to authenticate once and choose how your coding agent connects — MCP tools, skill files, rules, or hook injection. Repository-local capture setup happens on the first save in each repo.
2

Work normally, then save

Finish a feature. Tell your agent: “Save this session with GitWhy.” The agent generates structured context — what was done, why, what was rejected — and saves it with a single tool call or CLI command.
3

Browse locally

git why log lists saved contexts. git why get <id> retrieves one. git why tree shows the full domain → topic → context hierarchy.
4

Share with your team

git why push publishes contexts to the hosted API. GitWhy’s GitHub App posts a context comment on the matching pull request.

Core concepts

Context

A context is a structured markdown file capturing the reasoning behind a code change: what was done, why this approach was chosen, what alternatives were rejected, and what risks remain. Saved to .git/gitwhy/contexts/ on your machine. Stays local until you run git why push.

Context ID

Every saved context gets a unique ID — ctx_ followed by 8 alphanumeric characters.

Context tree

Contexts are organized by domain and topic: .git/gitwhy/contexts/<domain>/<topic>/<id>.md. A JWT implementation context might live at .git/gitwhy/contexts/authentication/jwt-implementation/ctx_a1b2c3d4.md. Browse with git why tree.

Integration methods

MCP and skill files are recommended. You can combine multiple methods.

What GitWhy is not

  • Not automatic. There is no background recording. You choose when to save.
  • Not an LLM wrapper. Your coding agent generates the context. GitWhy makes no AI API calls.
  • Not a general-purpose memory tool. Contexts are git-native — tied to commits and linked to pull requests.