feat: /sql-graph — a model's CTEs, joins and filters as a list in a pane

HK
1d ago
+2528-127

What this does

/sql-graph [model] opens a pane listing the model's CTEs, joins and filters from the altimate-code dbt_sql_graph tool (AltimateAI/altimate-code#1735, which merges first). With no name it uses the model Claude last read or edited.

  • One row per node in dependency order: name, type, column count and its inputs (rows, edges and selection use the node's unique id, so two nodes with one name stay two). Pressing a row shows that node's SQL. No picture on the terminal; the list is the surface.
  • After Claude edits a model, one context line, N CTEs Ā· /sql-graph, counted from the file. No backend call on edit.
  • The tool starts the dbt adapter, so it runs through the CLI with --allow-write (the plugin's MCP server stays read-only). A failure (no dbt project, no Altimate key, read-only) is shown in the pane and as the command's reply.

This branch contains the Power User foundation commits; this PR's own change is hooks/features/sql-graph.tsx, its test and SqlGraphState in types/index.d.ts.

Verification

claude plugin test ./plugins/altimate-code (228 pass, including the sql-graph tests: ordering, command, pane, row press, same-named nodes, failure, escapes, SQL limit, model folders, edit line) and bash tests/*.sh (all pass). claude plugin validate --strict reports the same warnings as the foundation branch before this change.

Cost

One backend call and one warehouse metadata read per /sql-graph, never per edit.

Demo

Recorded run, real backend, on a built jaffle_shop copy: /Users/harish/.quikim/artifacts/pu-mods/videos/P-01.mp4 (cast: P-01.cast). It shows the branch-built altimate tool run dbt_sql_graph for orders (9 nodes), then /sql-graph orders in Claude Code with the plugin: the pane list, and a pressed row's SQL.

Review

Independent Claude and Codex reviews ran on this PR; every finding has a reply in the PR comments. Open follow-ups, not changed here: a nested monorepo project is not selected for the CLI run (plugin-wide runTool behaviour), docs, a second project lookup per edit, parallel asks not merged.

šŸ¤– Generated with Claude Code