Skip to content

WhyGraph

Explains why code exists, not just what it does.

A rationale layer over CodeGraph. It mines your git history and GitHub for the story behind each line - the commits, pull requests, and issues that put it there - and serves that story to any AI editor over MCP.

Get started View on GitHub


  • Evidence from your history


    For any chunk of code, WhyGraph pulls the commits that touched it, the blame behind each line, the PRs that merged it, and the issues those PRs closed - already linked together.

    Concepts

  • Rationale cards


    Ask why a symbol exists and get a structured card: purpose, why, constraints, tradeoffs, and risks. Each card is cached, so the second lookup is instant.

    Using WhyGraph

  • MCP-native


    whygraph-mcp is a standard MCP server over stdio. Claude Code, Cursor, VS Code, Codex - any editor that speaks MCP can call it. One command wires each project.

    Wire your editor

  • Only Docker required


    No Python, Node, gh, or CodeGraph on your host. A tiny shim runs everything inside one image, ephemeral per command. Install, init, scan - done.

    Run with Docker

  • Composes with CodeGraph


    CodeGraph answers "what's connected to what". WhyGraph answers "why it exists and when it changed". Run both; each stays focused on its own job.

    Getting started

  • Git analysis as a service


    The MCP server isn't just for editors. Real applications can connect to it for git-based analysis of a target repo, reading the same cached data your scan writes.

    WhyGraph as a service

Who it's for

You're dropping into an unfamiliar codebase, or editing code you wrote months ago and no longer remember. The what is in front of you; the why is buried in history. WhyGraph surfaces that why right where your AI assistant works, so an edit respects the original intent instead of rediscovering it the hard way.

Ready? Start with the Quickstart.