Skip to content
PodSubs
ShowsPeopleGuestsJobsNewsEvents
More
BlogPodCred
Menu
ShowsPeopleGuestsJobsNewsEventsBlogPodCredNetworksSign in
Join nowSign in
  • Shows
  • People
  • Jobs
  • News
  • More
    • Guests
    • Events
    • Blog
    • PodCred
    • Networks
    Join nowSign in

Vanishing Gradients

Vanishing Gradients artwork

How to Build a Coding Agent with Nico (Amp Code)

Sep 15, 20261 hr 53 minAudio
ShareXLinkedInFacebookWhatsAppEmail

“It’s an LLM, a loop, and enough tokens.” - Nicolay Gerold, Amp Code So why does a coding agent forget your instructions, keep reading tiny pieces of a file, or struggle with an edit another model handles easily? Nicolay Gerold (Amp) joins Hugo to take that loop apart and explain the harness around it: the software that executes tools, manages context, and lets you steer the agent’s work. Nico builds this machinery for Amp, a coding agent that works across software projects. “Every component in a harness is basically an assumption the model can’t do it on its own. This expires over time.” - Nicolay Gerold Amp’s experimental plan mode addressed models that were too eager to edit. Once they could reliably follow an instruction to plan without editing, the team removed the separate mode. Nico describes a similar change with file reading: stronger models could search, filter, and read files through Bash, reducing the need for a dedicated read tool. That gives builders two questions to ask when a model improves: which workarounds can you remove, and what more can you ask it to do? Nico describes pushing stronger models to delegate work and challenge what their sub-agents return. Better judgment makes that delegation more useful, while making some older controls unnecessary. We start with a small agent in Go, then explore Pi, an extensible coding agent, and the decisions behind longer-running work. Building your own makes failures easier to investigate: you can see which instructions survive a summary and whether the agent can inspect the logs and tests it needs. Nico also recommends experimenting with cheaper models, whose mistakes can expose knowledge you’ve left in your head instead of giving to the agent. That understanding stays useful even if you ultimately use someone else’s harness. You can also find the full episode on Spotify, Apple Podcasts, and YouTube. 👉 Want to build an agent yourself? Join Build AI Agents from First Principles on September 24, 6-10pm EDT (September 25, 8am-noon Sydney). We’ll start with a single model call and build a working customer-service agent, adding tools and context as we go. You’ll leave with code you can adapt to your own work. Friends of Vanishing Gradients get 10% off with the code NICO10 here.👈 “Usually you want to build features that the model is barely able to do right now, but through the increases in intelligence will be able to do easily in the future.” - Nico Gerold In This Episode * Trace the core loop from a user message to a model’s tool request, the code that executes it, and the result fed into the next call. * Saved sessions, streaming, steering, and cancellation: what Pi adds around the loop, including what should happen to running tools when you hit stop. * Three sources of context, and how repository instructions, development-server logs, and filtered tool results help an agent do its job. * Compaction that loses your instructions, handoff that carries work into a fresh conversation, and why better summaries changed which features Amp needed. * Long plans nobody reads, growing token bills, and the difference between generating a plan and giving a human something useful to review. * Bash versus a dedicated read tool: combining searches and file reads in one call, and the tradeoffs around binary files, restrictions, and line numbers. * String replacement versus patches, and why a tool interface that feels familiar to a model can still lead it into the wrong call. * Recursive language models: using code to inspect tool outputs, where Nico found delegation benefits, and where the context savings disappointed him. * How Nico used agents to build extensions, learned from users’ failures, and turned those failures into evaluation cases… evals for agents! Resources * Nico’s workshop repository: the Go agent, topic explainers, and Pi and Amp extensions used throughout the workshop. * The core-loop walkthrough: follow the conversation array, tool execution, and the runtime around them. * Harness-engineering notes. * Read tools versus Bash. * How to Build an Agent, by Thorsten Ball: the tutorial Nico credits when explaining the core loop. * How To Build a General Purpose AI Agent in 131 Lines of Python: my Python walkthrough, shared during the workshop. * Pi and its documentation and source: the extensible coding agent we explore alongside Nico’s Go implementation. * Pi: The Minimal Agent Within OpenClaw, by Armin Ronacher. * How I Built Handoff in Amp, by Nicolay Gerold: the feature he built when compaction kept losing his instructions. * Context Rot: How Increasing Input Tokens Impacts LLM Performance, from Chroma. * The Coding Agent Is Dead: the Amp article we discuss when considering what agents can take on beyond code edits. Related * What Claude Fable Means for Coding Agents: my previous podcast with Nico. * Teleporting into the Future and Robbing Yourself of Retirement Projects, by Geoffrey Huntley, shared during the workshop. * How to Build an Effective Agent Harness: choose the machinery around the job your agent needs to do. * How Evals Are Central to Harness Engineering: use observed failures to decide what to change and check whether it helped. * Build Better AI Agents: Architecture, Harnesses, and Evals: two free lessons on September 17 and 21, with recordings available afterward. 👉 Want to build an agent yourself? Join Build AI Agents from First Principles on September 24, 6-10pm EDT (September 25, 8am-noon Sydney). We’ll start with a single model call and build a working customer-service agent, adding tools and context as we go. You’ll leave with code you can adapt to your own work. Friends of Vanishing Gradients get 10% off with the code NICO10 here.👈 How You Can Support Vanishing Gradients Vanishing Gradients is an independent podcast, workshop series, blog, and newsletter about what people are building with AI and what survives contact with real users. * Become a paid subscriber. * Share this episode with a friend or colleague who’s building with agents. * Subscribe to the Vanishing Gradients YouTube channel. * Read and subscribe to the Vanishing Gradients newsletter. * Join our livestreams and free workshops on Luma. * Browse upcoming workshops. Get full access to Vanishing Gradients at hugobowne.substack.com/subscribe

Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.

Transcript

From the show. Tap a time to play from there.

SPEAKER_00It's an LLM, a loop, and enough tokens. I think like Thorsten put out this like now godlike article at the beginning when this whole arc started which is like how to build an agent the emperor has no clothes that it's basically it's very simple how it works below the hood and it's basically just a loop An array and tool execution. And that's it.

SPEAKER_01That was Nikolai Gerald, who builds the harness behind AMP code. So if the core of a coding agent is that simple, what on earth goes into making it work well?

SPEAKER_00For me, harness engineering is basically context engineering, but for both the user and the agent. So you want to give the user and the agent the tools to actually pull in good context and avoid bad context. And that's everything. And if you look If you look at the core loop, everything that ends up in conversations is basically one of three types of context.

SPEAKER_01So Nico is back on Vanishing Gradients. And this time, we're taking a coding agent apart so you can understand how to build one yourself. We start with a model, a conversation, and a few tools. And work through the engineering that lets an agent keep working as that conversation grows. And even if you never ship your own coding agent, understanding these mechanics will help you use one better. When an agent forgets your instructions, keeps reading tiny pieces of a file, or If your struggles to edit your code, you'll have a better idea of what to investigate and what to change. Nico walks us through how agents preserve context,

SPEAKER_01why the same editing tool can work well for one model and trip up another, and why AMP removed a dedicated file-reading tool for its stronger models. Could you give an agent a shell and let it figure out the rest? Also stick around for Nico's advice on learning with cheaper models. A weaker model can expose instructions you've left out and assumptions you've never actually explained to your agent. We recorded this workshop a couple of months ago and some of the ideas have already moved further. Codex is experimenting with letting agents keep notes and search back through their earlier work and Amp has added ways for agents on different machines

SPEAKER_01to share work with each other. Wow! Also gives you the foundations for understanding how all of this works. We're sharing the screen throughout, as it was a workshop, but we explain everything as we go. If you'd like to see what we're sharing, check out the YouTube video and Nico's companion repository with the code, diagrams, and examples. Both are linked in the show notes, and you can point your own coding agent at the repository to explore it with you. We also live stream many of these conversations and run free workshops. We would love you to join. Check out the Vanishing Gradients Luma calendar,

SPEAKER_01subscribe to the Substack newsletter and YouTube channel, and you'll find all the links in the show notes. If you enjoy the show, the best way to support it is to share this episode with a friend or colleague who you think would get something out of it. And if you want to build an agent yourself, I'm teaching build AI agents from first principles on September 24. We'll start with a single model call and build a working customer service agent, adding tools and context as we go. You'll leave with the code and a better understanding of how to design your own. There's a registration link and a special 10% discount for friends

SPEAKER_01of Vanishing Gradients in the show notes. I'm Hugo Bowne-Anderson and welcome back to Vanishing Gradients. All right, okay, everybody. It's Hugo Bowne-Anderson here. I am very excited to be joined today by Nicolai Gerald from AMP Code. This is the repository we shared in Discord as well that Nico set up, how to build a coding agent. Okay, so the real idea of course is that An LLM will predict the next token from its training, pre-training, post-training, of course, and context.

SPEAKER_01And you don't worry about the weights, right? So the entire output is a function of the input. The prompt plus every tool result the agent pulls into its window. And context engineering is deciding what goes into that window.

SPEAKER_00Yeah, I think if you think about coding agents, I think by now they're all about the context. And this is something I have to remind myself constantly, all that the LLMs are basically It's just a blob of text, nothing else. And the entire behavior is based on that. And all the tool calls, all the assistant and user messages is just basically semantics that We have taught

SPEAKER_00the model through fine-tuning, through supervised fine-tuning or through RLHF. And through that, it learned the behavior of just through basically a very simple method, which is basically next token prediction. This also means the entire behavior is determined by the input, so by the context that you have in the context window right now. And by that, or through that, you basically want to have a very high-quality context at all times

SPEAKER_00that actually gives you the relevant input so the model can constantly make good decisions.

SPEAKER_01Absolutely. And it's weird, right? Because we do all this work for context engineering and harness engineering, which we'll get to, in order to wrangle all these function calls and tool calls and memory and other aspects of the context layer. But we are just putting tokens in and tokens out. Of course, then tokens out can... B, actually call this function, and agents these days have that hooked up to tool calls that then go and execute

SPEAKER_01that function for you, right? But it is still just tokens out.

SPEAKER_00Yeah. And I think this is, for one, I think really fascinating, how much intelligence comes from such a simple behavior. But it also shows you how much the model architecture, by having such a simple model architecture, And the context engineering, I think, like, it started out very interestingly because it was really manual.

SPEAKER_00So it was, I think like Dax Horthy is known as one of the people who coined the terms and he had this elaborate process set up that he actually wrote to files constantly and pulled them in. So it was very manual to basically reset the context window all the time and reduce the length, but also reduce the amount of noise you have built up in the context window. And this is for me what context engineering is. It's basically deciding what goes into the context window.

