Use Istari
Graph-first reviews
Istari can build a code graph of a repo and use it so agents look things up instead of reading whole files. This page covers what runs on its own, the commands you can type, and how to switch a repo to card-mode reviews.
Everything graph-related is best effort. No graph, a stale graph or any failure falls back quietly to the classic behaviour. A graph problem can never block a review, a pick or a session.
What you get
| Where | What happens | Status |
|---|---|---|
| PR reviews (watcher) | Every reviewer prompt uses the graph first, with turns sized to the PR, diff-first context and a cap on injected knowledge | On for all repos |
| PR reviews (card mode) | A precomputed review card (callers, tests and risk flags for each changed symbol) replaces the agent's own exploration, with fewer turns | Opt in per repo |
Plain claude sessions | A short graph note at session start: where the graph is, its age and how to query it | On where hooks are installed |
ist pick | A ticket card (symbols from the ticket and plan, with callers, callees and tests) in the implement prompt | On |
| Freshness | Graphs refresh after the synced repo moves and after local edits settle for 10 minutes | On |
Where things live
- Graphs:
~/.istari/graphs/<repo-key>/graphify-out/graph.json - Review telemetry:
~/.istari/pr-reviews/<owner>-<repo>/PR-<n>/usage.jsonl - Config:
~/.istari/config.yaml
Commands
Build and check the graph
ist graphify build # first build for the current repo (uses an LLM, so it costs tokens)
ist doctor # includes graph health: present, size, drift and build statusAfter that, updates happen on their own: a build starts when a repo is registered, and incremental updates (no LLM) run when the repo moves or local edits settle.
Query the graph yourself
This is what the agents are told to do:
graphify query "what calls <symbol>?" --budget 300 --graph ~/.istari/graphs/<repo-key>/graphify-out/graph.json
graphify explain "<symbol>" --graph <same path>Review card status and cost
ist reviews status # the Tokens column is fresh billable tokens; cache reads are separate
ist reviews cost # fresh and cached tokens, with a breakdown by modeThe card state you'll see in the cost output is one of off (classic), shadow (a classic review plus a silent card rehearsal), built (card injected), clamp-only (a comparison arm) or fallback:<reason>, where the reason is one of no-graph, stale-overlap, stale-drift, stale-age, empty-card, cli-error, graph-corrupt, budget-exceeded, timeout, diff-unavailable or not-installed.
Turn card mode on or off
# read the current mode
ist config review contextMode
# turn it on for one repo (recommended)
ist config review --set contextMode card --repo <owner>/<repo>
# turn it on for every reviewed repo (not recommended yet)
ist config review --set contextMode card
# split PRs three ways (card, clamp-only, classic) to compare them
ist config review --set card_abmode true
# back to classic at any time; classic is always the fallback
ist config review --set contextMode classicOff switches
Edit ~/.istari/config.yaml, under graphify::
graphify:
autoBuild: true # build when a repo is registered
autoRefresh: true # refresh after syncs and local edits
sessionInjection: true # the graph note in plain claude sessions
ticketCard: true # the ticket card in ist pickSwitching a repo to card mode
- Shadow runs on its own. In classic mode with a fresh graph, every review also builds the card silently and records its stats. Reviews are unchanged.
- Check the rehearsal. After a few rounds, run
ist reviews cost. The fallback share should be low (under 20%). Persistent fallbacks also show up inist doctorand the feed. - Switch the repo. Run
ist config review --set contextMode card --repo <owner>/<repo>. If a card can't be built, the review gets the classic prompt, unchanged. - Measure. Turn on
card_abmode. After 30 or more card reviews, compare them inist reviews cost: fewer fresh tokens than clamp-only, no drop in findings, and a fallback share under 10%. - Decide the default. Only then consider card mode for every repo. Classic stays available, and stays the automatic fallback.
Why the card's facts can be trusted
- Caller counts come from a direction-resolved index, not from raw graph links.
- Same-named methods in different classes are marked
attribution uncertainand never produce risk flags or extra turns. The reviewer is told to check those by reading. - Files added by the PR are marked
no graph data, never guessed. - A card that can't be built adds nothing: the review gets the classic prompt exactly.
- Production code ranks above tests when the size cap is reached.
Troubleshooting
| Symptom | Check | Fix |
|---|---|---|
fallback:no-graph keeps appearing | Graph health in ist doctor | Run ist graphify build in the repo. A stale build lock is cleared on its own after 30 minutes. |
fallback:stale-overlap on every review | Is graphify.autoRefresh on? | Turn it on. The fallback itself starts an update, so the next review should pass. |
fallback:empty-card keeps appearing on one repo | The repo's languages may not be covered yet | Report it, and turn card mode off for that repo. |
| No graph note in plain sessions | Are hooks installed for this account? | See multiple accounts, and check graphify.sessionInjection: true. |
Known limits
- Calls between same-named methods in different classes can't be told apart yet, so they are labelled rather than guessed.
- File-level dependency questions ("what depends on this file?") return nothing on current graphs.
- Per-repo settings apply to the review card; other review settings are global.