You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ Invariants that keep the shim correct — preserve them:
73
73
-**Host-user file ownership.** The shim runs `--user "$(id -u):$(id -g)" -e HOME=/tmp` so `.whygraph/` and `.codegraph/` come back owned by the host user and git sees matching ownership (no "dubious ownership"). Keep these when editing the shim.
74
74
-**GitHub token is per-project.**`[scan].token` in each repo's `whygraph.toml` (gitignored, never committed) is exported as `GH_TOKEN` for that scan's `gh` calls (`cli/commands/scan.py:_apply_github_token`), falling back to ambient `GH_TOKEN` / `GITHUB_TOKEN` (the shim passes those through). Do **not** bake a token into the image or assume a container-wide token.
75
75
76
-
CodeGraph runs from the **in-image `codegraph` binary** (no docker-in-docker, no host socket): `bootstrap.py` prefers the local binary and only falls back to `docker run` on hosts without it. `whygraph scan` refreshes the index each run — `codegraph sync -q` when an index exists, `codegraph init -i` on first run — gated by `--codegraph/--no-codegraph`.
76
+
CodeGraph indexing belongs to **`whygraph scan`, not `whygraph init`** — `init` only bootstraps the WhyGraph DB / config / agent wiring (and its preflight no longer requires `docker`). `whygraph scan` builds or refreshes the index each run — `codegraph init -i` on first run, `codegraph sync -q` thereafter — gated by `--codegraph/--no-codegraph`. CodeGraph runs from the **in-image `codegraph` binary** (no docker-in-docker, no host socket): `bootstrap.py`(`services/codegraph/`) prefers the local binary and only falls back to `docker run` on native (`uv`/`pipx`) hosts without it. There is a **single image**— `ghcr.io/mtrdesign/whygraph` — and that fallback runs `codegraph` inside it (`docker run … whygraph codegraph …`); there is no separate codegraph image.
-**git** — repo history is the primary evidence source.
13
-
-**Docker**— `whygraph init` runs a vendored container image to bootstrap CodeGraph in the current repo. No host Node install needed.
13
+
-**Docker***(native installs only)* — when no `codegraph` binary is on PATH, `whygraph scan` runs CodeGraph inside the WhyGraph image to index the repo. No host Node install needed. The pure-Docker install (below) already runs everything in that image.
14
14
-**[`gh` CLI](https://cli.github.com/)**, authenticated (`gh auth login`) — required only if your repo is on GitHub. Without it, the GitHub crawl phase is skipped silently.
15
15
-**`claude` CLI***or*`ANTHROPIC_API_KEY` — needed for the LLM diff-description phase of `whygraph scan` and for `whygraph_rationale_brief`. Both phases skip cleanly if neither is available. The `claude` CLI defaults to your Claude.ai subscription billing.
16
16
@@ -117,9 +117,7 @@ WhyGraph's MCP server (`whygraph-mcp`) is a standalone console script, so any LL
117
117
Run from the repo you want WhyGraph to analyse:
118
118
119
119
```bash
120
-
whygraph init # preflight + WhyGraph DB + CodeGraph via Docker (no agent wiring)
121
-
whygraph init --no-codegraph # skip the CodeGraph bootstrap step
122
-
whygraph init --codegraph-image TAG # pin a specific whygraph-codegraph image
120
+
whygraph init # preflight + WhyGraph DB + example config (no agent wiring)
whygraph scan # crawl history + build/refresh CodeGraph index + LLM descriptions
148
146
```
149
147
150
148
`install.sh` drops a `whygraph` (and `whygraph-mcp`) shim on your `PATH` that runs the published image (`ghcr.io/mtrdesign/whygraph`) against the current directory — `docker run --rm -v "$PWD:/workspace" … whygraph "$@"`. The container is ephemeral per command: no compose, no `docker exec`, nothing to start or stop.
@@ -173,8 +171,8 @@ The generated `.mcp.json` launches `whygraph-mcp` by bare command name; your edi
|`whygraph init [--no-codegraph]`| Run preflight diagnostics (git / docker / gh / LLM credential), bootstrap the WhyGraph DB, and pull the vendored Docker image to populate `.codegraph/codegraph.db`. Pass `--agent <name>` to also wire MCP for an editor. Idempotent. |
177
-
|`whygraph scan`|Walk first-parent history and populate `.whygraph/whygraph.db`: commits + GitHub PRs/issues + TF-IDF scoring + per-commit LLM diff descriptions. Idempotent. `--no-remote` skips the PR/issue crawl for a fast, offline, git-only scan. |
174
+
|`whygraph init`| Run preflight diagnostics (git / gh / LLM credential), bootstrap the WhyGraph DB, and write the example config + `.gitignore` entries. Pass `--agent <name>` to also wire MCP for an editor. Idempotent. Does not index CodeGraph — that happens on `scan`. |
175
+
|`whygraph scan`|Build or refresh the CodeGraph index (`.codegraph/codegraph.db`), then walk first-parent history and populate `.whygraph/whygraph.db`: commits + GitHub PRs/issues + TF-IDF scoring + per-commit LLM diff descriptions. Idempotent.`--no-codegraph` skips the index refresh;`--no-remote` skips the PR/issue crawl for a fast, offline, git-only scan. |
178
176
|`whygraph hooks install / uninstall / status`| Opt-in git hooks (`post-commit` / `post-merge` / `post-rewrite`) that keep WhyGraph current as you commit — see [Keep it fresh automatically](#keep-it-fresh-automatically). |
179
177
|`whygraph render [--out PATH] [--open] [--depth N]`| Render a self-contained HTML viewer of the CodeGraph + WhyGraph data. Single file, vendored Cytoscape, opens with double-click. Cached rationale only. `--depth N` (1–4, default 1) caps which nodes get a populated detail block — fast first paint at default 1 (modules only); pass `--depth 4` for full data. |
180
178
|`whygraph serve [--port 8765] [--open]`| Long-running localhost viewer with on-demand rationale generation. Same UI as `render`, plus a "Generate rationale" button on uncached nodes. |
0 commit comments