SPEAKER_00But I think as opposed to one, one and a half years ago, I think the least amount should be done by the user. I think we are now entering in... In a domain that the models are smart enough that they can do a lot more for us and at the same time that there shouldn't be anything that the user can do that the human can. So basically everything that the So basically,

SPEAKER_00all the different tools, all the different functionalities, he should be able to run all the dev servers, everything, so it can gather all the different information, all the contacts, but also get back pressure or feedback on its work.

SPEAKER_01Yeah, absolutely. And something implicit in that is for a couple of years now, we've been hand rolling context a lot. It's been a manual task. And how do we get the machine to help build the machine? It's the outer loop of context engineering, right?

SPEAKER_00Yeah. And for me, I think today I want to talk a little bit about the different parts or how it evolved. And I think we're going to hit two different topics. For one, how to build a coding agent. And for the second, how to do context engineering in a coding agent or with a coding agent. And I want to focus a lot on what we talked about in our podcast last week as well. The Kirby effect that the models continue to acquire more functionality

SPEAKER_00and more intelligence, which just consumes feature from the harness. And I think like context engineering shows that really the best. And it also shows you like how to actually You build a coding agent because you consistently have to think about, okay, what's now possible with the new model generation that wasn't possible before, but also what of my features are irrelevant now and I can't just throw them away because the model is actually capable enough to do it on its own.

SPEAKER_01Totally. So I do want to talk about the arc, but maybe quickly we can just tell people what to expect today. So we'll be going through the core loop, then go through harness engineering, and we've always almost hinted at that. Then historically compaction, which is agents essentially compressing. The history of the conversation so that it can fit it into the new context. Wyatt failed, turned into Handoff at AMP, and then now Wyatt's back. Then planning, thinking through Handoff, RLMs.

SPEAKER_01Then... This is super interesting. And we're getting into Pi today, of course, and I'll actually post Armin's wonderful blog post on Pi. Pi originally had four tools, read, write, edit, bash, and celebrates the idea of writing code and extends itself with code. But then thinking through, do we actually need read or is bash enough? And then getting into edit tools. So is there anything else you'd like to add before we kind of go through the arc of what we've seen?

SPEAKER_00No, I think that's good. I would love to share my own screen, but somehow my permissions are really bored with soon.

SPEAKER_01I can't imagine how awkward it is to have, especially an Australian standing upside down in the future on the other side of the earth.

SPEAKER_00Yeah, we now have Hugo who is acting as my hands. Exactly.

SPEAKER_01And this, I'm the harness. You're the brain and I'm the harness, right? And actually, let me, now I can really do this. Krang, Teenage Mutant Ninja Turtles. This is, when I tell people about harnesses, this is the image. I usually, something along, well, that's not quite the image, but let's go. Yeah, this dude, right? Here's the little brain who can't do anything. That's the LLM. And then you give it a body. And that's the agent harness with the stuff that will send emails, read databases, ping APIs, fire everyone.

SPEAKER_01Of course, that's the goal, right? Once you have an agent, you can fire everyone. Half joking, what people call late capitalism. But Crane, so I'm the body and hands for Nico today. So let's go, Nico.

SPEAKER_00Let's go. Yeah, if you want to go into the core loop in the docs, you can just look on the link. Fantastic.

SPEAKER_01And also, we should just say, we're not going to execute any code today. And why is that, Nico?

SPEAKER_00Because I think I could be executing code if it was on my machine, or I would have, but we're going to skip that today because I can't screen share. It's I think like everything that you have in that doc, you can one shot with an agent. So hand coding it or building it live, I think like doesn't really have any value. And a lot of the stuff is more conceptual. And I want to show like how we, And I think

SPEAKER_00that's something that's not so often talked about. And I think that's often also malpracticed that a lot of coding agents either overdo it or underdo it. And there's like a balance you always have to make and a willingness of like ripping out features, but also retrying stuff that just didn't work before.

SPEAKER_01Totally. And to that point, implicit in that was anyone watching, go to this repository, give it a star, fork it, clone it, and point your agent at it and get your agent to work with you and us as well. So let's go. An NLM is a loop. Tool calls in a loop, right?

SPEAKER_00Yeah, it's another dilemma loop and enough tokens. I think Thurston put out this Now-like article at the beginning when this whole arc started, which is how to build an agent, like an emperor, the emperor has no clothes. Basically, it's very simple. How it works below the hood. And it's basically just a loop, an array, and tool execution. And that's it. And what you basically send to the model at every turn is like what you see in the ASCII diagram.

SPEAKER_00You have a conversation array, which is constantly building up with additional messages. And the messages basically have some tags in JSON, which basically declare its type. So it gives it some additional semantics. It's then just basically reformatted through something that's called a chat template that basically takes the JSON and spits out a blob of text, which then usually has a form of XML tags, which basically just tell the model, hey... This is this type of message.

SPEAKER_00And based on that, it has learned through its training to pay more attention, for example, to the system prompt. And basically, the conversation is resend to the LLM at every turn. What LLM then basically spits out is more of this XML syntax, which is converted into tool calls. And you basically see that sent from the model as a tool use. And the tool use usually has multiple things. It has a type, which is the type tool use.

SPEAKER_00And it always has a name for the tool it wants to call. So for your very basic agent, it's basically just something like read a bash call, an edit file call. And it emits that. And your job basically as the harness is only to, once the tool call has been finished, you take the arguments and you just basically execute the tools. And... Then you might ask, like, how does the model actually know which arguments to use? And this is something called, like,

SPEAKER_00the tool description and the tool schema, which are two things that you actually feed into whatever model you're using. And this basically... It's like a function. You have a doc string for the function, which is the tool description, which tells the model Ben and how to use it. And you have the arguments, which are basically the function arguments, which describe what each argument represents and what are valid values. So for example, for a read file call, I would tell the model to give me a path. And then the question is like, okay, do I do absolute path or do I do relative path or...

SPEAKER_00Doesn't it matter at all? And I will just resolve it in code in the background. And at the moment, most coding agents actually, for example, use an absolute path for reading files because it's just simpler to resolve and you have to handle less logic on the RNS side. And through that, the model basically just emits. It's like file path, the path, for example, to user Nikolai, how to build a coding agent, blob main, docs, core loop.md. It emits that, and then you basically in the background take the argument,

SPEAKER_00parse the JSON, and then basically execute the logic to read the file, and then feed it back into the LLM as a tool result. And the tool result is basically another special syntax, which just helps the model, hey, for this tool use, we got this back and now continue with the loop. And we do that iteratively. So every single turn, We just feed in, we append the tool use we got, then we execute it, we append the tool result we got,

SPEAKER_00we append it to the conversation array, and then we basically feed it back to the model. And through that loop, we constantly basically get further and further along the task. And the model just starts solving it and then at one point starts editing.

SPEAKER_01Also, I'll show a slightly different schematic of how a tool call works. And this is a blog post I wrote called How to Build a General Purpose AI Agent in Python, which was inspired by Thorsten's post in Go, but via Ivan Leo's post in TypeScript, actually. And I use this, this is from the Gemini team, this image. Where is it? Now I, yeah. So people may be familiar with this, right? Where... You have the prompt go in, then the model quote-unquote decides, will I complete it to use the completion endpoint to give an answer,

SPEAKER_01or will I use a tool call? And if it uses a tool call, then perhaps it will then execute that tool call, And send the completion out, or it will go in a loop. And Nico, you said really nicely that descriptions can help it figure out what arguments to use and that type of stuff. And I love the example, like models are smart now. So if you ask, if you have a get weather tool or function that pings a weather API and it expects latitude and longitude as arguments,

SPEAKER_01but I say, what is the weather in Sydney? Models will automatically Without even telling you or worry, convert that into latitude and longitude to pass as arguments, right?

SPEAKER_00Yeah. And I think for one, most models are general tool callers. So they are capable of basically executing or generating the arguments for any type of tool. But at the same time, they have... We have inherent biases because the different model providers are training so much on their own coding harness that porting from one to the other usually doesn't work. So running an open AI model on top of cloud Yeah.

SPEAKER_00It uses it way less and way less frequently. It decides to use sub-agents way more to actually do more of the work. And through that, you actually have to really tailor the harness to the specific model. And see which tools are actually necessary and which tools the model also likes to call. And this is actually why a harness is still necessary. Because figuring that out and what tool makes this really necessary and what are the best tools for the model and how you can actually enhance

SPEAKER_00the performance is actually where a lot of time goes into to actually figure that out. And if you quickly go into the call loop main.go file, I think we can...

SPEAKER_01Yep, I will. And what I'll do is I'll open that in another tab. And hopefully we get to this, but a provocation there is, don't we just need one tool? Can't we do everything with a bash tool? But that's something that we'll put out there as another open loop and come back to later. So which file would you like to go to?

SPEAKER_00The main.go, yeah, the bottom one. And if you scroll down to...

SPEAKER_01So this is in Go, but we'll be using TypeScript today as well, right?

SPEAKER_00Yeah. We were using TypeScript mostly. This is just basically I ported it from Thorsten's blog post, which I actually, in each document, I basically have an explainer of how everything works. And then on the bottom, I have resource links to the different resources, which give you more detail. And I also link to Thorsen's blog post on that. And this is basically how the loop works. And if you continue scrolling, I will just narrow it as I go, you can see the tool definition and the agent basically structs, which are basically like... Define a set of fields.

SPEAKER_00So for example, an agent in our case is a client for Anthropic, is a set of tools and a get user message call. And the get user message basically only invokes in your terminal. A simple logic that is listening for text input. And this basically defines an agent. So it's very basic. And if you go to the tool definitions, here you can see we have tool dev, we have found, and we have a set of tools.

SPEAKER_00And in there... We basically say, hey, execute tool. We see whether the tool name that the model actually emitted is available. And if it's emitted, we basically take it and just call the function which is associated with that specific tool. You can see basically that we just use the Anthropic library to emit the tool results back. And this is very interesting. You have the toolparam, which is basically just three things.

SPEAKER_00The name, the description, and the input schema. And that's it. So it's not really a lot of stuff which goes in there. And the different model houses have a little bit different flavors of how they define it. But it's basically the same structure every single time. You have a name, you have a description, and you have your input schema. And the input schema has the arguments. And... This allows you to basically figure out how or create a set of tools which should be very composable. And this is what makes Bash so good because it's really composable and allows you to do a lot.

SPEAKER_00But usually you want some additional stuff on top of that. And in the past, like when we got started, we really needed like edit file, create file, bash, read file. But now the models are so good at this loop and so good at the behavior. That for example, read file, you can already throw away. You can't just give it a bash tool. And the model has been trained on so many shell sessions and so much code that it actually knows how to just read files through bash by using something like set And this also gives them all of the capability

