Getting the transcript
Reading the captions from YouTube. A video nobody has opened here before takes 10 to 30 seconds; this page fills in on its own.
Getting the transcript
Reading the captions from YouTube. A video nobody has opened here before takes 10 to 30 seconds; this page fills in on its own.

AI Engineer · @aiDotEngineer
This video has no Most replayed graph yet: YouTube shows one only once a video has enough views. These are the moments viewers replayed most in AI Engineer's most watched videos.
Most replayed moment at 18:45
4.8x that video's typical replay level
that they're they're changing they're changing things in the database not yet. You want to run them through the ontology first and make sure that works. Okay. I only got an I've got I've got another I've just a short time. I'm going to try to show you some of the things that um that you can
Said at 18:37
Most replayed moment at 16:13
3.6x that video's typical replay level
method signatures, the program layout and the call stacks. So here's some examples. I don't think you'll be able to read this one, but this is like the level of abstraction we're at. It's how we're actually going to lay this stuff out and how these systems are going to interact. Dylan Mulroy from Cloudflare talks a
Said at 16:06
Most replayed moment at 13:49
2.3x that video's typical replay level
Fable uh and it runs into an unknown, ask it to log it, right? So that um you uh you can see where the deviations happened and then you can sort of figure out why as well, you know? It will usually give you some context about what happened.
Said at 13:43
The graph counts replays. It does not show where viewers stopped watching.
Words
2,821
Runtime
18:19
Speaking pace
154wpm
Reading time
12min
154 words per minute, below the 160 25th percentile of 349 measured videos. That distribution comes from the 349-video hook study.
Opening (first 30 seconds)
I'm Bennett. I work at Zed and we built like an AI code editor all written in Rust. And last year was kind of as you probably all know the rise of the uh AI coding agent terminal user interfaces with every major model provider like building Claude code, Codex, Gemini CLI, and so on. And so at Zed, we asked ourselves like how can we let users bring their agent of choice to our tool and
77 words, the words spoken in the first 30 seconds at 154 words per minute.
Free, no signup. See how the first 30 seconds hold attention, with rewrites.
Sentence shape
| Measure | This transcript |
|---|---|
| Sentences | 203 |
| Average words per sentence | 13.9 |
| Longest sentence | 53 words |
| Questions asked | 18 |
| Sentences containing a number | 4 |
Most used terms
Filler phrases
270 in total: like 90 · uh 69 · um 51 · kind of 24 · right? 16 · basically 11 · actually 9.
A literal whole-word count of the same phrase list the Prepublish browser extension uses, so a phrase inside another word is not counted and a phrase used in its ordinary sense still is. It is a count and not a judgement.
What this transcript is
Every word below is the caption track YouTube publishes for this video, pulled from the video itself and reproduced unchanged. It is not Prepublish's writing, not a summary, and not a re-transcription: it is the video's own published captions. English captions, generated automatically by YouTube, in the video’s original language. Source: the video on YouTube. A channel that would rather this page did not exist can ask for its removal through the contact page, and it is removed.
I'm Bennett. I work at Zed and we built like an AI code editor all written in Rust. And last year was kind of as you probably all know the rise of the uh AI coding agent terminal user interfaces with every major model provider like building Claude code, Codex, Gemini CLI, and so on. And so at Zed, we asked ourselves like how can we let users bring their agent of choice to our tool and enjoy like a nice interface that is unified across all of them.
And so that's why we decided we need some kind of type of protocol uh called agent client protocol, uh which is similar to like MCP or uh LSP. It's a JSON RPC based protocol. And the idea is basically that uh agents and clients can talk to each other through through a unified interface. And uh yeah, the it's yeah, online. It's open source. Uh you can contribute if you want. Um at this point we have a wide variety of agents already supporting this either by like an adapter that kind of like translates um the agent's native language to the ACP one.
Uh and then we have like for example open code and co- uh and cursor uh having like ACP mode built into their like CLI agents. And we also have a bunch of uh clients at this point up to 40 that uh implement this including open claw for example. Like open claw itself is a client and a server actually like a client and an agent. Um and JetBrains and Obsidian and other people are supporting this. Um Great. So, um I'm going to do a live coding session.
Let's see how well that goes. Um So, Right. Uh basically, we have some pre-existing code. So, this is Zed. Uh here I have some TypeScript code. Also, bear with me. I'm I'm a Rust developer. I have basically zero clue about TypeScript. So, if you see anything that you don't do in TypeScript, tell me afterwards. Um but yeah, like here's a very minimal coding agent that just doesn't support ACP, but it's kind of the bare minimum you need to like build a coding agent.
So, all it has is really like two tools. One to read a file and one to edit an existing file. Um Yeah, this is like pretty basic. It provides the model has to provide a path. Then it has to provide an old text that is like then just replaced with new text and that's kind of everything. And then we have uh in this case like I'm using Anthropic. Uh there's a way to prompt the agent um uh with yeah, the user can prompt the agent, which is the function that we will going to call here.
And then we enter the agent loop and that is kind of like the way all agents basically work is the model APIs are stateless. So, you just attach some like conversation up to this point. You call the endpoint. In this case it's like the Anthropic API. And then we um yeah, we get like a message from the model and either it can be like a end turn. That means like the model decided to uh yeah, just output some text and do nothing or it can call a tool.
And in this case it would be like a read or a write uh tool call. And then in the case of a tool call, we like run the for example the edit file tool call locally, um collect the result, and then send it up to the model again. That's where this this loop um And then we call the API again with the conversation up to that point and that's kind of everything. And then we have like these this like handle tool call function here, which yeah, handles like read and write uh tool calls, which does what you expect.
We get the path. We read it from the file system and we return some some uh result. Right. So, now the question is how do we make this thing ACP compatible? And hopefully we can do it in 10 minutes. So, let's see. Um so, yeah, I have some boilerplate here. Uh in this case I'm using the TypeScript SDK as I said. Um and the way this works, you implement uh the agent interface provided by this uh library. And then you have to at minimum implement these three uh four functions.
So, the first one that we're looking at is kind of this initialize here. Um all we really have to do here is like respond with the protocol version we support, which in this case is just the latest. There's also like some capabilities like client and uh the agent can itself advertise capabilities of stuff it supports, but we're building a very minimal coding agent, so we don't support anything outside that's necessary, I guess.
Um then for us like authentication is irrelevant since it's just using my API key from an env var. And then there's this concept of sessions in ACP. So, basically every time you start a thread in Zed or in a different editor or client, uh you you call a new session. And in a session you can prompt and then yeah, from there on you can like get get your output. So, all we really do here is like we generate a random ID.
Um then we um instantiate uh this coding agent with the current working directory, which we get from the client. Um we store it in our internal map and then just return the ID to the client so that the client knows um yeah, knows the ID and that is kind of then used inside prompt. Um because what prompt does in this case, um it like prompt the prompt request, if we go to the definition here, all this is kind of doing is uh it provides a prompt, which is an array of content blocks that can be like text, images, whatever, the session ID for reference.
And so all we kind of have to do here is yeah, we look it up in our internal state. We get the relevant agent uh for that uh current session. And then I have a help helper function here, which just in this case ignores everything that's not a text because we don't support images and stuff like this. Um and then we call this like prompt function I showed earlier, which then uh runs tool calling loop. And so then just like as a nice to have uh feature, we also support cancellation.
Uh that's also pretty pretty simple. So, these are kind of like the four minimal things we have to implement. And I have this hooked up in Zed just by there's no special code. All I have is kind of like I tell Zed there's some ACP compatible agent and you can run it with node and then my path to that agent.js file. Um so, when I uh let's do that in here as well. So, when I run, I'm going to build. Um I'm going to build, right?
And then I'm going to restart uh yeah, launch a new ACP demo agent. And you can see if I ask it for something, you can see wait indicator. And now it's done. So, nothing. Which is what we expect, right? Because like what we can see here, if I go over Oops. Um If I go over here, we have some kind of like ACP debug view in Zed. So, to make it easier for us to develop. And you can see like Zed sends a session new request.
We respond with a session ID and as soon as I type in something, we get prompt. And now we got a stop reason, right? So, these red arrows come from the uh from the adapter that we are building from the agent. But it's not outputting tokens, right? Like behind the scenes it's obviously like Anthropic is giving us tokens, but how do we make them show up in Zed? So, that's the next thing that we uh yeah, want to focus on.
So, the first thing that we kind of need to do, like our coding agent itself uh needs to have a way to um send something over to the connection. So, what we're going to do here is like the coding agent is going to take the ACP connection and then also the session ID. And then inside here, we have to provide this uh connection and the ID. And then if we go Okay, I'm just going to close this. Right. If we go back here, now inside of uh prompt, Anthropic like this is the Anthropic SDK.
So, in this case like in Oops. You can just use um this like stream on uh Yeah, that's like a Anthropic SDK. Like you can react to a text event. So, every time we basically get a chunk, uh we send this kind of what ACP calls a session update. As I said, a session is like a single thread or a conversation. And then you can send updates kind of like notifications to the client that are not like a usual request response, right?
It can happen at any time and the client reacts to it. And so here we are associating with the session update with a session ID. And then this like There's a type of session updates. There are multiple. We will see more in a second. But this agent message chunk is just like, "Okay. Hey, here's some new output from the model." And so if we build again, uh we go back to Zed. I'm going to have to restart the agent. I go here and I say, "Hello." Hello.
Hello. Well, here's Opus talking, right? You can see like we're streaming in these individual uh chunks, right? Right, that we got from Anthropic. So, so far so good. Let's hope the demo gods uh stay with us. Um Right. So, that's one piece. The next thing though is like I want to like it's a coding agent, right? It's supposed to edit code. So, I can actually tell it already because we have tool support, right? I can tell it to read, for example, this like helpers .ts file and it's going to give me if the Wi-Fi isn't too slow, it's giving me a description of what this file actually contains.
Like if you look here, that's basically the description of the file, but again, you don't see it in the UI, right? So, now we need to emit more session updates, similar to like what we did for text. So, if we actually go towards the read file, kind of what we need to do here is like the way it works usually in ACP, like you emit an initial tool call update, uh which I'm going to paste in here. So, yeah, again we're emitting a session update in this in this case, it's uh type of tool call.
And then there are multiple properties we can specify, for example, like the title, kind of some kind of data um that Z uses, for example, for like yeah, using some icons and stuff like this. And then we indicate that the status is in progress, and you can also like associate tool calls with like actual uh locations. And so, now we signaling over ACP that something is in progress, right? This tool call. But then we also want to at the end, like once the tool call has finished, like at the bottom here, we kind of want to send another update.
And in this case it's not tool call itself, but it's a tool call update. So, you have to emit on the agent, you have to emit like a tool call, like session update of type tool call, and then once once the client knows about it, uh you can emit updates for that. Uh and this is the way that we set the status, and we can also return the content. Um and then one additional thing that I'm going to do here is the um instead of like if you can see here, we're calling, I guess it's a bit hard to see, but like here we're calling fs.readFile, right?
So, we're just using the native file system APIs. But MC uh ACP actually proxies the file system too. Like the client can provide a uh a file system capability, and if it does, um we can like proxy those uh file system tool calls over ACP. And it kind of makes sense, for example, for an editor, right? You want to um if I have unsafe changes in my buffer, they're not actually on the file system, but the agent should still see them.
So, that's why we call this like uh read text file um over ACP. And so, now if we go back here and hit npm run build, and then go back here, restart, and say read uh this file. Oops, not the rust. Then we should be seeing um Yeah, so now we see read tool calls, right? Okay, something is going wrong because everything is duplicated. Um yeah, but like here you can see the output um of the actual file. And because I think I'm low on time, um we're we're going to basically going to do the same for edit file.
Um and I'm going to compile again. And if I again restart, and say add a comment at the top of agent source agent.typescript, then you're going to see um uh hello world is good. Hopefully, clo- uh Opus is going to decide to add hello world at the top of the file, and we actually get a diff here because the over ACP we send like a diff of the file. Okay. Yeah, I think there's something going wrong with the connection.
I'm yeah, yeah, no time to debug right now. Sorry. Uh am I out of time or do I still have Okay, maybe like we can see. So, now that Okay, just another minute. Um now that the coding agent supports reading and writing files, we can actually Oh, great. Uh okay, then I don't need to rush. Um now we can kind of bootstrap the agent itself, right? Like the coding agent supports reading and writing files. I can just ask it, I prepared a prompt here, to add a terminal tool to itself, right?
Let's see how this works out with like the duplication we're seeing. Uh but basically I'm telling it some something about the ACP um APIs, and there's some there's some APIs in ACP which also, that's another like capability of the client, where the client can um advertise that it supports creating terminal and managing terminals for the agent. Like the agent can also do it itself, of course. Um but it's a nice way uh for us to add some more interactivity.
And so, the agent here decided to add a new tool description. Now it yeah, I'm live coding basically this terminal tool. Um and let's see if it actually builds. It does. Well, that's good. Um and then again, I'm going to going to restart the agent. I'm going to run our demo agent, and I'm going to ask it to run sleep five ls. Let's see. There you go. You can see a terminal running, sleeping 5 seconds. There is the output.
And there's Yeah, and that's it, basically. Thank you. Yeah, so that's how you kind of build an ACP compatible coding agent in 15 minutes or so. Um yeah, if you want to uh check it out, just go to agentclientprotocol.com. Um in case anyone wants the demo code, but please don't use it in production. It's all agent generated. Um it's not upload it yet, but it it's an empty repository. I'm going to upload it in a second.
Uh yeah, thank you for listening. Happy to answer questions. That's it. YEAH. UH THE DIFFS UH YEAH, WE HAVE LIKE IN in ACP there are multiple content types, and one content type is diff, and so the agent sends old text, new text, and then Z does the diffing for you. Yeah. Cool. Do I need to go or can I Okay, one more question. Yes. Yeah, the connection works over standard IO. Uh there are some folks well, I think from the JetBrains people are working on like remote uh transport, uh which we're going to have soon, I think.
So, yeah. But right now it works over standard IO. Yeah.
The words are the caption track's own and nothing is reworded or re-transcribed. Paragraph breaks are placed between sentences so the text reads as prose.
Free tools for your own script. No signup, no login.
Paste your draft and see where viewers are likely to drop off, with a rewrite for each weak line.
Paste the first 30 seconds of your own draft for a hook score and rewrites.
Check your draft against YouTube's advertiser-friendly guidelines before you record it.
Read this channel's public videos and transcripts, and download a writing brief for it.