Istari docs

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

WhereWhat happensStatus
PR reviews (watcher)Every reviewer prompt uses the graph first, with turns sized to the PR, diff-first context and a cap on injected knowledgeOn 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 turnsOpt in per repo
Plain claude sessionsA short graph note at session start: where the graph is, its age and how to query itOn where hooks are installed
ist pickA ticket card (symbols from the ticket and plan, with callers, callees and tests) in the implement promptOn
FreshnessGraphs refresh after the synced repo moves and after local edits settle for 10 minutesOn

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

shell
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 status

After 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:

shell
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

shell
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 mode

The 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

shell
# 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 classic

Off switches

Edit ~/.istari/config.yaml, under graphify::

YAML
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 pick

Switching a repo to card mode

  1. 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.
  2. Check the rehearsal. After a few rounds, run ist reviews cost. The fallback share should be low (under 20%). Persistent fallbacks also show up in ist doctor and the feed.
  3. 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.
  4. Measure. Turn on card_abmode. After 30 or more card reviews, compare them in ist reviews cost: fewer fresh tokens than clamp-only, no drop in findings, and a fallback share under 10%.
  5. 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 uncertain and 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

SymptomCheckFix
fallback:no-graph keeps appearingGraph health in ist doctorRun ist graphify build in the repo. A stale build lock is cleared on its own after 30 minutes.
fallback:stale-overlap on every reviewIs 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 repoThe repo's languages may not be covered yetReport it, and turn card mode off for that repo.
No graph note in plain sessionsAre 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.