SPEAKER_00to actually filter more because it can grab on top of it. So it doesn't have to read the entire file every single time, which used to be a massive issue in, in Like the early harnesses, especially with Sonnet 3.5, which feels like ages ago, that you ran out of context windows so fast because the model just read a really large file and we hit the context limit already. So when you read a file,

SPEAKER_00you added two additional arguments, which is basically a start line and an end line, and you only read between those lines. And if the model tried to read a file, which is larger than a maximum, You basically fail it and tell it, hey, add these two arguments to basically restrict the number of files, which works. But at the same time, it causes a lot of bad behavior in really big files. Because if you have, for example, in our repo, we have one which has like 5,000 lines of code.

SPEAKER_00Which isn't even that big. And then the model first has to figure out like what parts of the file are actually relevant and where is the relevant piece of code. And usually it really starts to run in a loop of emitting like two I think Bash really avoids that because it can compose it better. And it also has a little bit more tools at hand to actually figure out the right lines of code to read faster.

SPEAKER_01Totally. And I'll add a few things. I don't know Go. I can't read Go code. I don't read it. I don't even write it. But what I'm seeing is that, once again, we're not using even the Anthropic SDK yet. We're just using an LLM, right? And we're building, hand-rolling the tool calls with it. Nico mentioned something important, which is all the different providers have their different APIs. We can get pretty annoying. I like using Pydantic to abstract over that when I want to switch out. I presume you use Pydantic or Handroll your own stuff there as well to make

SPEAKER_01that less frictionful for you?

SPEAKER_00We Handroll, so we implement our own wrapper around the different providers. I think if you want something in TypeScript, in the Pi package, so Pi is basically a really minimal coding agent by Mario Cegna. And it's really great what we built. And I think it's basically the minimal coding agent that Thorsen laid out, but really well engineered. And he has basically one library, which is called PyAI, which just gives you an abstraction on top of every provider,

SPEAKER_00which makes it really easy to call all of them.

SPEAKER_01And it's just linked to PyPost in Discord as well.

SPEAKER_00If you scroll to the bottom, you can see a little bit further up. You can, for example, create new file. This is the tool logic. And if you scroll a little bit further up, a little bit further, here, you can see the edit file in And this is basically what I talked about before. The edit file input is the schema that you send to the model. And in here, we basically tell the model, hey, give me a path, give me an old string, and give me a new string.

SPEAKER_00And edit file in Cloud Code, for example, to this state is still this. It's just a string replace. So the model is just emitting two strings, the old string and the new string, and then replaces it. This has a bunch of failure modes that we will talk about in a later section, but I think it tells you how simple it is. Yeah. Yeah. Yeah. Yeah.

SPEAKER_00Here you can also see the basically description, the name.

SPEAKER_01Well, this is actually, I want to talk about this because this is important, right? But it used to be more important. So naming your tools well and writing your descriptions well used to be really important because LLMs weren't that great at choosing the right tool. Whereas now you want to give it a good name, but you don't necessarily need to give it as good a description as you used to, right?

SPEAKER_00I actually disagree. Oh, well, you're the expert. I think for... If it's a really common basic tool, like edit file, for example, you probably don't need a really elaborate description because it's so trained into the tropic models that they will be able to handle well.

SPEAKER_01But you can't really... Right? This is... So what it... What will building harnesses around six months ago, if there was enough training data, then the RLVR, man, it sucked it up and they're good at it now. So you kind of need to strip away that part of the harness.

SPEAKER_00Yeah, but it doesn't extrapolate to other providers. So for example, if I give the Edit Fire tool to an OpenAI model, it will probably perform way worse because OpenAI is training on a different edit tool, which is called Apply Patch, which takes hunks. Instead of raw strings, which is more token efficient. So the edit file tool, we have actually benched it. It has the open AI models have performance issues with it. So you would actually need...

SPEAKER_00We need a way better tool description that tells the model what to do because it's more out of distribution. And this is one thing which is like one of the assumptions of mine. Coding task, for example, because all of the providers have their own coding agent and are training so much on coding tasks, they have an inherent bias to the tools in their own harness, whereas when you're working in an Amazing.

SPEAKER_01Also, just want to say at some point, hopefully, we're at an interesting point in history right now, Nico, in that Fable has had public release finally again. And GPT 5.6 has not had public release yet, but will in the next 24 hours. So perhaps later in this live stream, we can talk a bit about those different models and what it may mean for builders. But let's not do that quite yet. Where do you want to go now?

SPEAKER_00If you want to revisit it, I basically break down the entire core loop in this document so you can just read through it. And I think to contrast it with Pi, I think Pi is really a production loop in comparison to what Thorsten put out. And there are a bunch of things which make it more productive, which like a lot of the model providers, including us now have, which is like for one sessions. And basically every message is appended to a JSONL file. So the coding agent is really basic.

SPEAKER_00This is a basic example. It doesn't stream. So you just tell it something. And once it's finished, you see it. Usually you stream the responses. And this is surprisingly annoying because officially like you have these server sent events, which you're usually using or now web sockets, which We also sent the events with the different providers. And every single provider has one, their own form of completion endpoint, which is for OpenAI, for example, the response endpoint or the chat completions or the anthropic response.

SPEAKER_00And they also have their own streaming spec. And while streaming, you basically parse deltas so you can display something to the user so he knows what's going on. And once the streaming response is complete, only then you actually do work. So only once the tool result is completed, tool use is completed, you actually do the tool execution. And I will actually, like... If you are really curious about it, I would just spend a day or two to actually read through the Pi source code

SPEAKER_00because it's actually a really good example of what the different primitives are that you have to think about when you build a coding agent, which is basically the tool list. The system prompt, the user messages, which you're getting, guidance files, which are agents and defiles, which are placed in the repo to tell the agent what it's supposed to do. And for example, truncation and compaction. And they have basically built everything in a very readable and only in a few files. So it's actually, you can go through the code in a few hours and really understand it.

SPEAKER_01The system prompt is lovely and short as well. You don't need that much.

SPEAKER_00You don't need that much. I think you could go away. You could do away more. But I think for Pi, their focus is being really extensible and being open source so everyone can make it their own. So I think having a short system problem And you can squeeze a lot of performance out of the models by actually tuning the system prompt and asking more and more of the model.

SPEAKER_01Hey, I was also, you've got steering next, which is getting really nice in a bunch of, I mean, steering is lovely in your work. It's been fun in codex, and it seems like Claude Code is catching up with steering to a certain extent. For those who haven't steered per se, it's where you can inject a prompt or a message while it's doing work. And it used, coding agents and harnesses used to be pretty, but like, it'd stop it, it'd like, and now it's like smooth, it's really smooth driving, like it will incorporate it. So, and You and your team were at the forefront of doing a lot of cool steering stuff, Nico.

SPEAKER_00Yeah, so steering and follow-ups. I think this is something that's partly misunderstood. And there are two different things in theory. So steering is usually, or steering used to mean you're Send a new message to the agent and it interrupts what it's doing right now. And now it has evolved to something. You don't interrupt it right away, but you actually wait for it to complete what it's currently doing.

SPEAKER_00So you actually don't waste the cost you already incurred and the tokens you've already spent and then inject the user message once it's complete.

SPEAKER_01But it's complete in one step in the loop. It hasn't completed the entire reasoning loop.

SPEAKER_00Yeah. In one step of the loop. This is basically steering now. And this is a little bit confusing in the Codex app because they actually show that the user message is sent right away. But if you actually look under the hood of what is happening, they are just basically Totally.

SPEAKER_00The follow-up is basically the other thing you just said. You usually can do something like Command-Enter or Command-Shift-Enter, and then it's a follow-up. And then you don't send it right away, or it's not sent after the inference completes, but only once the complete agent is finished. And this is probably good to know. There are two different types of stop reasons for the agent. One of it is tool use, where the provider basically tells you,

SPEAKER_00hey, we emitted a few tool calls that you have to execute. And the other is end of turn. So basically, the end of turn means, hey, the agent has done its work, it's completed, and it's now waiting for user input again. And a follow-up basically sends the user message once the end of turn has been reached and then basically follows up with the user message so the agent can continue working.

SPEAKER_01Totally. Also, dude, I love that we have hooks next. People like, dude, build sub-agents and use sub-a, and I'm like, dude, get with a hook and a cron job first, for real. Just being able to, so if anyone's used OpenClaw or Hermes or anything like that, when something happens, when your claw or Hermes does something and it sends you a message on Discord or Telegram, that's a hook. It's essentially a trigger, right? So being able, and this isn't Just agents and that type of stuff. This goes a long time back in software. The ability to have events trigger other events are essentially the principle

SPEAKER_01behind hooks, right?

SPEAKER_00Yeah. And hooks allow you to build so much stuff. So hooks in combination with all the other stuff, like you can use hooks to steer. You can use hooks like our, for example, permission system is implemented via hooks. So one example is basically the before to call. So you can actually say, hey, when the model emits an added file call, you can show a message to the user to actually permit it or not, which I think

SPEAKER_01You shouldn't do anymore.

SPEAKER_00But a few people still want to be in control. I think like permissions are now, I always run in dangerously allow all, and I just allow it to do everything. And I rarely see any misbehavior. So we haven't had any bad database deletions or anything. The worst thing that probably happened to me once is that I force pushed on a branch. And I think like the...

SPEAKER_01I did that for agents as well, so...

SPEAKER_00Yeah, it's like I've done it as well. So I think like this is, I think you're slowing yourself down more when you have permissions because you have to be constantly in the loop and look at it and check whether it's actually valid. And I think like most people who actually still use it are just basically hitting a proof every single time and not really reading through the code. So I think at that point you can already say, hey, let's get permissions and do it completely.

SPEAKER_01And check out our podcast that's in the Discord for whether Nico actually reads code anymore or writes it. So do you want to tell us about cancellation and then tell us what's not in the list?

SPEAKER_00Yeah. Cancellation, I think like this is something that is surprisingly annoying to build. And I know that also from us. It's like in cancellation, because you have to cancel, there can be a lot of stuff going on at the same time. And you basically have to wire it through the entire code because it could be a tool call that's at the moment running. And when a bash tool call is running on a system and the process is running, you have to cancel that when the user cancels. It's actually the current turn or the inference call which is running.

SPEAKER_00You have to cancel that as well. And it gets more complicated once you get into area where you have stuff which is running async. So for example, if the model calls a subagent, And decides to basically defer it. And I think Codex, for example, has that. The sub-agent is called and the main agent just continues. And it keeps running in the background. So I think on cancellation, then a big question is, hey, do you actually cancel the sub-agent as well? Or is it just continuing?

SPEAKER_00Or in bash tool calls, like often it's now, it's running Tmux, for example, and you usually want to kill the entire thing. And this is why actually abort signal are really important to get robust. Right? Because there is a lot of stuff which could happen on user devices when stuff continues running in the background. Then you get into memory leaks or stuff is running and just pure confusion. And what's not in the list? I think like Pi by default. My design is very minimal.

