What did we learn from the March 31st Claude Code Source Leak?
Explore Claude Code's architecture, KAIROS daemon, Ultraplan, and memory systems. Learn about deferred tooling, local caching, and the competitive moat of its engineering "plumbing."
Overview
This technical analysis, presented by Daniel Motles of Qumulo in April 2026, dissects the architecture and leaked details of Claude Code. Claude Code is a Bun-native TypeScript application with a React and Ink terminal UI, functioning as a productized agent operating system. The system is composed of 1,902 source files totaling 512,685 lines of code. Its technical stack includes the Anthropic SDK, MCP integrations, and native tools for Git, Shell, and LSP. A major finding is the discovery of KAIROS, an always-on autonomous daemon that runs heartbeat prompts every 30 seconds to identify tasks, fix errors, and manage memory consolidation. Other unreleased features include Ultraplan for deep thinking via remote Opus variants, Coordinator Mode for spawning sub-agent forks, and an internal Undercover Mode that strips AI signals from public commit histories. The system utilizes a heavyweight persona driven by a massive system prompt and a four-tier MD memory system covering users, feedback, projects, and references. To preserve context window space, Claude Code uses deferred tooling and a local LRU cache to prevent redundant token consumption. Local search is handled by a parallelized Rust-based engine called RipGrep (rg). The analysis concludes that the engineering “plumbing”—the tools, memory, and safeguards—constitutes the product’s primary competitive moat. While the leak has spurred open-source clones, it has also raised enterprise concerns regarding release hygiene and intellectual property safety.
Video
Transcript
Generated 3 months ago
Summary
Generating a talk summary...
View full transcript
Speaker 0: The the breach of Claude Code and the leaking of all the code is very exciting
Speaker 1: because anytime you screw up at work,
Speaker 0: not that bad. Okay. Well, let's get this, presentation to where we're here. So I did do oh, wait. I gotta show the screen because We don't usually do slides, but we we
Speaker 1: like I know. I had So I had a few slides because the content. Right?
Speaker 0: I And you have to pepper it with questions as well.
Speaker 1: I'm covering I'm covering something which is, would be hard to show you directly, just because it's sensitive in nature. So legal disclaimer, I do not have access to the source code anymore. And you're not looking at it. And so, if there's work or anthropic, please don't sue me. Okay.
Speaker 1: So, overall, it's if you're not familiar with Claude Code, everyone here, 80% of you probably use it. But it's basically a fun TypeScript application underneath. And, really, 1 of the things that I thought was interesting is really only 1% of the code is really about the main agent loop. The rest of it is, like, MCP tools, like system prop setup, all the crazy integrations they have. So a very small part of it is just, like, managing the agent loop, and the rest of it is really about, all the other stuff that CloudCo can do, really making a full injector system.
Speaker 1: So the top things that came out, especially in the news, was, they have this thing called Kairos that they're working on, which isn't released yet. This is stuff I heard on the Internet, not stuff from the source code. And, it is, really if you look at what they're trying to do, it really seems like they're trying to go after Open Claw a little bit here. They've got basically a heartbeat type system that's running every 30 seconds looking for stuff to do. It's got stuff that, like, has, like, a memory loop that called Paulo dream, which is very much like OpenCode.
Speaker 1: And then, there's a bunch of other, you know, persistent background management stuff. The other thing that they you know, if you guys remember back in the day, you could type Ultraplan into Cloud Code, and it would, like, think harder. So now they're, like, working on UltraPlan, which we should all be excited for, which is apparently a way where it will go off with Opus and plan for, like, 30 minutes straight without thinking with or with deep thinking before user approval. So, that would be fun when that comes out. There are also the coordinator mode, which hasn't been released yet.
Speaker 1: And I think 1 of the things that was most kind of controversial that came out is there is an anthropic only mode, which is it is you actually have to build it differently. It's like it requires special build flags to go in anthropic only mode, so we don't have access to that. But there when it you're in anthropic only mode, it detects if you're working on an open source repo, and it it's, like, hide it, like, won't do the, you know, coauthored by cloud code thing on the commits. And, like, it will it it has instructions not to reveal anything internal about cloud code. I thought that was, like, really sneaky of anthropic having this undercover mode.
Speaker 1: I think a lot of other folks thought that was pretty sneaky as well. I I was really interested I'm I'm working kind of like on, you know, everyone here is like, how do I orchestrate more agents? Everyone's probably working on their own little mini orchestration system. But 1 thing I was really interested about is, like, how the system prompt really works, right, and like what's in it. And so it's really got, you know, by default when you're, like, in the REPL, it's got this, like, set of instructions about, like, here here's how you use the tools, some stuff about security and safety, how you should talk to the user.
Speaker 1: So it's kind of like actually a bunch of information in there about, like, behavior and performance that, you know, we rely on, which we probably don't even realize is there, as well as, like, the memory system. And it even has things like, okay. This is the operating system that the user is currently using. This is the shell that they're using. Right?
Speaker 1: This is the git repo. This is the untracked files. So it has actually all that stuff when it comes up online. It can see all of that automatically. 1 thing you can just do is be like, hey.
Speaker 1: Let's use the context window right now, and it'll give you that dump. But 1 thing I found that was interesting is it actually if you use dash dash print or you use, like, the output function where it streams JSON, which if you're building your own orchestration system, I'm guessing is it who's here building your own orchestration system or has messed around with this a little bit? So some of you probably messed with this stuff. Right? If you use those features, it actually does not inject the default system prompt.
Speaker 1: It's actually much more sparse than that. It'll still put the clawed m b in there, but it's not gonna put the default system prompt in. So you might have noticed, or maybe you haven't, but in print mode, by default, it's very, very sparse on the system prompt, which means that the behavior is actually different when you're in this non interactive mode versus when you're in the in the interactive mode itself. This can be a good thing, and then, like, hey. Maybe you wanna really control the behavior of that agent, and you don't want any of and robotics crap polluting it.
Speaker 1: But it also could be a bad thing if you want basically a version of the client code that you're used to interacting with running autonomously in the background. So just something if you can mind. The other thing I thought was interesting was the web fetch and web search functionality, which, like, the web search functionality is actually just calling an API on anthropic site. And so web searching is running on anthropic servers, and then it's sending some results back. WebFetch is actually executing from your process running on your box.
Speaker 1: And so it'll go out, it will use Axios, which is just an HTTP library to go pull that stuff in. It will do different things depending on the type the content type. So if it's like markdown, it'll treat you differently from, like, if it's a binary file, it'll actually try to download it, versus if it's HTML, it'll actually try to turn it into markdown. And then 1 of the things I thought was really interesting was that they have a white list of around 95 domains and addresses that if your address is in there, it will not prompt the user for approval. And Paulo it might even pass it through straight through without running it through Haiku first.
Speaker 1: Right? So I don't know if you noticed, but WebFetch takes a while, and that's usually because it's taking in the web page and running Haiku over it to kind of extract the key information that the user was prompting for. So it doesn't do that with these, like, this preapproved list. And I thought that was interesting because it could be, like, this is like the new channel to your users, the new channel to your customer. How do I get on that list?
Speaker 1: You know, how do I get my website on that list so that Cloud will just go get to that website without processing the user for permission?
Speaker 0: 100%.
Speaker 1: And the final thing, just kind of the overall big takeaway. I think that what's interesting is, like, this seems like the moat is the plumbing. Right? Like, it's it's all this stuff together is really what makes Quantico powerful. It's not just the model by itself.
Speaker 0: The model does a lot,
Speaker 1: but it's like the the actual plumbing, the all the stuff that they've done is, I think, kind of a the thing that's really giving, anthropic that advantage, at least in the pod field space. So, yeah, that's, hopefully, I'm there 5 minutes.
Speaker 0: Daniel, you you are open, but it was such a brilliant talk. A big round of applause. So before we go to my mom who's the next speaker, do we have questions for Daniel? Yes. Can we run a mic down there, please?
Speaker 1: I mean, I'll be quick. Who who is on the list? You've got a lot of like, so oh, wait. Okay. Here we go.
Speaker 1: Off the top of my head, obviously, anthropic stuff, anthropic properties, certain repos on GitHub. You've got, like, all the major, like, frameworks, you know, Next. Js, blah blah blah. Like, all that stuff in there. Right?
Speaker 1: You've got, I'm trying to think of something else that was interesting in there. Oh, you got GitHub repos, but there's specific like, only certain GitHub repos. Right? So it's not all GitHub. Right?
Speaker 1: So it's it's it's constrained to try and make it so it's safe safe default.
Speaker 0: Any other questions?
Speaker 1: There are a couple of.
Speaker 0: Yep. So, you say the moat is the plumbing. And I think especially nowadays, that is not a very defensible moat. So, like, I mean, there's I'm curious about your thoughts on that. Well, I think if you
Speaker 1: don't accidentally link your source code to woah.
Speaker 0: No. No. You gotta mute that. It's it's like looping. We're we're all in time right now.
Speaker 1: Link your source code
Speaker 0: on the Internet.
Speaker 1: You and, like, you know, you're not leaking your system prompt. I mean, you actually have, like, a lot of complexity that you could bake in. It's not easy to reproduce. Right?
Speaker 0: So I
Speaker 1: think that's where, really, I think, like, that that's I mean, think about, like, all the when you're building your own orchestrator, you're doing all these reps
Speaker 0: to try
Speaker 1: and make sure that it executes end to end smoothly and it behaves, like like, in a way that's reliable and predictable. And that just takes a lot of reps that go through the system and make sure it's all wiring up correctly.
Speaker 0: Right. This is this is why I'm explaining you the hook is like you're the infinite. I'm just out of seeing this. Yeah. 1 more question, and then we're gonna keep going.
Speaker 0: Yes. Was there enough coding that you could basically do your own build? They will use that a, like, only It was like all stuff was released and
Speaker 1: It was, like, basically the whole source code. Yes. Yeah. It's the whole thing. All it all split up.
Speaker 1: So basically If you Google around, you know, ask your buddy, you know, find a dark bar, z, you know
Speaker 0: Find Daniel. Find it. It's not that hard to get. Alright. Thank you so much, Daniel.
Speaker 0: Everyone find Daniel out here. So I'm pretty excited to introduce 5 of so I