So everyone is a generalist. And then Claude is in charge of figuring out how to launch the subagents and which particular subagents to use in which way, exactly the same way that it would use any other tool. So you can think of it as a really intelligent tool where the model can launch more Claudes to do things.
So basically, it's like if you think of AI as an intern, it's like having a group of interns, and every intern has their own role, and then you recombine what everybody did into one. That's exactly right.
And you can define what those roles are.
And it's a fascinating question whether to anthropomorphize human functions into what agents should be doing, or whether there's something that's agent-native in the way the work gets distributed and chopped into smaller parts.
Yeah. In the AI world, we talk a lot about this essay called "The Bitter Lesson." This was a Richard Sutton essay from a decade ago or something.
Where he talks about the more general model, most of the time in the long term, it'll subsume more specific models. And so what this means is, if you build an agentic system in this context, then the more general agentic system will generally outperform the more specific one in the long term. And I think where we're at today is models have the capability to do stuff, but if you give them too many tools or too much context or too much responsibility, it might be disappointing because they won't really know how to handle it.
And the models of a year ago could barely even call tools. The models of today are pretty good at doing it, but get a little bit overloaded sometimes with context or with too many tools. And so we can divide them up into subagents in this way. But I think that the models six or 12 months from now, they probably won't need this anymore because they're all going to be pretty good, and you won't have to define very rigidly what each one's responsibilities are anymore.
And so this is something we're building for people today because we think it's quite useful today, and it's something that we use a lot. But I could also see this going away at some point.
Yeah, there's a concept of context pollution, right? That's one of the ways people describe it, right? And then Claude Code can handle both very precise tasks like debugging or much broader tasks like a broad refactor, for example? Is the idea that the broader the task, the more subagents you would have in the current context?
Yeah, that's probably one way to think about it. Generally, when we introduce Claude Code to new people, we actually suggest that, like you said, Claude Code can do everything. And this is one of the things that makes it a little bit hard to use if you're an engineer that's used to essentially text completions in an IDE. It's a very different kind of AI coding experience. And so generally, the thing that we recommend is start with something simple, like just ask questions about the codebase.
So don't even code, don't use any tools, just ask the model questions. What does this file do? Where is the file that does this thing? If I want to make a new whatever, how do I do that? So just ask it questions like that. And for this, generally the main model can do it, and you don't really need subagents. But then as you get a little bit more sophisticated, you might want to start splitting up the work. So if you ask the model maybe to make a small change, like I said, make the button red or make the button blue, you probably don't need subagents.
But if you do something a little bit fancier, like build a new section of the website that does blah, blah, blah, then you might want to have a few subagents. Maybe one is the software architect, and it's responsible for planning out the work. Another one is maybe some kind of reviewer, where it'll review that plan to make sure it looks good. Then maybe you'll have a few subagents that actually do the implementation. So maybe there's a frontend engineer, backend engineer, this kind of thing.
And then some kind of verifier at the end that verifies it. And then internally, we really love using a code simplification subagent. And its job is to take the code that was produced and just simplify it while making it still work.
Okay, great. So that's the actions part of the agentic workflow. Let's talk about the awareness and memory of this. One of the exciting features is that Claude Code can connect with the existing code knowledge in the company? How does that work?
There's a few different ways to pull in context and this kind of knowledge from the company. The simplest one is just looking at files. There's a few different approaches, actually, to reading files, so I'll go a little bit into depth into the way that actually happens. In the past, the thing that people used the most is this thing called RAG. And essentially, this is a technique where you take the whole codebase, and this actually works for any document, set of documents; it's not necessarily code.
But you take a set of documents like all the files in the codebase, you do this indexing step, and then you store essentially this database of all the knowledge that's in these files in a very, very particular form that makes it really easy for the model to search. There's a lot of trade-offs to doing this. The indexing takes time. It's pretty expensive to maintain this database. It's quite tricky practically to make sure that security is really good and privacy is really good.
Because it's very sensitive information, like your codebase. And so you want to keep it really safe. And so Claude Code actually doesn't use this technique called RAG. Instead, what it does is it just searches files the same way that a human would. You can think of it, at the engineering level, as using the tools glob and grep. These are two tools that are kind of built into the computer. And you can think of it as kind of Command+F for files.
So it'll just search around with text the same way that a human can. And what's kind of cool is if you just search for one piece of text, you might get the result you're looking for, but you might not. And depending on the results you get, as a human, you would refine your search term and you would try again, and you might try a few times to get the result you're looking for. And the model is really good at this. And this, again, this is one of those things that was not the case with models of a year ago.
But with models of today, they're excellent at this. And so we call this process agentic search. And what this means is using really, really simple search tools like Command+F and using them repeatedly and then adjusting the search terms over and over based on the result of the query. And this is something that we don't specifically tell the model to do. It's something that it just figures out because it's intelligent enough and it has the search tool. So this is the first form of memory, which is just looking at the contents of the codebase and understanding it in this way.
CLAUDE.md files. And all this is, is a special file, CLAUDE.md. You put it in your codebase, or you can put it in whatever folder you want, and use it to record memories. So at any point, you can tell Claude to remember something. So, for example, whenever I edit this file, I always want you to double-check it in a browser or something like this. You can tell Claude to remember this, and then it'll record it in the right CLAUDE.md so that it remembers it next time.
And I think one of the most powerful use cases we've seen with this is when people check this into their codebase and share it with their team. So it's a memory file. It's just a regular text file on the computer, but you don't keep it to yourself. You share it with all the other engineers on your team. And what it means is if Claude remembered something when you were using it, everyone on your team gets to benefit from that.
And it gets this really interesting effect where everyone on the team starts to contribute to this knowledge base and this kind of memory bank. And it's very simple. Again, it's a text file, so anyone can read it. It's very easy to edit these memories and see exactly what's in there. But everyone just starts to benefit, and it feels kind of magical because as your team uses Claude Code, it gets smarter and smarter. And kind of similar to building in the CLI, this is literally the simplest thing we could have done.
There's nothing simpler than this, I think, that we could have done to build memory. There's no special tools. There's no special prompting. There's nothing like this. It's just a file, and Claude kind of learns to use it.