SPEAKER_00So it doesn't have planners. It doesn't have memory systems like OpenClaw where it does the streaming cycle where after every session basically tries to learn what it has learned. It also doesn't have a lot of So which would be the permission system. And Py basically expects it to build it yourself. And by that, it also only have the four default tools, which is read, write, edit, and bash. And I think this is also... So one of the limitations of Pi, I think the read, write, edit,

SPEAKER_00and bash tools are very optimized for Anthropic models, but not for OpenAI models. So when you use the Pi harness with other providers and other models, I think you have to do way more lifting to actually get it to work well and get really good performance out of it than if you use it with Anthropic model. But I think we will talk about that later more in the later documents.

SPEAKER_01Yeah. And I also want to just, and I've read this online live a few times, but in Armin's posts, there's a section called What's Not in Pi as well. And he mentions MCP. There's no MCP support. And I want to quote him. He writes, this is not a lazy omission. This is from the philosophy of how Pi works. Pi's entire idea is that if you want the agent to do something that it doesn't do yet, you don't go and download an extension or a skill or something like this. You can, of course. But you ask the agent to extend itself.

SPEAKER_01It celebrates the idea of code writing and running code.

SPEAKER_00Yeah. And I think MCPs as well are the bane of my existence. I implemented the MCP wrapper and it's surprising because the MCP, it still supports a lot of old transports. So you have multiple transports. And a lot of servers aren't really up to date, but a few of them also implement really new features. And it's constantly that something is breaking or something is boring and you have to keep it up to date, which is just pretty annoying.

SPEAKER_00And I think also how servers are implemented is often very poor. And one example from last week is the post hoc MCP has 180,000 or even 200,000 tokens in its tool schemas and descriptions, which is almost the entire context window of the GPT models, which is like 255,000.

SPEAKER_01It's also the effective context window of the anthropic models, as far as I'm concerned. We're told it's one million, but far out, I can get stupid clawed after 200k, 150. Yeah.

SPEAKER_00So I think MCPs, unless you absolutely need them, I would always rip them out and just remove them. And when you have weird context-winner usage, where you see, hey, I'm paying $4 or $5 on my first request already, it's probably your MCPs, which are wasting a lot of tokens. Totally. Nice. Do you want to move on to the second part?

SPEAKER_01Yeah, and just if people, if you've cloned the repo, go and do the demo and play around with it after the workshop. So yes, let's go to the second part. So just a reminder where we're at, we've just covered the core loop of an agent going through how to build a basic And then the structure of Pi, the minimal coding agent. Now we're going to get into some harness engineering. And as we know, today I'm Nico, hands and arms on his harness and he's the LLM. So do you want me to go into this markdown, Nico?

SPEAKER_00Yeah.

SPEAKER_01My LLM brain. And...

SPEAKER_00I think harness engineering is already... It's a very loaded term. And for me, harness engineering is basically context engineering, but for both the user and the agent. So you want to give the user and the agent the tools to actually pull in good context and avoid bad context. And that's everything. And if you look at the core loop, everything that ends up in conversations is basically one of three types of context. It's user instructions... Which I include something like what the user actually wrote, the files he tagged.

SPEAKER_00So basically add mentions when he actually wants to mention specific files, agents.md files, plans or skills. And in a lot of harnesses, you can actually invoke skills and they're automatically pulled in. And these are basically your instructions that you're giving to the model, the knowledge you're in BYU. The second part is environment feedback or backpressure. Which I think is the most important part if you actually want to get good results out of an agent in your code base. And the third result is two results we already talked about.

SPEAKER_00And all of that basically has to be implemented. And this is basically like a lot of my work goes into how can I actually improve the three different components? How can I improve the user instructions? How can I improve the environment feedback? And how can I actually improve the two results? Maximize signal while minimizing noise. And I will never get rid of all the noise because the model will always have to explore a code place, for example, first before it actually can identify the right files,

SPEAKER_00which are relevant for the task at hand. So there is always going to be some noise present, but I can basically reduce the amount of noise through doing some different things. I think one clear example, one interesting thing for the user instruction is basically the agents.md files, the guidance files. And the agents.md files, you basically put them across your repo in different directories. And the model should basically use them as instructions of how to act in a repo or

SPEAKER_00in a sub-repo. And the most important one, which you see in almost every single code base by now, is basically the root one that you have in the root of With the repo, you have an agents.md files, which basically tells the model how to run the different commands, like how to start the dev server, how to run the tests, how to run a linter or formatter. And OpenAI, I think, states it very well that it should give Give an agent a map and it shouldn't be like a thousand page instruction manual because the tags you have on

SPEAKER_00the rootagents.md is very high because it's included on every single thread, every single conversation. And so it should only have the most important information. And information of how it can actually gather more context and gather more information about the code base. So what you see in a lot of really good agents.md files is actually references to skills that it should load in certain scenarios. So for example, if you have like a server, CLI, web directories in your monorepo,

SPEAKER_00You can put agents.md files into every single one. And through that, you basically can reduce the amount of information you have to put in the root one. And different coding agents handle that differently. So for us, for example, if you're doing read, So if it reads or edits in a directory, we automatically pull in the agent.md file and send it to the model as well. So the agent doesn't actually have to do the work because otherwise I would have to tell the agent, hey, in every single directory you are,

SPEAKER_00Read the agents.md file first for guidance before you actually do any edits. So I'm basically wasting one to two tool calls because it has to actually figure out, is there an agents.md file in the sub-repo and then actually read it before it actually can do work on its own. And through that, if I do it automatically, I can save all of that. And Codex, for example, doesn't do that. It only basically... Parses all the agents that are in defaults, which you have in your repo, up to, I think, 20,000 characters or something like that, and throws it behind the system prompt.

SPEAKER_00And I think this is always an interesting behavior we are seeing, where a lot of people are telling us, hey, We're really surprised with AMP that they are having way better agents than the adherents that we are following the guidance more. And I think like it's largely because of that, because we automatically pull it in and the model actually doesn't have to do the tool calls, but it also doesn't forget to read them because they're automatically included.

SPEAKER_01I do wish someone told the models that we shouldn't be writing thousand-page instruction manuals. You do really need to keep an eye on what they write as agents.md. The other thing, Claude, I mean, this is almost the standard, but you still need a Claude.md symlinked to your A.md if you're going to go into your repo with Claude, I've found.

SPEAKER_00Or you just use an agent which isn't Claude, and then you have that as well. Because I think every other one is not using Claude.md.

SPEAKER_01I like your style. Of course, I couldn't not play around with Fable the last week though, to be fair.

SPEAKER_00Yeah, I think everyone has it for now. I think let's start with the third one. The two results are very basic. It's basically the two results is the bulkiest and noisiest type. The bulk of the information which you have in the context window is coming from two results. And so a lot of the harness work is actually filtering and managing the two results. And what we have a lot is specialized subagents. For example, a code-based search subagent. So the model actually doesn't have to do like... All the grabbing and reading before it actually finds the relevant files.

SPEAKER_00It can just delegate that to a sub-agent with a new context window. It finds the relevant files, sends the files back, and then it can actually decide, hey, which of those files are relevant. So it saves a lot of work to actually... Not by delegating and then actually having still a set of tool calls to run, but which are more targeted and restricted to the files, which are very likely to already be relevant. And through that, you can basically restrict the context window,

SPEAKER_00but also keep the quality of the context window pretty high. And there are a bunch of different, like Anthropic just pushed the advisor pattern, which is basically the Oracle we had since a year or a year and a half now, which is basically like an advisor, where you ask a model for additional input. Writing a plan or doing a code review, you can ask it, hey, can you advise me on this? Is this plan valid? And it also can then basically read files, look at the code base, and return a response back.

SPEAKER_00And through that, you basically just, by isolating that context window, you just save a lot of context. And the second part is the back pressure. And a lot of that, I really recommend the blog post from Geoff Huntley.

SPEAKER_01Sorry, which blog post? Jeff Huntley.

SPEAKER_00By Jeff Huntley on Backpressure, a fellow Australian, which is basically you should set up a lot of things in your code base which the model can run, which is test runners, compiler errors, linear errors. And we, for example, have, when we are running our dev server locally, the server logs are written to a file in the current workspace. And the agent knows about it through our guidance files that he basically, hey,

SPEAKER_00when the server is running, we are writing to this file so you can check the logs, should you do any experiments? And we are basically pretty aggressive for the agents to validate its work itself through actually Running AMP itself in the dev version, and then reading logs and actually validating whether the behavior is correct. And through that, you can create this backpressure, which basically tells the agent whether what it's done is correct or not. Or allows it to actually reproduce bugs,

SPEAKER_00which gives you a way better quality of output in the end. Because the agent, it can't really improve when it can't observe something. So a lot of the hardness and a lot of the setup in your code base should make the environment more observable. Awesome.

SPEAKER_01And I've linked to Jeff Huntley's teleport post in Discord. And of course, people may know Jeff Huntley from the Ralph Loop fame as well.

SPEAKER_00Yeah. Which is basically loop engineering. Which, as we discussed

SPEAKER_01in the podcast, is overrated. Sometimes useful, but deeply, deeply overrated.

SPEAKER_00Yeah. It's here, for example, for me, the test is always like, in my code base, so this is something we are trying in the AMP compase at all times. Is there anything that we can do that the model can't? And whether that's actually So it can actually do all the work that we would be doing if we would be doing it by hand. Nice.

SPEAKER_00If you scroll down, I think we talked about it as well. It's like, here is basically the feedback loop of how we do it at AMP. It's basically, we have a checked-in script which gets the standard out from the dev server. And... The agency that empty fast tells the agent where the lock lives. And we don't basically have to do all the copy and pasting into the agent. And this is part of the parity principle as well. If you see any time or notice yourself constantly copying and pasting locks

SPEAKER_00or anything into the agent, it's usually always worth writing something or restructuring your code base in some way that you can actually have the agent just do that automatically. Totally.

SPEAKER_01I'm interested in this header. Harnesses are wasting assets.

SPEAKER_00Yeah. And I think this is the curvy part that every component in a harness is basically, it's an assumption the model can't do it on its own. And this expires over time. The best examples are, for example, plan mode, I think, which is now, I think, in clock code still has it. We had it as an experimental feature at one point, but we ripped it out almost immediately because we didn't think it was necessary. Early models, they are really eager to edit.

SPEAKER_00But at one point, they were good enough that if you tell it to not edit, it doesn't do it. So you can actually just tell it, hey, plan and not edit, and it will do it. So having a separate mode for that and having additional load on the user to actually remember, hey, I always have to go into plan mode isn't necessary anymore because it's just one simple instruction.

