← All AI Engineer talks

AI Engineer Europe 2026

Benchmarking semantic code retrieval on Claude Code

About this talk

Kuba Rogut of turbopuffer benchmarks semantic code retrieval in Claude Code against conventional grep-based exploration. He explains embeddings as cached computation, demonstrates a TurboGrep/TPuff Search tool that chunks code, embeds it with a Voyage code model, and indexes it in turbopuffer, then compares baseline Claude Code, 50-line windowed reads, and windowed reads augmented with semantic search. The talk contrasts Cursor’s integrated Composer retrieval approach with adding search as an external tool and concludes with audience questions about semantic search, vector databases, and workload tradeoffs.

Chapters

  1. 0:00Introduction: turbopuffer and Claude Code search
  2. 1:23Cursor results and embeddings as cached computation
  3. 4:03Building TurboGrep with Voyage embeddings and turbopuffer
  4. 5:54Benchmark conditions and retrieval tradeoffs
  5. 11:07Audience Q&A: semantic search, vector databases, and scaling

Talk transcript

  1. 0:00

    [upbeat music] Hi, everyone.

  2. 0:16

    Uh, welcome to Benchmarking Semantic Sear- or Semantic Code Retrieval on Claude Code. Uh, my name is Kuba. I- I'm here from TurboPuffer. For those unfamiliar with TurboPuffer, we are a serverless full text and vector search database built from first principles on top of object storage.

  3. 0:29

    Uh, we serve some of the fastest growing AI companies in the world. And if you'd like to know more about the talk or any question about TurboPuffer or anything, just find-- feel free to find me after.

  4. 0:38

    Uh, so let's get started. So for those of you who are unaware, uh, Claude Code by default, or I mean, yeah, by default doesn't use semantic code search. Uh, there's actually a tweet from Boris.

  5. 0:47

    Uh, those unfamiliar with Boris, he's essentially like the founding father of Claude Code, and he talks about how Claude-- the early versions of Claude Code did actually use semantic search with a local vector DB, but they just kinda found agentic search, essentially, you know, grepping through your file system kinda worked better and, you know, seems to work

  6. 1:02

    simpler for, for Claude Code. However, uh, one of TurboPuffer's customers, actually, fun fact, one of our very first customers, Cursor, uh, does use semantic code search and does in-index codebases into TurboPuffer.

  7. 1:14

    And you may think, like, this seems like a lot of work, and it kind of is. But the reason they do this is because they see r-real performance gains because of this.

  8. 1:23

    Uh, they have this amazing blog post, uh, about their semantic search. They also have one about indexing codebases, which I highly recommend as well. Uh, but you can see on the right, the kind of performance gains they see with a Composer model is like twenty-four percent, uh, increase in an- or relative improvement in answer accuracy.

  9. 1:38

    And I think it's like twelve and a half or thirteen percent across, uh, all models. And, you know, I, I-- This benchmark came up, uh, before Composer 2, but you can probably imagine there's some sort of similar performance gains with that, that new model as well.

  10. 1:49

    And in the bottom right, you can see, uh, this is from-- So this same blog post, uh, they talk about how in-- they performed an online A/B test where they found that adding semantic-- either allowing or disallowing semantic, uh, code search led to, like, a two point six percent increase in code retention in large codebases and an

  11. 2:05

    n-two point two percent decrease in dissatisfied user requests. And you may also think, like, these numbers seem kinda small, like what, two point six percent, two point two percent?

  12. 2:14

    Um, well, keep in mind that, you know, out of a hundred queries, not all queries will ever really need semantic search or, like, benefit from it. Uh, so these-- They even state in the blog post that these numbers look small because not every-- You know, you could imagine a very simple tool call or very simple query would

  13. 2:29

    not really use semantic search. Um, so what we think about here at TurboPuffer and why we kind of really, uh, think vector search and why Cursor probably sees this, like, real performance gain is we think about how embeddings are cache compute.

  14. 2:44

    And you could also, you know, what does even-- what do you mean cache compute? This sounds like a bunch of baloney you're throwing at me. Um, you know, if we would, like, walk through, like, a Claude Code trace and, like, a Cursor s-type trace of kind of the same thing, you can imagine that, uh, on the left

  15. 2:56

    side, there's kind of like a, you know, grepping through the file system or what they call agentic search, um, how it just has, like, grep through. Uh, this is for finding metadata filtering and understanding it in your codebase.

  16. 3:05

    It essentially grep through, read the files, grep through more if it doesn't find the right things. And again, this is repeated on every session across, you know, every agent, um, running in, you know, uh, for the same codebase so that even if you're asking the same question or trying to do the same thing multiple times, you always

  17. 3:21

    have to do this compute again. And you can see, like, in this case, six thousand tokens isn't a lot in one time, but across every session and every agent, this really starts to add up.

  18. 3:29

    And if we-- You know, on the right, if this is more of a, like, Cursor style or Cursor level trace, where you have this upfront cost, where we have to, like, chunk, embed, and index the codebase.

  19. 3:37

    But then you essentially have this cache of the semantic meaning so that when a f-when an agent wants to understand, you know, where or how does metadata filtering work, uh, it can simply query, you know, how is metadata filtered and get a lot, uh, get the chunks it needs and kinda the understanding it needs a lot faster

  20. 3:54

    and, uh, with token savings. And again, this doesn't-- It's not a lot of savings in one time, uh, but we all, you know, we're not really running one agent anymore.

  21. 4:03

    Like, I'm running, like, three at one time. So, um, there's definitely some l-long-term savings. So, uh, what we did, what we did is we built a simple CLI tool for Claude Code.

  22. 4:12

    Is-- We call it TurboGrep. Um, it's essentially, you can imagine, it's just a simple way of, um, using a tree splitter library to essentially parse through your codebase, uh, chunk it, embedding using the Voyage code model, and then upload it to TurboPuffer.

  23. 4:26

    Um, this is just a simple, um, file system walkthrough. Uh, there is an open source library for the V1 version, and then soon the V2 version will be, uh, open sourced.

  24. 4:37

    Um, here there's a little video of example a, a tool call trace for a Claude Code where you'll see, uh, it will call the TPuff tool. Now, it's called TPuff Search Password Reset Token Generator.

  25. 4:49

    This is in the, uh, Django repo. This is one of the, the repos I was testing it on. And you can see that, uh, it gets the content and then is able to kind of give the full, um, explanation to the user.

  26. 5:02

    And, you know, it's very easy to say, like, "Oh, this works better," but the important thing is obviously benchmark. Let's see for real, what, what-- how much better does it work?

  27. 5:10

    Uh, Cursor has their own internal, uh, context bench, and there's this paper, this public paper called Context Bench, um, where essentially the benchmark is not really testing whether or not the coding agent solved or didn't solve a problem.

  28. 5:22

    It tests when it-- In the process of solving the problem, did it find certain files? Did it s-find certain lines and did it find certain symbols? Because they, you know, they kind of have this, uh, this thesis that, like, it, you know, it's also important how you get there, not just, um, like, the end goal.

  29. 5:39

    The process really matters for understanding, like, are agents actually looking for the right files? So essentially, it's a human-labeled data set of, like, in order to complete this task, the, the agent should have looked at this file, these few lines, and these few symbols in order to, like, actually complete the task well.

  30. 5:54

    Uh, and I tested it with three conditions. Uh, essentially raw Claude Code out of the box. Uh, then I tested it with Claude Code with a fa- uh, the max of fifty line reads at a time.

  31. 6:03

    And then, uh, the same thing with the windowed reads, uh, with the TPuff Search tool. Uh, you may ask me, like, why this, like, fifty line read, uh, thing.

  32. 6:10

    ... or limit. It's because it's, it became really noisy really fast. If it's just reading, like, long files, it's really hard to, like, understand, uh, and get a difference because it all ...

  33. 6:19

    If it just reads a whole f- like, a thousand line file, it doesn't really make a lot of difference in the numbers.

  34. 6:24

    So we'll start with the first result of it. Uh, this is precision. Precision is essentially the, [coughs] the measure of, of how many files did it read, like, in its total process, how many of them were actually golden files.

  35. 6:37

    So if there was ... If the, if Claude read 10 files and eight of them were needed, it hits 80% precision. Uh, you can see the baseline, it hit, like, 65% precision, 33% on line precision, and 43% on symbol, and it kind of goes up as we add windowed grep.

  36. 6:52

    And then windowed grep plus semantic search got it to, like, 87% file precision, for example. Uh, and this is also due to the fact, like, Claude Code by default, like, is really exploratory.

  37. 7:00

    It loves to read as much as it can and, like, try to read everything, for example, and it kind of shows up in the 65% precision. Um, and, like, it's hard to, like, translate these numbers, but a more, like, English or, like, human version of it is that, you know, Claude Code, one in every three file reads

  38. 7:15

    is actually just a completely wasted file. Um, and with windowed grep, it was one in five reads was a irrelevant file. And then with semantic search, it was only one in eight files was a, you know, quote, unquote, "wasted or irrelevant file."

  39. 7:27

    And it kind of, like, scales up as you kind of add these tools.

  40. 7:30

    And, you know, obviously this, this is already, like, pretty good. Uh, then we have recall. Recall is essentially how many of the needed files did it find. So for example, if there was 10 files in the task that it should have found, if Claude found five of them, five files in its total trajectory, and only three of

  41. 7:46

    them were actually these golden files, it would hit 30% recall. Um, by default, again, uh, Claude Code actually does win the file recall. And again, part of this is because it just loves to explore every single file it can.

  42. 7:58

    Um, then we have line recall, where it drops a lot more. This is kind of a ... Because it loved to read a lot of files, but also read to le- read a lot of files that didn't have a lot of, uh, golden context lines.

  43. 8:10

    So you can kind of see that even though it did explore a lot, it also kind of explored the wrong things a lot. And then with grep and grep plus semantics, or windowed grep and windowed grep plus semantic search, kind of about the same recall.

  44. 8:20

    Uh, you can kind of see on the right, like, kind of the, what happened with the behavior between these three conditions. Uh, and you may be thinking like, "Well, you know, semantic search didn't really, like, add improvements here.

  45. 8:29

    Like, what, what, what went wrong?" Like, actually some decreases. And we can, like, dig in a little further into the recall numbers for certain tasks. This was across, uh, 50 tasks by default.

  46. 8:38

    Uh, but if we break it down into where semantic search won, you know, quote, unquote, "won," and where just, like, windowed grep won, we see some stark differences between, like, certain tasks performed a lot better with semantic search, uh, allowed, and then certain tasks performed a lot better with, with no semantic search.

  47. 8:54

    And this kind of proves, um, you know, certain tasks require s- different types of tools. For example, when semantic search won, uh, it was really good at finding a lot of behavior adjacent files that didn't have the same kind of keywords.

  48. 9:06

    For example, it was like ... I think one example off the top of my head was with trying to, like ... It was, like, multi... Like, first handle lots of different ORMs that have to, like, handle across, uh, different libraries, and it didn't by default, the keyword search didn't by default find all of them, but behaviors, uh,

  49. 9:19

    semantic search was able to kind of, like, understand these are all related files. Uh, and then grep won when it was really good at just ... The task was a lot about, like, tracing through imports, and if it, like, was able to find the keywords in, like, the first or second, uh, tool call, it was able to,

  50. 9:34

    like, just keyword search through that and find the relevant files. So again, it's like two different types of, uh, how to find files, but they kind of lead to, like, really different results.

  51. 9:43

    So in summary, like, what does this mean? Well, we, we saw semantic search, like, did boost precision quite a bit. Uh, and we, like, kind of understand, like, grep and semantic search kind of find different code different ways.

  52. 9:55

    Um, and an interesting thing to note as well was, um, these numbers weren't as great as Cursor's because part of, like, part of Claude Code is it's built for just grepping.

  53. 10:05

    Like, that's, that's what Anthropic kind of focuses it on. Like, it's not built to under- like, to really understand, like, when to call semantic search or how to call it.

  54. 10:14

    Uh, we kind of, like, add it as an extra tool, and it's like, "Hey," like, "here's this cool tool. You probably should use it sometimes," but it's very hard for it to have a true understanding of when to use it, why to use it, uh, versus, like, like, for example, Cursor's Composer model, they understand this is a

  55. 10:27

    built-in tool that, um, it knows when and how to use it, and that's why they saw this, like, 23 and a half perfor- uh, percent, uh, performance gain. Uh, so, like, in summary, uh, you know, we think long-term winners will find con- kind of provide these lightweight tools to find the right context in various different ways, and

  56. 10:43

    I think it's something important to think about. Uh, you can't just, like, grep through everything, unfortunately, in a file system. Uh, we think there's a lot of different ways to access lots of different types of information, uh, and the people that provide these, like, easy tools to provide, to shrink down these billion context windows into the right

  57. 10:58

    million, uh, will win in the long term. Um, that's the general talk. Thank you. If you have any questions, feel free to come up. [audience applauding]

  58. 11:07

    I have my own idea of what semantic search is, but could you define what you, what your definition is of semantic search?

  59. 11:13

    Sure. Uh, so this was just, uh, just doing vector search. It was just performing vector searching, uh, embedding it using Voyage's code model, and then just embedding the th- the, the query, um, query sentence or, uh, query tokens, and just sending them back to Tur- to TurboPuffer.

  60. 11:28

    Yeah.

  61. 11:29

    Uh, sorry. But which, uh, embedding model are you using?

  62. 11:32

    Uh, Voyage Code 3.

  63. 11:34

    Okay. And which vector DB?

  64. 11:36

    TurboPuffer.

  65. 11:37

    Ah, okay. [laughs]

  66. 11:38

    Yeah.

  67. 11:38

    Sorry. [laughs]

  68. 11:39

    Oh, no worries. Yeah, yeah. Yeah, for those, for those who are unfamiliar with TurboPuffer-

  69. 11:43

    That's all right

  70. 11:43

    ... we are the, we are the vector database that powers companies like Cursor, Anthropic, Notion. So when you use something like Cursor, uh, you have by proxy used TurboPuffer.

  71. 11:53

    Um, so you may know us just not by name, I guess.

  72. 11:58

    So...

  73. 11:58

    I just wanted to ask, you may not have a benchmark for this, but how does it perform on shit code?

  74. 12:04

    Oh, that's, that's tough. I mean, it's hard to say.

  75. 12:08

    Is grepping better or is semantic better for code that- That sort it out

  76. 12:12

    Uh, so I think it works best when there's a lot of d- like, comments-

  77. 12:17

    Mm-hmm

  78. 12:17

    ... on code, uh, because it kind of provides that semantic meaning

  79. 12:20

    So working alongside, like, documentation that's kind of inline?

  80. 12:22

    Yeah, if it's like inline documentation, that was like a big, um, boost. I believe, uh, one of the repos I remember, like, looking through some trajectories and, like, asking Claude, be like, "Why did it perform so well here versus not?"

  81. 12:32

    And it was when it, it kind of explains to me like, um, when I was looking through as well, like, those with, like, really good comments, for example, just, like, comments about the function, it's able to, like, really understand a lot more 'cause you, you kind of give this context to the model and the embedding model so

  82. 12:45

    then it can, like, actually search better. Um, 'cause that's, that's part of it. Like, the, the embedding i- and, uh, is not the hard part. It's, like, figuring out what meaning really is of that chunk.

  83. 12:56

    Yeah.

  84. 12:58

    Okay.

  85. 12:58

    Yeah, you may have, you have, you've mentioned some of it now, but of course semantic search is just similarity search, so if your query doesn't really match the format of what you're querying against, then you get some kind of innate distance.

  86. 13:12

    Do you do any kind of pre-processing of what your, uh, of the target data before you... Like, do you do any parent-child where the parent is query-ish and the child is the real code?

  87. 13:23

    Or how do you-

  88. 13:24

    In, in this case, it was just simple, just-

  89. 13:26

    Yeah

  90. 13:26

    ... just the code.

  91. 13:26

    Just the raw code?

  92. 13:27

    Yeah, just the raw code, just as a thing. But, um, uh, I can't speak for, like, how these more complicated and sophisticated customers use this, but I can imagine it's definitely something of providing not just code level meaning, but, you know, as you said, at least a parent-child relationship of like-

  93. 13:40

    Yeah, like the authentication flow. Like, that could be a good query to do a similarity search against, but the code itself is more, like, raw code, so.

  94. 13:47

    Yeah. Yeah. Like, Cursor has their own embedding model, which I think kind of helps with this, of like how do you translate code into more of, like, a human level-

  95. 13:54

    Yeah

  96. 13:55

    ... like, query. And I mean, they're kind of been experts on that. I can't speak for how they do it, but I just know they do do that.

  97. 14:01

    Yeah.

  98. 14:01

    Yeah.

  99. 14:01

    I think they actually do what you said, like they create fake comments on top your, of your code, and they embed the code with the comments.

  100. 14:09

    Yeah.

  101. 14:09

    So that's how they can have, like, the higher recall when, uh-

  102. 14:14

    Oh, okay. Yeah

  103. 14:15

    ... they search all the code.

  104. 14:15

    So they add, they kind of inject comments?

  105. 14:17

    Yeah. Yeah.

  106. 14:18

    Yeah, something like that I think definitely could work, yeah.

  107. 14:21

    Interesting.

  108. 14:21

    In the back?

  109. 14:22

    Yeah. I was gonna ask, like, how do you see, uh, I guess, the vector database, uh, kind of working with the Rennis and, and how, like, when do you encode, like, long term memory to reduce the size of the, uh, database?

  110. 14:38

    I mean, I think it depends. Like, obviously the easiest way, like, people love grepping because it's zero cost. Like, if you're able to, like, download everything to your local file system and just, like, grep through it, like, yeah, that works.

  111. 14:48

    Um, I think vector DBs are built for essentially, like, multiplayer and, like, this, like, super [cough] maybe in a sense, like, hard to understand or, uh, complicated relationships between lots of data.

  112. 14:58

    For example, like a knowledge base, like a Notion. Like, you can imagine kind of hard to, like, really grep through that really easily on your local machine. Like, it's in a sense best to, like, have that vectorized, uh, for the agents.

  113. 15:09

    Um, and even stuff, like we have customers doing stuff like with multimodal data. Like, you can't really grep through a video file. You can't grep through an audio file.

  114. 15:15

    You can't grep through an, an image file. Like, maybe you can glob on the, on the filename, um, but to, like, get a true understanding the kind of multimodal datas as well is, that's something that we find a lot of customers are doing.

  115. 15:26

    Um, so and it just kind of depends on the workload and, um, I, I, yeah, if you're, if you're hitting qu- like at some sort of even, like, miniature scale, like a vector DB kind of like helps offload a lot of this, this work into, like, you know, cache compute- cache this semantic meaning.

  116. 15:42

    Um, any other questions? Perfect. Thank you all. [audience applauding] [upbeat music]