git blame
Tells you who changed a line — not why it changed, or which constraints shaped it.
MVP · MIT · Built for a real developer pain point
Turn code structure, history, and design decisions into one queryable graph. Not just who changed a line — why it exists.
01 — Problem
Existing tools each answer one slice. None of them connect the answers into one queryable chain.
Tells you who changed a line — not why it changed, or which constraints shaped it.
Text only. PR threads sink after a few years and retrieval becomes expensive.
Require manual writing. Docs drift from code; coverage stays incomplete.
Usually see only the current file — not historical constraints or rejected alternatives.
02 — Solution
Parse code with tree-sitter into AST relations (uses / defined_by) and store them in a local SQLite database,
then overlay the Git timeline and decisions from PRs, issues, and ADRs.
Query any historical snapshot of the code graph — or the decision behind a single line.
codegraph graph --at 2024-06-01 returns the structure at that moment — not today’s HEAD.
codegraph why file:line emits a decision card: reason, rejected alternatives, source commit, and whether the record is a decision or only history.
codegraph conflicts finds contradictory accepted decisions so rules do not fight each other.
03 — Demo
Simulated codegraph why output. The real CLI supports --help and full JSON.
04 — Command contract
Stable interfaces first. Every command supports --help.
codegraph index <path>
Parse code + ingest Git history + write the graph
--depth · --full · --jsoncodegraph why <file>:<line>
Return the decision provenance card for that line
corecodegraph graph --at <date>
Return the code graph at a point in time (JSON)
--scopecodegraph decisions --file <path>
Return the decision evolution timeline
--timelinecodegraph conflicts --scope <path>
Detect contradictory decisions
status conflictscodegraph export --for-ai
Export an AI-agent context pack
--scopecodegraph serve
Start the local web visualization
Cytoscape.jscodegraph diff <from> <to>
Decision changes between two versions
--format json05 — Graph model
The schema is a core contract. Changes require a migration plan and explicit confirmation.
Today you usually pick one of three
CodeGraph integrates them natively
06 — Stack
If a choice looks wrong, explain why and get confirmation before changing it.
07 — One line
Rescue the “why” from sunk threads and hang it back on the exact line it justifies.