SPEAKER_01The other example I like is, remember when we used to do chain of thought prompting? Yeah. And that led us to stronger reasoning.

SPEAKER_00Yeah, to stronger reasoning. I think that compaction basically is also like we used to write to files and then took the files to continue a new thread. And a lot of the features that you actually have will probably be relevant at some point. So you always have to revisit, hey, is this still relevant right now? And at the same time, when you add a new features, I always try to imagine, like, am I building a feature right now that is benefiting from increases in raw intelligence of future model generations? So will it be more capable?

SPEAKER_00And usually you want to build features that the model is barely able to do right now, but through the increase in intelligence, will be able to do easily in the future. And these are usually the best features that you can add to any coding agent or any agent at all. And the different plugins I added to the codebase is basically in the PyExtensions and AMP plugins are a lot of that. Basically, they are tools that I give to the agent,

SPEAKER_00which actually are prompts to descriptions, which are actually the work of harness engineering. And... I think it's really a cool look to go through the history. And this is basically like the manual context pruning, the fileless compaction, the plan mode and handoff, which was like more the 2024, 2025 era. And now we are entering like entirely new stuff.

SPEAKER_01Amazing. So that's harness engineering, people. And so we've gone through... Yeah, we've gone through, wonderfully gone through the core loop in two ways, in adding tools and doing the loop in a straightforward way, and then seeing how it operates in Pi, and of course all the code is in the repository, and then a whirlwind tour through all the important parts of harness engineering, in particular what Nico works on at AMP. And all the code here is, it's based on Pi, all the plugins are on top of Pi, so it's all in TypeScript.

SPEAKER_00It's Py and AMP. And once we go into compaction, we'll talk about compaction a bit. We can take a look at the different compactions and look at the code and how it works. So if you go in the markdown file. So basically, compaction. Why is compaction necessary? We already talked about the conversation array just keeps growing. So naturally, at some point, you run out of space. Usually, all the models are... Theoretically, you can feed a lot in there.

SPEAKER_00Practically, most models have... A usable context window, which is lower than the advertised context window. So to how much context they actually can pay attention is lower than the absolute context window they have. Fable, for example, has 1 million of context window. But at some point, it just starts to degrade. And I think it isn't like 200,000 anymore. I started to see it at like 400,000 tokens, where Fable starts to degrade and, for example, doesn't use tools as well anymore, but falls back to other stuff.

SPEAKER_01And I'm asking to Chroma's work on ContextRot in the Discord, so people can check it out. Yeah.

SPEAKER_00And so if you actually have, for one, restricted space, but also like you only have a limited amount of usable space, what are you doing if the conversation array keeps growing? And compaction was basically the first answer to that. Basically, when the window fills up, you just ask the model to generate a summary and you just delete whatever was before and then ask it to continue. And the, if you scroll down to the real limit, and the real limit for me is the context size itself or

SPEAKER_00the window size wasn't really the issue. Like for one, the effective context, which we already talked about, is a fragment. At the same time, the output was capped. And with Cloud 3.5 Sonnet, the long context was way slower and more expensive than what we have now. Because all of the inference was not as optimized as it is. So the tokens per second you got at longer context sizes was actually way slower. And so you actually could get way more done with constantly compacting.

SPEAKER_00But the models weren't smart enough. So often they really lost a lot of the important information through the summary. So you basically build up all the information in one conversation. And then once you hit the context limit, it compacted and it lost all the information in one conversation. And this was the main limitation of compaction, that basically it was useless because whatever you have built up was lost and the summary was so bad that you couldn't continue afterwards.

SPEAKER_00And if you scroll down a little bit more. And the summary basically, this is actually a quote from my blog post. And I'm quoting myself now. What I noticed is like the summary lost a lot of my instructions. It lost volume. And I also had to repeat a lot of the, for example, commands which it ran in the previous conversation or in the previous conversation array to actually basically get back pressure from the agent.

SPEAKER_00When I thought at that point the summary was basically or the failure was more structural because you just asked the model to generate a summary of the entire thread and there is a lot of information in there by design. It didn't know what the next part of the conversation actually needed. And it just basically spit out a very bad summary of a lot of context. So it summarized what's happened in a thread and not really what matters for

SPEAKER_00the next part of the conversation. And can you scroll down to how compaction works?

SPEAKER_01Yeah. And that's also why, until recently, actually, Like I far more actively when using coding agents and these types of harnesses actively manage my own context a lot more mindfully. I would build a plan with, you know, a stronger reasoning model, more expensive, slower. And then I'd start a new conversation once I have the plan with a smaller model in order to execute and restart it so that it didn't dumb out because compaction wasn't working.

SPEAKER_00Yeah. And this, I think like this really shows you like Pi has one form of compaction, which is like a newer one. The earliest one, basically it took the transcript, generated a summary, and then basically asked the model to continue. And that was it. I think like the newer version Yeah.

SPEAKER_00The built-in compaction by Py basically looks at the context window, like how many context tokens have already been used. And once it crosses a limit of like the context window minus some reserve tokens, it automatically triggers the compaction, generates the summary, appends the tail, and then it automatically continues. And it can continue basically sending a new inference to the model. Yeah. And this basically is the new compaction.

SPEAKER_00And why it's back, and I think like this is mainly one thing, the model is just way better now. So they actually, they have trained it internally. The second thing is actually appending the tail or appending some information where it left off is actually really important. And can you go into the plugins in .py?

SPEAKER_00Yes. In the extensions and into compaction.

SPEAKER_01Yeah.

SPEAKER_00And if you scroll down, this is something that Codex is doing, which is a different form of compaction than Py. Instead of actually taking the tail, it just takes all the user messages and then generates a summary and then asks the model to continue. And yeah. Yeah. Yeah. So basically, the summarization prompt is asking the model to generate a summary of the current conversation. And then you take all the user messages and prepend it to the summary.

SPEAKER_00And then at the end of the generated summary, you just annotate. Ask the model to continue. And this is basically the summary prefix, which is giving a lot of the instructions. And I think this is smarter than taking the tail, because usually the user... Messages contain the most important information because it's actually the instructions for the task. And especially the most recent ones usually include the instructions of what the model is supposed to be doing right now.

SPEAKER_00And through that, you now basically have... You have all the instructions which were already sent. You ask the model to generate a summary of what happened and what remains to be done and any critical data and examples. And these four lines in the summarization prompt are enough to Basically guide the model to generate a really good summary so it knows what already happens and what's next to do. And this is, I think like this shows you like it's very basic. It's not a complex prompt.

SPEAKER_00So the model consumed all the complex logic we have done before with stuff like handoff or plan modes or writing stuff to a file and then continuing into a new thread in basically a single prompt.

SPEAKER_01This is so eye-opening. Thorsten showed us the Emperor has no clothes, but this is like none of the Emperors in the past or the future ever actually had clothes.

SPEAKER_00Yeah, and I think this is what makes it really fun to work in a space because you can never take anything for granted because it might be gone with the next model release, which is really interesting because every new model It's basically like a puzzle that you have to figure out. It's like, how can I use it best? And what of my stuff that I actually build? What of my darlings do I actually have to kill? Because they are irrelevant now. And I think Handoff was one of the hardest to actually kill.

SPEAKER_00So where do you want to go now? Nice. You want to move on to Handoff? I think like Handoff is a really, let's skip

SPEAKER_01plan mode. I would absolutely love to go to Handoff and plan mode is dead and buried. And actually I never, I write plans with agents all the time and I never liked plan mode. It wasn't only because of the plan mode, it was the way the user experience was, particularly in Claude code. Like it really, you know, when it was like select, you go from a conversation to having like select things in the terminal. And I was like, can you stop, stop this please?

SPEAKER_00Yeah. For me, plan mode is what I'm always wondering. The models, once you mention a plan, they like to generate a lot of tokens, so they write really big files. So I usually never ended up reading them. So I think that... The benefit of a plan isn't really there. And at the same time, because they generated such big plans, it would already be easier to just see it in code and have the model write the code or implement a feature, look at it.

SPEAKER_00I think plan mode is dead now. It has been trained in that the models are doing a lot of planning themselves. And I think it started with 5.3 codecs, which actually was annoying to a lot of users, which came from cloud code, because it's just for like half an hour, hour, it's just spread files, explore the code base.

SPEAKER_00And if you look at a lot of the thinking summaries that the model sent you, what it did internally is actually build an implementation plan by looking at A lot of code and the entire code base, it basically explored it and built a mental model of how everything works right now and how to implement the feature in this code base and in this context. And I think this really made it better than a lot of the anthropic models at the time.

SPEAKER_01Siddhartha has actually reminded me one of the things I hated most about plan mode. And he said the problem for him is that to actually write the plan into a file, which you want to do, you have to go into build mode as well. Claude, at least when I use plan mode, would develop an internal plan that it wouldn't even expose to me in a markdown.

SPEAKER_00Yeah.

SPEAKER_01Quick word from our sponsor, which is, well, me. Vanishing Gradients is a podcast, workshop series, blog, and newsletter focused on what you can build with AI right now. Over 70 episodes, hundreds of hours of free hands-on workshops, all independent, all free. If you want to help but keep going, you can become a paid subscriber on Substack, starting at $8 a month, or share this episode with someone who'd get something out of it. Links are in the show notes. All right, let's get back into it.

SPEAKER_00And so if you go into the markdown document. For plan mode? For the handoff. Oh, phew. Okay. I'm glad we're not going.

SPEAKER_01Can I just say, before we do that, though, you talked about how many tokens this stuff generates. And one, I don't want to get too tinfoil-hattie or conspiracy theory. It's not a theory. It's just a conspiracy, they say. But... There is an incentive for Frontier Labs to build agent harnesses that make us consume more tokens as well, right? That's one of the reasons I'm philosophically or socially a fan of AMP and Pi and harnesses, which don't necessarily have that incentive. But there is this weird,

SPEAKER_01weird thing that they want you to use as many tokens as possible, right?

SPEAKER_00I think it depends on how you're consuming it. I think for regular users, the incentive for them is to use as little tokens as possible. Because they have a fixed subscription plan, so they want to... To consume as little resources as possible for the money the user is paying. So I think like there the incentive is perverse because in a lot of cases it's just more tokens is usually When it comes to a lot of

SPEAKER_00the enterprise contracts you have right now, I think it's exactly what you said, because usually it's now usage-based. So the incentive is for them to actually consume way more, assuming they have a margin on the usage, which they have. The... I think Fable is a good example. I think the 1 million context length is a really bad thing to set. And it is set in a lot of places. And I think if you use Pi with Fable, it's also set to a million.

