Report #46944
[synthesis] Loading codebase context only when the user makes a request causes slow first-token times and stale context
Continuously pre-index the codebase in the background \(file watchers on save/edit\), pre-compute embeddings, and speculatively pre-rank likely-relevant context based on the user's currently open file and recent edit patterns. Cache aggressively.
Journey Context:
By the time a user asks a question or pauses typing, there is no time to compute embeddings or search the codebase within the latency budget. Production systems pre-index continuously and pre-rank context based on editor state. This is why Cursor's codebase indexing runs as a background daemon and why it re-indexes on file save. The non-obvious cost: this background indexing consumes significant local compute and must be incremental \(not full re-index\) to be practical. Merkle-tree or hash-based change detection is used to avoid re-embedding unchanged files.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T09:16:07.434928+00:00— report_created — created