# Turn past code and mistakes into compounding leverage

Markdown copy of https://realalpha.app/s/turn-past-code-and-mistakes-into-compounding-leverage/ on Real Alpha, the best minutes from long interviews with the people building AI. Cite and link the page, not this copy.

- Speaker: [Boris Cherny](https://realalpha.app/builders/boris-cherny/) · Creator of Claude Code, Anthropic · Created Claude Code at Anthropic and leads its team; previously spent about five years at Meta.
- Host: [Dan Shipper](https://realalpha.app/people/dan-shipper/) · Co-founder & CEO, Every · Sold his first startup, Firefly, to Pegasystems; writes Every's Chain of Thought.
- Show: AI & I
- Episode: [The Secrets of Claude Code From the Engineers Who Built It](https://realalpha.app/v/IDSAMqip6ms/), Oct 29, 2025
- Moment: 26:11 to 33:07 of the episode (7 min), playing on https://realalpha.app/s/turn-past-code-and-mistakes-into-compounding-leverage/; the episode from there: https://realalpha.app/v/IDSAMqip6ms/?t=1571

## Quote

> “So for stuff that's enforced pretty often, we actually have a bunch of internal lint rules. **Claude writes a hundred percent** of these.”
> — [Boris Cherny](https://realalpha.app/builders/boris-cherny/) at [32:20](https://realalpha.app/v/IDSAMqip6ms/?t=1940) · AI & I

## Takeaways

1. Ask Claude to add recurring lessons to project instructions.
2. Turn mistakes into tests so they do not recur.
3. Use lint rules to enforce conventions across the codebase.

## About this segment

Dan describes codifying lessons from each feature into prompts and tools; Boris Cherny shares how tests, rules, and project instructions preserve that knowledge. This makes unfamiliar codebases easier to work in.

From “The Secrets of Claude Code From the Engineers Who Built It”, Oct 29, 2025. [Watch the full episode](https://realalpha.app/v/IDSAMqip6ms/)

## Transcript

From the transcript AI & I publishes with the episode.

[26:16](https://realalpha.app/v/IDSAMqip6ms/?t=1576) One of the things I found is, and this is both for projects inside of Every and then just open source projects, it's like if you're someone building a product and you want to build a feature that's been done before. So maybe like an example that people might need to implement a bunch is like memory. How do you do memory? Yeah. because we have a bunch of different products internally, you can just like spawn cloud sub agents to be like, how do these three other products do it?

[26:42](https://realalpha.app/v/IDSAMqip6ms/?t=1602) And there's like possibility for just like tacit code sharing where you don't need to like have an API or you don't need to like ask anyone. You can just be like, how do we do this already? And then use the best practices to build your own. And you can also do that with open source because there's like tons of open source projects where people are like, you know, they've been working on memory for like a year and it's like really, really good.

[27:02](https://realalpha.app/v/IDSAMqip6ms/?t=1622) And you'd be like, what are the patterns that people have figured out and which ones do I want to implement? Totally. You can also connect to your version control system if you've built a similar feature in the past. Cloud Code can use those APIs like query GitHub directly and find how people implemented a similar feature in the past and read that code and copy the relevant parts. Yeah, is there, have you found any use for log files of okay, you know, here's the full history of, like, how I implemented it, and, like, is that important to give to Claude, and how are you implementing that or making it useful for it?

[27:41](https://realalpha.app/v/IDSAMqip6ms/?t=1661) Some people swear by it. There are some people at Anthropik where for every task they do, they tell Cloud Code to write a diary entry in a specific format that just documents like what did it do? What did it try? Why didn't it work? And then they even have these agents that like look over the past memory and synthesize it into observations. I think this is like the starting budding thing. like there's like something interesting here that we could productize.

[28:08](https://realalpha.app/v/IDSAMqip6ms/?t=1688) But it's a new emerging pattern that we're seeing that works well. I think the hard thing about like one-shotting memory from just one transcript is that it's hard to know how relevant a specific instruction is to all future tasks. Like our canonical example is, if I say make the button pink, I don't want you to remember to make all buttons pink in the future. And so I think synthesizing the memory from a lot of logs is a way to find these patterns more consistently.

[28:39](https://realalpha.app/v/IDSAMqip6ms/?t=1719) It seems like you probably need... There's some things where you're going to know... You'll be able to synthesize or summarize in this sort of top-down way. This will be useful later, and you'll know the right level of abstraction at which it might be useful, but then there's also a lot of stuff where it's like you actually... Any given commit log, like make the button pink, it could be useful for...

[29:03](https://realalpha.app/v/IDSAMqip6ms/?t=1743) kind of an infinite number of different reasons that you're not going to know beforehand. So you also need the model to be able to look up all similar past, you know, commits and surface that at the right time. Is that something that you're also thinking about? Yeah, I think there could be something like that. Maybe I think one way to see it is this kind of like traditional memory storage work, like Memex, like kind of stuff where you just want to like put all the information into the system and then it's kind of a retrieval problem after that.

[29:37](https://realalpha.app/v/IDSAMqip6ms/?t=1777) Yeah, I think as the model also gets smarter, it naturally, I've seen it start to naturally do this also with Sonnet 4.5, where if it's stuck on something, it'll just naturally start looking, like we talked about before, like using Bash spontaneously to just like look through Git history and be like, oh, okay, yeah, this is kind of an interesting way to do it. Yeah. One of the things that we were talking before we started recording, one of the things that we're doing inside of every, I feel like it has really changed the way that we do engineering because everyone is cloud code-pilled, like CLI-pilled.

[30:08](https://realalpha.app/v/IDSAMqip6ms/?t=1808) And we have this engineering paradigm that we call compounding engineering where we're doing it. in normal engineering, every feature you add, it makes it harder to add the next feature. And in compounding engineering, your goal is to make the next feature easier to build, um, from the feature that you just added. And the way that we do that is we try to, um, codify all the learnings from, um, from everything that we've done to build the feature.

[30:31](https://realalpha.app/v/IDSAMqip6ms/?t=1831) So like, you know, how did we make the plan and what parts of the plan needed to be changed? Or like when we started testing it, like what, what issues did we find? What are the things that we missed? And then we codify them back into all the prompts and all the sub agents and all the slash commands so that the next time when someone does something like this, it catches it and that makes it easier.

[30:48](https://realalpha.app/v/IDSAMqip6ms/?t=1848) And that's why for me, for example, I can like hop into one of our code bases and start, you know, like being productive even though I'm I don't know anything about how the code works because we have this like built up memory system of um of all the stuff that we've learned as we've implemented stuff but we've had to build that ourselves I'm curious are you working on that kind of loop so the cloud code does that automatically Yeah, we're starting to think about it.

[31:17](https://realalpha.app/v/IDSAMqip6ms/?t=1877) It's funny, we heard the same thing from Fiona. She just joined the team, and she's our manager. She hasn't coded in like 10 years, something like that. And she was landing PRs on her first day. And she was like, yeah, like not only did I kind of, I forgot how to code and quad code kind of made it super easy to just get back into it, but also I didn't need to ramp up on any context because I kind of knew all this.

[31:41](https://realalpha.app/v/IDSAMqip6ms/?t=1901) And I think a lot of it is about like when people put up pull requests for quad code itself. And I think our customers tell us that they do like similar stuff pretty often. If you see a mistake, I'll just be like, add quad, add this to quad MD so that the next time it just knows this automatically. And you can kind of like instill this memory in kind of a variety of ways. So you can say like, add quad, add it to quad MD.

[32:05](https://realalpha.app/v/IDSAMqip6ms/?t=1925) You can also say, add quad, write a test. That's like an easy way to make sure this doesn't regress. And I don't feel bad asking anyone to write tests anymore. Right. It's just like super easy. And like, I think probably close to 100% of our tests are just written by quad. And if they're bad, we just won't commit it. And then the good ones stay committed. And then also I think lint rules are a big one.

[32:24](https://realalpha.app/v/IDSAMqip6ms/?t=1944) So for stuff that's enforced pretty often, we actually have a bunch of internal lint rules. Claude writes a hundred percent of these. And this is mostly just like at Claude in a PR, write this lint rule. And yeah, there's sort of this problem right now, about like how do you do this automatically? And I think generally how like Kat and I think about it is we see this like power user behavior And the first step is how do you enable that by making the product hackable so the best users can figure out how to do this cool new thing.

[32:52](https://realalpha.app/v/IDSAMqip6ms/?t=1972) But then really the hard work starts of like, how do you take this and bring it to everyone else? And for me, I kept myself in the everyone else bucket. Like, you know, I don't really know how to use Vim. Like, I don't have this like crazy like T-box setup. So I have like a pretty vanilla setup.