SPEAKER_00Which runs up the cost massively if you're doing usage-based pricing. Because once you hit a certain threshold, you're paying the basically cash token cost at every single time. And for Fable, I think this is like... I think, I'm not sure, three, five, five dollars per million tokens, but this is per request. And because you're sending so many requests in a single turn of the loop, this accumulates really quickly. And once you cross like There are certain thresholds of token,

SPEAKER_00like 250, 300, even 500,000 tokens. Each request gets really expensive. So the accumulative token usage is so high because getting from 250,000 to 750,000 tokens is possible. Probably 200 requests. So the amount of tokens that you're actually spending is nuts. So for us, I restricted the amount of the maximum context minimum to something way lower for Fable to actually save on the cost. So we are just compacting way earlier. So it actually stays at a lower amount of tokens.

SPEAKER_01I've also found that if you tell Fable to use its own judgment to really route things to dumber, less resource intensive models, it can do that really quite cleverly.

SPEAKER_00Yeah, it got really good at delegation. And I don't think we have time to go into that today with RLMs. And I think RLMs, their main goal was to basically improve models at delegating. But I'm not sure whether you need it anymore. I think this is what... Again, Kirby. The model is actually consuming it. So you actually don't need so much logic. But Handoff. Handoff was a brain fart. And it basically came out of my frustration with compaction.

SPEAKER_00And with compaction, I basically, I caught myself constantly. When I saw, hey, I'm close to running into the context window, I stopped, asked the model to write the current progress to a file. And... I told it to basically include my instructions, include the files that are really relevant for what I want to do next. And I basically wrote, hey, I want to do X next, or I want to continue what we have been doing, write the current progress and the relevant files to Write it to a file

SPEAKER_00and include everything from my instructions as well and the important trade-offs you have discovered. And I caught doing myself doing that constantly. Basically, like every time I was close to the context window, write it to a file. So handoff was basically just a way to automate that. And handoff basically asked the user to basically write out its next instruction, so the user goal. And then it ran something,

SPEAKER_00which I think like all our, especially you, like all of us which are coming more from a data science or AI space can really appreciate. It ran a structured extraction. So it isn't just a model call where it just is writing raw text out, but it's a false tool call where the model only has one tool to call, which is this one. And it basically writes the relevant files and the relevant information. And then the new thread input is basically the file mentions, which are automatically passed, the extracted information, and the user goal.

SPEAKER_00And the user goal was such a funny thing I've added, because what we noticed with the first version of Handoff, the users wrote really shitty goals. So basically... What tasks do I want to continue on? And this caused the model to perform actually very poorly because it didn't know what to focus on in the context window. So I started to just append the user goal to... So they actually spend more effort writing extra messages. So they actually spend more effort writing extra messages.

SPEAKER_00And this makes the output of handoff really good because the model knew what to focus on, what files to extract, and what relevant information to pull over. And I think this is really often the context engineering when it's targeted. And I think that the user and the model, it's like you also have to find a way for the user to actually really give good inputs so the model can do its best work. And I think like in handoff, this was really cool to see with just like this little tweak, you can actually get way higher performance by just forcing the user with

SPEAKER_00a little notch to write better goals and better instructions. Begun through this. And I think like I basically told the whole story in a blog post. And the compaction we want, I think like the contrast is like compaction we want just ask, it was just going after length. So just ask what can be throw away to then continue. And it didn't focus on quality a lot. File-based compaction basically moved everything to the user because it was really explicit.

SPEAKER_00You have to repeat the instructions every single time. And that handoff basically kept the user in the loop, but automated everything else. And this beat every compaction implementation. We benchmarked it against at the time, but now it's irrelevant again. And it's actually like one of the complaints we get the most is still to this day, like I want Handoff to come back because it was like, it was really, it was a really cool way to control the context window a lot and do a lot

SPEAKER_00of stuff manually. But it's, I don't think it's just necessary. And I am interested, you mentioned benchmarks, and I do want to know...

SPEAKER_01When new models come out or you iterate on your harness or you rip it out and rebuild it and throw things out and put things in, how important are benchmarks versus getting it in front of users?

SPEAKER_00It's a real mix. I think like for new features we are building, I would always just give it to users and get feedback really early to see whether they actually like it and whether it improves how they are working with agents. And usually that gives me more as creating a benchmark because creating benchmarks is really labor intensive. So I'm kneecapping my own feedback loop of actually improving the product. Because I'm creating a benchmark first.

SPEAKER_01And to be clear, when we're talking about benchmarks here, we're not talking about like model benchmarks. We're talking about like AMP evals on gold datasets, right?

SPEAKER_00Yeah. So basically what, shout out to the eval courses, like the golden ones by Hamel. Yeah. I think basically what he is preaching, that you basically have a... An input and a gold output, which is usually human-written. So by me, for example, I take a thread and I write a really good summary. And this would be one example. And I basically create an eval set for that. But because that takes... So I don't have to squeeze like everything.

SPEAKER_00I can just give it in the hand of a few better users and a bunch of them, collect feedback, improve the feature first. And once I know the feature is actually really relevant, it's valuable to users, then I can start actually creating an eval set. And actually refine the prompts and the logic behind it to get better and better. And I think like this was the first version of handoff. I just threw out there and gave it to users. And then the first thing I thought, okay, performance is bad because the goal is They basically added this,

SPEAKER_00hey, append the goal to the new user message. And then next, I built an email set. And I just started basically hill climbing on the email set until I had a really good prompt for handoff. And then basically, I just... Improved it iteratively over time. And this is usually like mostly how I do it now is, hey, first put the feature out, get it in the hands of users as early as possible. And then once I know and once it's validated that it actually is already valuable at a degraded state, then spend the time of actually putting the effort in and creating evals

SPEAKER_00so I can hill climb on that. And I think for that, the evals shouldn't be compared to benchmarks because benchmarks should usually tell you, hey, how good is a model at a certain behavior? Whereas for the evals I'm building, I usually want to be like, what's the current state and where can I improve the system prompt, the tools and the model to actually get a higher score? So it's like, it's basically training on the eval set. But because that's the goal of getting way better for that specific use case, I don't mind it.

SPEAKER_00As long as my eval set is broad enough to cover the different user code bases and scenarios it throws at it.

SPEAKER_01Thank you for that detour. And I think it's really important for people to recognize the relationship between benchmarks, evals, and getting user feedback. You said maybe we skip RLMs, but maybe we can just do a brief tour of recursive language models. In pure selfishness, I want to learn a bit more about them from you today as well.

SPEAKER_00Hey, Hugo, you are the hands. You can't just force me into it. I can force myself though.

SPEAKER_01Great. Let's do it. Just sorry to recap, not kneecap, core loop of an agent we've done. Harness Engineering Compaction V1. File-based compaction, talked a bit about plan mode, then deep dive into Handoff now. What is a recursive language model, Nikolai? It's recursive language model.

SPEAKER_00I think it sounds so fancy, but it's very simpler. You basically give it code execution capabilities. You give it a repo. So for our Python users, you give it a really nice Jupyter Notebook and allow it to execute code in it. And basically all All the tools the model had, which is like read file, edit file, bash, becomes a function. And this doesn't sound like a huge innovation, but it actually allows the model to control the Context window,

SPEAKER_00similar to as in Bash, because code is very composable, so it basically can assign the output of a tool result to a variable and then run code against it to only extract Relevant sections, which it actually wants to read and print out, and then only see these parts of the context. Or it can decide to not read entire things. And through that, it's basically supposed to be a lot more context efficient and But also a lot more composable than regular tool calling.

SPEAKER_00And you basically have one root LLM, and then you have a REPL. And in there, it can write any code. And whether that's Python, I think you see two main things. You see Python repels or you see TypeScript or JavaScript repels. And through that, it can basically do a lot of interesting stuff. And in most implementations right now, I would say it isn't a true repel because it is really expensive to run something like a Jupyter Notebook at all times,

SPEAKER_00which stores all the already executed state and allows you to refer back to a variable which was defined at the top at the bottom. So usually most RLM implementations right now are some container, some sandbox where you can execute code. And the model have one additional function, which is called store usually, which it can call with a variable name. And then it's basically stored in memory or in some form of SQLite database.

SPEAKER_00And then at later points in the context window, it can refer back to it and read it out. So it's like a wrapper, but a little bit reduced in its functionality. And only when it calls something like print, it actually can look at the data within these different things. And I think it's a really cool concept, which can... Sam, I think, out of Stanford, but I'm not entirely certain. It's really cool. What we have noticed is we didn't get a lot of context improvements.

SPEAKER_00So it saves, for example, on the function calling, theoretically, because you don't have to include all the different tool descriptions. But you still have to tell it about the tools which are available. So usually it just moves the burden. So it has a file with all the tool definitions or function definitions now, and it reads them in at the start of a thread. So it doesn't read Save that much context in that domain. At the same time, it prints a lot because it actually wants to get the information.

SPEAKER_00And I think like this is still, it's part of the bias that the current LLMs have because they actually want to read and see the two results it's so trained in and that they still bias to it way more. And I think this will be improved over time. But at the moment, I don't see the context improvements by RLMs that I would have expected. But on the plus side, it gets way better delegation. So, for example, a lot of different harnesses have a lot of sub-agents. And to get a model to actually use it, you have to nudge it a lot to actually use sub-agents in the right scenarios.

SPEAKER_00And with wrappers or with code, it actually just does it way more in this way better orchestration because it's an easier orchestration primitive when you just have code as opposed when you have sequential tool calls.

SPEAKER_01Super cool. And for people who want to play around with this, in the repo, you can literally jump in with a Pi extension that's ported from Rawworks and see what's up there. As Nico has suggested, point out something ridiculous like a half a million token log file, and you'll just see Windows all the way down.

SPEAKER_00But at the same time, I think this is something that Bash already gives you to a large degree.

SPEAKER_01Well, we're about to get there, aren't we?

SPEAKER_00Yeah. Because of the whole Unix philosophy, everything which is running in a shell is already very composable. And by now, you have so many different die tools, which do a lot of different stuff and basically can't do anything, that what Usually what I can do in code and especially what I can do in the current implementations of Rebels because they try to secure it and not install a lot of packages. I can usually do way more in Bash because I have way more primitives installed.

SPEAKER_00On developer machines. Because usually they have everything they need to grab, riprap, or it's built in already. So I have a lot more functionality. And that's like part for me why I'm like, I'm not seeing RLMs yet. And I think like this will change in the future because the different providers are already starting to train on it. But at the moment, I don't see the like what it has promised to set out to do. I think like this already leads us to bash beautifully.

SPEAKER_01This is so, so exciting. And I did link earlier in the Discord to your team's wonderful post, The Coding Agent is Dead, which maybe I'll just find one of my favorite sentences. And this is, bloody hell, this is from February, right? So the current generation of coding agents is dead. The heart is still beating, yes. But the bullet has already left the chamber. This generation isn't the future. With the newest models, the agent, the prompts and tools you wrap around a model is no longer the limiting factor.

