Indexing
Most context accrues as you work — checkpoints,
ambient capture, integrations. stn index is the one-shot
backfill: it reaches into a repo's existing history — your coding-agent sessions and
local git — and seeds the context graph for the current workspace,
so search and file-context have something to answer from on day one. It parses and redacts
locally, shows you a manifest before anything leaves the machine, and is idempotent —
re-run it any time.
Indexing a repo
Run it from inside the repository you want to backfill:
stn index run # index everything reachable for THIS repo (all sources)
stn index run --source git # just one source (comma-separated for several)
stn index run -s git,claude_code
stn index run --preview # show the redaction manifest and exit — uploads nothing
stn index run --reindex # ignore saved cursors and re-scan from scratch
stn index run --yes # skip the consent prompt (for scripted re-runs, -y)
Sources. Three connectors run cheapest-first, and you can scope to any subset
with --source:
git— your local git history (commits, branches, the files they touch), read with no network.claude_code— your local Claude Code session transcripts for this repo.github— GitHub activity for the repo (the one networked connector).
Local redaction, then a manifest. Everything is parsed and secret-redacted on
your machine first. --preview prints exactly what would be uploaded — a
per-source manifest of items, size, and how much was redacted — and exits without sending anything,
so you can inspect it before committing. On a real run the first time, the CLI asks for consent
once (then remembers it, so later re-runs are silent); pass --yes to skip the prompt in
a script.
Idempotent. Runs save a per-source cursor, so a re-run only picks up what's new.
--reindex ignores the cursors and re-scans from scratch — safe, because unchanged docs
dedup server-side. Indexing writes into the current workspace's graph;
the server computes semantic embeddings out-of-band, so you can close the laptop once the upload
confirms.
Checking what's indexed
stn index status # docs per source, the date span, the embedding backlog, and the last run
Semantic embedding happens server-side after the upload, so something you just indexed can take a
moment to become searchable. stn index status makes that visible: it lists the document
count and oldest→newest span per source, the embedding backlog (docs still awaiting
a semantic index — the reason a just-indexed thing isn't a search hit yet), and the status of your
last run.
Removing a source
stn index remove --source git # purge a source from this workspace (asks to confirm)
stn index remove -s git --repo REPO # narrow to one repo (keeps the cursor)
stn index remove -s git --tombstone # leave identity stubs so a re-run can't resurrect it
stn index remove -s git --yes # skip the confirmation (-y)
Removing a source deletes its documents, embeddings, graph edges, and cursor from the workspace —
for a repo indexed by mistake, or a source that captured a leaked secret. By default a later
stn index run could re-add the same content; --tombstone keeps identity
stubs that block that resurrection. The command prints how many docs, tombstones, and edges it
removed.