orstrum summarize
Generate an LLM "Purpose" summary for a file, or for the whole graph in batch mode.
$ orstrum summarize [path] [options]
With no path, summarize runs in batch mode over every indexed
file. Pass a path to summarize a single file. It reads
ORSTRUM_ANTHROPIC_API_KEY from the environment (or a .env in the
working dir); pass --use-claude-code to invoke via your local
claude CLI and Pro/Max quota instead.
How it works
For each file being summarized, summarize sends the file's
full source plus a small amount of import context (first-sentence purposes of its
resolved imports) to the model, and stores the resulting Purpose sentence in
graph.db. Raw source is only sent to the model — it is never stored in the graph.
Whether a stored summary is still valid is decided by a content hash:
sha256(inputHash + model + promptVersion). Note that the import context is
deliberately excluded from this hash — otherwise a file's summary would be invalidated every
time a neighbor's purpose changed, causing unbounded re-summarization. A summary is regenerated when the
file's content, the model, or the prompt version changes (or when you pass --force).
Options
-c, --config <path>orstrum.config.*.--dry-run--force--use-claude-codeclaude CLI (Pro/Max subscription quota) instead of the API. Slower and pricier for large batches.--max-files <n>--changed-onlysummaryHash no longer matches (skips stubs with no stored hash).--paths <glob>--concurrency <n>ORSTRUM_CONCURRENCY or summarize.concurrency in config).--max-retries <n>ORSTRUM_MAX_RETRIES or summarize.maxRetries in config).-y, --yesinit prompt when no config is found.orstrum_search and
orstrum_get_summary quality. You only pay for LLM generation once per unique file
version, model, and prompt version.
summaries table alongside the
purpose text, so you can audit what was generated and at what cost.