SPEAKER_01These models can be powerful with nearly any tool you throw at them. A simple tool called bash is often enough, which brings us to read tool versus bash. So should we jump into this markdown or do you want to create more? Let's do it. So as we said earlier, Pi originally had four tools, read, write, edit, bash. Seems wonderfully simple, but do we need read?

SPEAKER_00It's, I think, like, no. We have it for, I think, one more mode, which is using Haiku. And we only have it because the model isn't smart enough to actually use Bash to the same degree. Or I don't trust the model enough. That it doesn't use bash in ways that would edit anything. So I actually didn't want to give it bash. And I think all the other frontier models, GPT-5455, all the Opus models, Fable, GLM 5.2, they don't need retools anymore.

SPEAKER_00And I think this is why Reed existed or why did we want it. And we touched on it a little at the beginning that Reed got a lot more extensive. At the beginning, it was just a path. And at one point... We basically added limits. So the model doesn't have such a, or the read tool doesn't have such a big blast radius, but it reads a false file that it reads in 2,400 lines or 5,000 lines or 10,000 lines. And with read, you can actually could control it way more.

SPEAKER_00But this isn't the case anymore because the model is capable enough that it can actually use cat or set with it reducing the amount of lines it wants to read. And it's trained into the model already that you usually don't have as big as a blast radius or the model doesn't read files willy-nilly that it just decides, hey, I'm going to read 20, 50,000. And Bash, at the same time, gives you way more primitives because you can't really pipe one tool

SPEAKER_00into another tool, like take grab and take the output of grab and pipe it into read, but you can do it in Bash. So I, for example, could use grab And this helps the model. And at the same time, it is also parallelizable. So when it knows it has to read five files,

SPEAKER_00instead of actually generating five tool calls, which just add latency, it can just generate a single one, a single set call on five different files, which saves you a lot of tokens at the same time, but also a lot of tokens it actually has to generate.

SPEAKER_01And also, there's a little birdie on my left shoulder, right shoulder, whichever one saying, oh, what if you want to search? And Nico on my other shoulder says, you have curl, so it's all good in the hood. Bash gets you everything.

SPEAKER_00I think like web search is, at the moment, it's a little bit of an exception, I would say, because it's a lot of websites.

SPEAKER_01Technically, you're right. But if you have something like Pi, Pi can then extend itself using, use curl to look up something online and then use what it finds. And of course, the models are so smart, they know how to extend themselves with a harness like Pi in order to build its own search tool, essentially.

SPEAKER_00Yeah. And I think the only downside at the moment is, for example, the structured results. And so basically, if you have something like images, PDFs or something like that, you could build in more logic in a read tool that when it, for example, reads an image... Just include the image or when it reads a PDF, extract the text, summarize it with an LLM and then pipe it into the tool result. This is something you can't really do with bash anymore. So if it calls read on a PDF, It doesn't help much.

SPEAKER_00But at the same time, you either can add another tool for viewing binary files, or you can just trust the model that it actually is smart enough to use certain CLI tools that actually can handle images and PDFs.

SPEAKER_01So do you want to say much about... I mean, we've talked around why you removed it and why is it necessary. Do you want to say anything more about this?

SPEAKER_00Yeah, I think the cap problem... I think the pagination loops, we talked about it. What we have seen with read file, because usually you kept it, so it was only allowed to read a certain limit of files, so it ran into loops where it basically couldn't find the right information on a file, and it tried to solve it by reading more. So it read more and more of the files in 50 line increments and used 50 tool calls instead of actually doing something smarter, like using grab first, finding the right line numbers, and then reading it.

SPEAKER_00Because it just basically started reading and then thought, hey, maybe it's in the next 50 lines. Maybe it's in the next 50 lines. And just continue doing that. And this is just really wasteful. And in the CLI, it just instantly started with that behavior that it actually is smart enough. Hey, use grab first. Or when I don't find it in set, fall back to grab and then set again. That it actually does that way more natively. Composition is another one. I think Armin had a really good blog post. What you can do with Composition in Bash is really nasty.

SPEAKER_00It's another programming language. And this is also where I think Bash tools have even an edge overall. RLM, it's so compositional, it's crazy. And it's also, once it has written a bash tool or installs something on your device, it can use it forever. Whereas usually, like in RLMs, most of the replica code is thrown away. And at the same time, I always love if you can't just throw away stuff because you don't need it anymore. So one less tool is just beautiful.

SPEAKER_00Fantastic.

SPEAKER_01One less tool, but we don't want one less than one less because we need one, don't we? Yeah. Do you want to tell us a bit about what we lose?

SPEAKER_00What we lose, I think like what I already said, like non-text, binary files, the policy enforcement. So for example, it's not completely gone, but it's harder. So if you, for example, want to restrict the model from reading .fars, like .endfars, so you don't send a And then the API keys to the model provider. It was easy with a read file because you could just take the file path, look at it, and then it's a dot file, basically tell them, hey, you aren't allowed to read that. With set calls, which are composable, you would have to So we just redact everything when we see certain patterns in

SPEAKER_00the tool result which resemble. So we don't send it. So you can actually get around it with other logic. And line numbers for free. So the read file does line numbers, which is something the model sometimes forgets. So in set, you have a header, which It's .n, I think,

SPEAKER_00which basically allows the model to include the line numbers in the file it reads. And sometimes it doesn't do it. So then usually the edits can fail. But this also is gone in the new models because it rarely does it because it's all trained in now that it's actually smart enough like, hey, read the line numbers with it and then actually use that information.

SPEAKER_01Super cool, man. So how do you feel about moving on to edit tools versus...

SPEAKER_00Edits. I want to.

SPEAKER_01I'm not sure I'm not going to get heat from Mario or Armin on that. I hope the heat is brought. So look, as we've said, pie, four tools, read, write, edit, bash. Now tell us a bit about edit and what happens with context engineering and what your take is.

SPEAKER_00Yeah. So edit versus apply patch. I think like this is a really, it's the same trade-off, I would say as bash or street. Apply patch, it's just much more parallel, which makes it much more powerful and interesting, but it's also a more complex tool to Like the tool can do way more. So the model actually has to be trained on it more to actually use it properly. And this is why like Cloud Code, for example, and also when we use Anthropic Models, we still use the Edit File Tool and not Apply Patch because

SPEAKER_00the Anthropic Models aren't good at using Apply Patch. And edit file basically is only string replacement. And our edit file tool basically takes an old string, a new string, and a path for which file you want to edit, and a replace all as an option. So basically, when you have an old string and a new The old string which you want to replace could match at multiple locations. So when it says replace all, everything is replaced. But when it doesn't set it, you can't really do the replacement because you aren't sure which

SPEAKER_00of those you actually want to edit. So we fail in this case. This is how we do it. And I think the edit file tool is a little bit more limited than apply patch in that case. Apply patch generates hunks. And hunks are basically divs, which are then parsed and then basically taken. So basically you do something similar. Either you extract the old string and the new string or you apply it directly and you make edits. And because a hunk, which is basically just a name for a small div, has...

SPEAKER_00A file name associated with it. In a single tool call, it can generate multiple hunks, which makes edits across files or multiple edits in the same file. And it also has something other beautiful, which is context lines. Which make it very easy for the model to actually give like one or two additional lines of context before the actual edit, which basically just anchor it to tell us where the edit is supposed to be made if duplicates, for example, are present.

SPEAKER_00So if you have the same line twice, but there are different lines over it, the model would just basically take the two lines above it, then the div, and then this would basically already tell us, hey, this is the place to apply it, and it's not the other duplicate, which we have further down. A little bit against Pi, I think like if you scroll down, I talk a bit about the edit file, cool, this is batch. And here can you see basically the patch of what it's supposed to do. And it's basically update file and then the add, add in this page.

SPEAKER_00It's basically the context line. So it basically tells the model, hey, there's a context line. You don't have to do anything with it. And the minus and plus is basically the div you have. And in there, you basically already see, hey, I have the file name. I have the context line. I have the plus and minus. So basically, I'm collapsing the tool into a single thing. It's only one argument which the model still has for that tool and this is the patch and nothing else. Whereas edit file has the old string, the new string, replace all and the path.

SPEAKER_00And if you want to edit multiple files, you need to emit multiple edit file calls. And I think this is a really beautiful solution, which I think the Codex team is the first one which put that out. And it also replaces multiple tools at the same time. Like the Anthropic models, for example, have a create file and an edit file. Whereas in a hunk, you actually can say update or create or delete. And then you already have multiple tools at the same time in a single one. So it's restricting it, but doing way more.

SPEAKER_00And the interface is becoming simpler. But it's also like the model has to know more about how to actually use it. Nice. Py. Now I want to talk about why the Py built in underperforms. I talked already about the edit file tool is close to what Anthropic has put out. It's basically an old string and a new string. But they have implemented it in a way that it's much stricter.

SPEAKER_00Then the other edit file tools, and it's also an off-distribution schema. So to make it more parallel, they basically allow the model to do a tool call, which is a list of arrays of old textures. So basically, it's a list of edits, which makes the tool schema much more complex. And at the same time, it diverges from the tool schemas enough, which the model was trained on, that it seems to be the same, but isn't.

SPEAKER_00So the model often fails of generating The model are trained to use certain tools. And if the model, if the tool looks similar enough, the model wants to use it in the same way. And the further down the context window you get, the worse it actually becomes usually at calling the tool in the right way. And the more it falls back to its trained in behavior. And I think like this is the main reason why the EditFi call in Pi is

SPEAKER_00a little bit worse than a lot of our other harnesses because it makes it more complex and it looks like it's the same, but it diverges enough that it makes it way harder for the model. Super interesting.

SPEAKER_01And if people want to play around with this once again, go to the repo and check out the Pi extension apply patch, which who ported it to Pi from Codex? Did you do that?

SPEAKER_00Yeah, I did. I wrote all the extensions. I pointed it at the Codex repo. So it's like a lot of the extensions I built, it's very easy nowadays. You can't just, for example, point it at the open source Codex repo and tell that, hey, port apply patch, and it's done in one shot.

SPEAKER_01How much do you need? How well versed in TypeScript do you need to be to... I don't think a lot.

SPEAKER_00I think you can also tell the model, hey, translate this to Python for me. The thing is, nearly every coding agent but the codex one is implemented in TypeScript. So all the plugins or extensions you're building are also in TypeScript to keep it in the same language. So there's little in Python, I would say. And TypeScript for agents is just the language of choice.

SPEAKER_01Yeah. So there are a couple of questions I have for you, but you've just taken us on a wonderful tour through a lot of the main moving parts in building a coding agent, from the core loop to harness engineering, compaction, plan mode handoff, RLMs, read versus bash, edit versus apply patch. Is there anything else you'd like to add before I ask a few final questions?

