Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 16 · System Design · Cursor · about 27 min to read

Watch: Cursor, end to end: how four hours became twenty one seconds
▶ VideoPlay it as a journeyTutor comes with a plan

Cursor, the case study

Everything
Everything · Open board

: the whole indexing machine on one canvas: the tree on the laptop, the copied index on the server, the proofs between them, and the grep index that never leaves the machine.

Before you start. You need two facts. A program can turn a file into a short fixed-size number, a fingerprint, and changing one letter of the file changes the fingerprint completely. And an AI code editor is an editor with a chat box where an agent, a model that can run tools like search and open files, answers questions about your code. Everything else is explained the first time it is used.

How to read this series. Cursor describes its methods in four posts on its research blog, not its whole system. So every claim here wears one of three labels. Cursor says means it is in one of those posts. Standard practice means it is how the named technique works in general, taught here but not claimed as Cursor’s exact code. Our guess means inference, and it is always called that.

Lesson 82 of 115 in System Design

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • A new hire, a huge repo, and four hours before the first answer
  • The tree that knows what changed: a Merkle tree
  • Chunks, not files: the embedding cache
  • Your teammate already did this: SimHash, and a copied index
  • Prove you have it: content proofs
  • Search that learned from its own misses: a trained embedding model
  • Grep without reading every file: a trigram index
  • Fewer details up front: dynamic context discovery
  • Everything: one rule, five times
  • The table that carries the argument
  • By hand
  • The Merkle sync, case by case
  • SimHash, in general
  • Content proofs, the order of events
  • The training loop for semantic search
  • Instant grep, in full
  • Dynamic context discovery, the caveats
  • What is NOT published (do not invent it)

Terms it explains: 4.03 hours, Merkle tree, hash, Merkle sync, 3.2 MB, embedding, content-addressed cache, 92% similarity, SimHash, 4.03 h, 21 s, content proofs, inverted index, trigrams, dynamic context discovery, 46.9%, History, Sparse n-grams, 80%, 21 seconds, identical, +12.5%, +0.3%, +2.6%, +2.2%, candidates, rare, A/B test, agent, Agent Skill, binary search, cache hit, cache miss, candidate, chunk, code retention, content proof, context window, dynamic, dynamic context.

Lab

You saved one file in a 50,000-file repo. How few hashes can the server read to find it, and when does the trick stop paying?

Drag Files edited since the last sync upward, switch to All over the repo, and watch Bytes on the wire pass the list.

Open The tree that knows

Review System Design