Cursor Instant Grep Cuts Codebase Search from 16.8s to 13ms

CursorCursor

· Updated

Regex searches in large codebases can take over 15 seconds, stalling AI agents mid-task. Cursor's Instant Grep indexes files locally, cutting latency to 13 milliseconds. Agents in big monorepos can now iterate without multi-second delays.

Cursor's Instant Grep is a client-side search index that speeds up regex queries in large codebases. It builds an inverted index using sparse n-gram decomposition — a variable-length indexing technique that minimizes posting lookups and narrows candidate files with high specificity. Queries that took 15 seconds in Chromium now complete in 13ms. The index syncs on Git commits, staying fresh without full rebuilds.

Keeping the index on the user's machine eliminates the network roundtrips that would otherwise slow every search. Since agents search constantly and often in parallel, this keeps Composer 2 running without stalls. The speed difference is most noticeable in enterprise monorepos.

Instant Grep is already shipped and works with Composer 2. Point your agent at a large codebase and let the index handle grep — the iteration loop is faster when search no longer introduces multi-second delays.

Cursor
Cursor
@cursor_ai
X

Cursor can now search millions of files and find results in milliseconds. This dramatically speeds up how fast agents complete tasks. We're sharing how we built Instant Grep, including the algorithms and tradeoffs behind the design. https://t.co/uzqMUgHvYn

300retweets
View on X

Every HeadsUpAI update is written based on its original source and reviewed before it's published. Read our editorial standards →

Share this update