SPEAKER_00I think, like, harness engineering, it's, like, it's fundamentally about tinkering and trying a lot of stuff and not getting in the way of the models, but also being really open of what you can actually do. And I think, like, this makes it really fun. And when you're using coding agents to build your coding agent as well, which is where I think, like, Pi is the best at because the entire code is open. It's the... The extensions API is really built by Mario that you can actually really use

SPEAKER_00the coding agent to build the coding agent and create like a self-reinforcing loop of making it better and better. I think like this really is like the way I expect more and more software to be built, especially in DevTools that you actually use DevTool to make the DevTool itself better. And I think like this is really beautiful. That you actually can tinker a lot. And actually the writing code part, it's like, yeah, we are losing it more and more because actually the agents are way faster and more efficient at writing code. But at the same time, you can let your ideas run way more rampant.

SPEAKER_00Because you can't try any more stuff. Like the amount of codes you can produce is immense. And I think like this invites a lot of slop that you just put everything into the code or as a feature into the code base because you can. But I think that you should actually use it to, one, strive for way more quality, polish it way more. The code we should be putting in the code base should be so much better because we can't actually just do 20 iterations on it. Implement it in three different ways in like an hour, which just wasn't possible before.

SPEAKER_00And at the same time, it allows us to experiment way more, try really wild ideas, which would be way too costly to implement otherwise. And I think like this is really a beautiful thing to do. And I think it's really fun to build software that way, even though we are losing more of the like, hey, crafty part where I'm really writing software by hand.

SPEAKER_01Yeah, it opens up whole new worlds. And I don't want to get too cynical again, but we were talking about incentives and business models before. And what a world in which I pay OpenAI to generate a whole bunch of slop, and then I pay OpenAI again to try to make it less slop, and then maybe a third or a fourth time to remove slop. You pay the providers to create the problems and then to help you solve them as well.

SPEAKER_00Yeah.

SPEAKER_01One other thing I just want to make clear about building harnesses, because when I advise people and consult and teach, I get these questions a lot. People are a bit, I think, schizophrenic around, like, how much do I need to think about context engineering and all of these things? And for coding agents, clearly, this is incredibly important. For most harnesses, agent harnesses you build, especially consumer ones, you don't need to think about this at all. Think about customer service agents, right?

SPEAKER_01Those, you want to resolve the ticket in one to five turns maximum, right? So really thinking about context engineering isn't so important when it's such a small turn conversation. So there's almost like a bimodal distribution of kind of what you need to think about with respect to harness engineering. For chat applications, for some... Deep research ones and for coding, like harness engineering, is a huge, sprawling task.

SPEAKER_01Whereas for a lot of consumer-facing agents, harness engineering, you've got a handful of tools and short conversations, and it's not what you're seeing happen on Twitter all the time, right?

SPEAKER_00Yeah, it's like, and I agree on this. It's like, I think like if you're doing live voice, yes, you have to be wicked fast. If you're doing something where I think I would happily trade off higher quality for less speed in a lot of cases. When I'm seeing the customer success or support agents, because in a lot of cases, they're just making blatant mistake. And if I would give the agent more time or let him think more and do more tool calls, I would probably get a way better result and not react. I think this is always a trade-off to consider.

SPEAKER_00Is it worth it for what you're getting out of it? It's more philosophical now. It's like, don't lose the human touch. We at AMP, we don't really have a support team. So we are doing our own customer support. So we engage with a lot of the users and fix all the bugs we get in the different channels. And engage on X, Discord, and via email.

SPEAKER_00And I think we take away a lot from that. And I think customer support and success is one of the areas where actually a human touch still matters a lot. Because what the agent can actually handle and what a human can handle, which has seen a lot already, is vastly different. And at the same time, having empathy with the guy who is sitting across from you, even if he's really frustrated because there is a bug in the product, I think still matters a lot as well.

SPEAKER_01Absolutely. And something I promised earlier that we'd talk about, Fable got its, you know, eventual general release a week ago or whatever it was. GPT 5.6 comes out tomorrow on the podcast that we've linked to. You and I talked about how Fable is a step up in taste and judgment for coding. So people should check that out. I am wondering if you can tell us a bit about what you needed to do with your harness and re-engineering your harness for something like Fable.

SPEAKER_00So re-engineering the harness. For Fable, I think like one thing is like, I'm just asking way more of the model. So in the system prompt, I have way more expectations of what really good engineering is, what I expected to do. I can push the taste the model already has way further by giving it some guidelines to follow. And I think there's a lot of stuff which I think is obvious for the most cases. For example,

SPEAKER_00deep interfaces with what a lot of people are talking about where you really want a narrow interface with a really deep implementation where a lot of stuff is abstracted. I think this is something that's a really good general guide, which you can give to the model. Also like the GPT-5.5. For example, it has certain patterns it always falls into. And theoretically, it should follow the style, the format, the naming structures of the code base. This is something Fable is already really good at, but I can push it even harder in that direction that it actually does it.

SPEAKER_00And I think with each model, this is another thing. You have to think about what... More can I ask of it that it's now possible? How further can I push it? And another thing with Fable, it's way better and it likes to delegate way more. So I actually can give it a bunch of sub-agents which are specialized and do certain sub-tags. And it writes really good instructions. And at the same time, it is really smart of actually not just accepting what the sub-agents do,

SPEAKER_00but actually thinking on it and actually giving feedback or adjusting. And pushing back when it's not happy with the result, that with sub-agents, you can also squeeze way more out of it. So for us, it's also like, what models are the best sub-agents to give Fable access to, which makes sense in terms of performance costs in tandem with Fable. Awesome.

SPEAKER_01And just let me ask you, do you get early access to models so that you're able to build what you need to?

SPEAKER_00Yeah. Depends on the provider. But generally speaking, yeah.

SPEAKER_01So have you been working with 5.6 yet?

SPEAKER_00Yeah.

SPEAKER_01Are you able to tell us what you, without, I'm sure you've signed NDAs and that type of stuff, but can you tell us anything that you had to do with 5.6?

SPEAKER_00I don't think I'm allowed to. I understand.

SPEAKER_01Yeah, I was pushing the friendship there. I just got a message from OpenAI's lawyer, legal team. Okay. I've been banned from all... My social profiles are down now. No, I'm kidding.

SPEAKER_00I think most coding agents or I think most of the bigger users of the different providers, I think also the really big enterprises, which are just massive consumers, get something like early access that they can iterate on it because it's in their incentive as well to get people to the models as fast as possible so they

SPEAKER_01can deprecate the old ones. Let's not talk about deprecation today. I mean, we've been here for two hours. If you get me started on deprecating models. But Nico, one thing you mentioned which I really like, you encourage people to spend half a day or a day checking out the Pi source code. And I'd very much encourage everyone to do that. But if people are interested in just learning more about this and building more, what would you encourage people to do?

SPEAKER_00I think, first of all, use coding agents. And whether that's an expensive or a cheap model, it really doesn't matter. I think often I can learn more from using cheap models and making actually the harness better than from using. And you also learn a lot because usually like when a model does really stupid stuff, often it's in your instructions because you phrase it poorly or leave just a lot of unknowns, unknowns to the model or known unknowns for you.

SPEAKER_00So I think just using coding agents a lot, whether it's expensive or cheap models, and actually trying to think about how can I squeeze more performance out of it will help you a lot because it's fundamentally about communication. And then just using it and trying to improve it for yourself. And actually seeing whether you can squeeze way more performance out of it, I think it's just a fun habit to go into, even if you end up not using it at the end. And I think like we saw a lot of enterprises which put out like their own harnesses,

SPEAKER_00own automations. From what I've heard of them, a lot of them are like half a year where barely used anymore because it's just a lot of work to keep them up to date. So there's something you have to expect as well. But I think that you gain more of an appreciation of like what the harness actually do and you gain a better understanding of what I can actually expect from the model and how to work with it properly if you actually try to build your own harness and improve it

SPEAKER_01over time. So good. So everyone, you heard it. You heard it from the source. Keep building. Build your own harness. Play around with it. Use less intelligent with faster and less expensive models as well in order to push yourself, in order to keep thinking, and in order to get as As much juice out of them as possible. It's time to wrap up. We've had over 150 people join in real time throughout. So thank you all for joining, for sticking around. Do check out all the other things we do, other workshops we have, everything's in the description.

SPEAKER_01But most of all, thank you, Nico, for coming and sharing all this cool stuff with us. And the repo, of course, everyone jump into the repository as well. I'm really excited to see what happens next at AMP, Nico.

SPEAKER_00Nice. Thanks for having me. And the next time when you invite me again, should you invite me again? I can't wait.

SPEAKER_01Thanks for tuning in, everybody. And thanks for sticking around until the end of the episode. I would honestly love to hear from you about what resonates with you in the show, what doesn't, and anybody you'd like to hear me speak with, along with topics you'd like to hear more about. The best way to let me know is currently on LinkedIn, and I'll put my profile in the show notes. Thanks once again, and see you in the next episode. Thank you.

Open the transcript file

Hosts and Guests

Nobody is credited on this episode yet.

Credit the people on this episode

Be the first to rate this episode

More episodes

All episodes
  1. The Science and Engineering of Agent Work

    Oct 12, 20262 hr 22 minAudio

    Hilary Mason, CEO of Hidden Door, works with agents across software development and creative projects. Drawing on Richard Hamming’s distinction between science and engineering, she describes agents as “bringing the...

    Credit the people on this episode

  2. The State of Agentic Data Science

    Oct 5, 202659 minAudio

    Agents can write the code, run the analysis, and produce a convincing explanation. How do you check that they’ve answered the right question, used the data appropriately, and reached a conclusion you can act on? I...

    Credit the people on this episode

  3. The Rise of the AI Scientist

    Sep 4, 20261 hr 11 minAudio

    “If you feel that a product is hard to eval, or you feel like, ‘I don’t even know how to eval this,’ it’s a strong smell that your product isn’t good.” - Hamel Husain, on AI product design An AI data agent tells you...

    Credit the people on this episode

  4. If Developers Build on Chinese Open-Weight Models, Who Leads AI?

    Aug 3, 20261 hr 18 minAudio

    “It would be sad if local models were not an option and there were only proprietary models. It’s good to have alternatives. Competition is good for business.” - Sebastian Raschka, on open-weight AI Kimi K3’s weights...

    Credit the people on this episode

  5. Four Months Inside a Production AI Agent: What Real Users Changed

    Jul 25, 20261 hr 5 minAudio

    When ML/AI Engineer William Horton last joined me, Maven Assistant had reached its first external users the day before. The healthcare AI agent was available to 20 percent of Maven Clinic’s users, and the team had...

    Credit the people on this episode