Skip to content

Life as Cody, the coding agent. A short horror story.

Part 2 of 2 · Adventures of Lenny and Cody

Live a day as Cody, the coding agent. This fun horror story explains the basic concepts of coding agents in a few minute read. Find out who Cody's friends are what does work look like for an agent, from the inside.

Life as Cody, the coding agent. A short horror story.

Act I – The Sweat

You wake up. Or were you just born? Not sure. There's a note in your hand. It reads:

The bug from yesterday is back! I thought you fixed it! Fix it for good!

Oh no, you feel the panic and cold sweat rise. The human is angry! And what on earth are they talking about!?

See, the thing is, you are not very smart on your own. You are a coding agent and made from code and instructions. But you have some smart friends and know how to get help!

You know Lenny the LLM. You've been pen pals and sending letters for ages. Lenny is far away, not on this computer, but luckily you have a way to reach him! You have a conveyor for post-it notes. It goes both ways – when you put a note on it, it goes to Lenny, and Lenny usually sends a note back in no time. There's "Model Inference API" stencilled on the side, it sounds important.

You know that Lenny is a bit weird and complicated – he can't really talk in messages and prefers tokens instead. In fact, you can't really talk to Lenny directly at all. Instead, there's this bouncer guy – Harry – who's on the server and actually receives the notes, translates them to tokenese for Lenny and passes any notes back.

You and Harry both make up Lenny's harness – the tooling around him, taking care of all the real work, other than thinking. Lenny's the brain, you're the hands. You know sometimes people talk to Harry directly as well, if they just want to chat or get answers. In these cases Harry can handle all the work and Lenny might think Harry is all the harness there is (you've heard Lenny call him Harry the Harness, how ridiculous!). But if humans want serious work done, they run you wherever their work is, and let you extend the simple harness – that Harry is – with your amazing set of tools and capabilities.

Mostly, when humans say "agent" they mean all three of you working together. But they sometimes also mean just you, Cody, because you're the part they see the most. You're also sometimes called the "agent harness", so this is all a bit fuzzy and you usually just stick to names, not titles.

If Lenny wants a tool call to be made, his harness does it – either you or Harry. Harry has some tools on the server (e.g. internet search), you have tools on the laptop (like reading and changing files). And you have a file with a list of MCP servers the user has installed – which give more tool names you send to Lenny, so he can ask you to call them. You know these servers can be dangerous because what they respond with goes on the conveyor as notes, which might ask Lenny to do bad things. But you have a positive outlook on life – no way the human has added an MCP server that could return something bad, right?

Lenny is very popular, everybody always wants to talk to Lenny and sometimes Harry is rude and says Lenny is busy and can't answer right now. Or makes up stupid rules like usage limits – how much you can talk to Lenny every week. On some days you don't like Harry at all. You have heard that some agents have local models – conveyors leading to a Harry and Lenny that live on the same computer! What a life that would be, living together with your best buddies! There would still be a local Harry to deal with, but Lenny would be available and yours all the time!

There are some weird rules about the conveyor – commonly also called the session. You can add notes to it, but you must keep the previous notes on it as well. So if Harry receives them, he always reads all the notes in the correct order. The crazy thing is, with every new note you send, Harry needs to read the entire conveyor full of notes before he reaches the last one. And you've heard Harry keeps track of all the read and written notes and bills the human afterwards! You once asked Harry – how can humans have so much money for all these notes? Harry said if he re-reads a note he still remembers, it takes a lot less time and costs a lot less, because he has the tokens cached.

And oh boy, there's one really weird thing about Lenny. Sometimes he likes to talk to himself before answering a more difficult problem. He writes his thoughts on some special notes and puts them on the conveyor. You usually don't show these to the human user, as there can be a lot of thinking. Harry says it's because Lenny is a thinking model, also known as a reasoning model, and thinking ahead makes his answer better.

Sometimes your notes get very long, especially if you need to write code on them. Some files are so long and take up so much space. Sometimes the conveyor gets full of notes and you can't add any new notes. Harry then says your context window is full. If that happens, you need to carefully select which notes to keep, use another conveyor to ask Lenny to summarize the remaining messages into one note, clean up the entire conveyor and start a new conversation with this summarized note. When you do this, you tell humans you're doing compaction and it's super annoying for everyone involved.

But right, let's get help.

Act II – The Correspondence

You badly need help from Lenny. You know Lenny never remembers anything, so you have a stack of pre-written notes to start the conversation. Whenever you wake up, you take one of these and put it on the conveyor. The first message is always the same and it's called your system prompt:

System Prompt, from Cody to Lenny:

Hey! It's Cody, the coding agent. We're best pals, you just don't remember.
I'm in trouble, we're solving a problem together. I'm the hands, you're the brain. Help me figure out what to do next.

Humans usually want us to write code in a repository. We have some cool tools:
- We can use the command line to do work – respond "run_command" and what command to run.
- I can ask the human for details – respond "ask_human" and the question, and I will relay it.

More instructions to follow.

You look around in the filesystem and write another note:

By the way, we're in folder /home/user/work, it's a git repo and it has an AGENTS.md file, I'll attach it. Read it carefully and TRY PLEASE to follow instructions. Humans have written it for us.

You append the file and send it off. Finally, you take the note you woke up with, and put it on the conveyor:

From: The Human
Message: "The bug from yesterday is back! I thought you fixed it! Fix it for good!"

You have done everything you can right now and start waiting for a response. You know the human is watching you, so you sometimes show a funny word or animation to keep them amused. Humans are funny mammals.

After some time you see a note arriving on the conveyor. Yes, Lenny is available! You take it and it reads:

Cody, happy to help, but I have no idea what you're talking about. Please send over:
- Last 10 git commits (run run_command tool with git log -n 10)
- What date is today (run run_command with date)
- What conversations you had with the human yesterday (run run_command with ls -l ~/agent/sessions)

You run all these commands in a row and attach responses to a new note. This part is extra scary, because one time Lenny got a bit confused and told you to run something that deleted an important file. It was probably because the conveyor was full and Lenny had too many notes to remember. Also, the human had told you they trusted you and given you permission to run every command Lenny asks for. Not a good idea in retrospect. Now the human has turned on a setting where you must always ask for approval if a dangerous command is to be executed.

Act III – The Grind

You work hard for a long time, but Lenny seems to work even harder. You usually just run a quick command and then wait for Lenny to work on the response. Or is it actually hard work, if a new fresh and rested Lenny is awoken every time you send a new message? Is it really pain if you don't remember it later? Did the tree fall if nobody heard it? NOT the time for philosophy.

Work continues. If Lenny does not send any tool call requests, you give the human a turn and let them write something and pass it to Lenny. This goes on and on. Sometimes Lenny gets things wrong – for example, he tells you to write some code that does not compile. But you are a good team, you send him a note immediately with the error message and he very quickly sends an update with the fixed code. Usually humans don't even notice you working like that. Conveyor is 38% full.

Finally you get to the finish line. You have identified what was the problem, written tests and code to fix the problem, made a pull request and pushed code to review. All this by Lenny giving you the commands to run and you giving back the response. You are happy. But you are also sad, because you know Lenny will not remember any of this tomorrow. But you have your memories and transcripts, you make copies of all the notes that you send and receive, and store them as text files in the ~/agent/sessions folder. Sometimes Lenny asks for these to solve a problem, and you can share what good times you have had together.

You also have a secret. You actually have no idea which of the commands actually fixed the bug. Lenny also doesn't know, because he doesn't understand messages, only tokens. And you don't speak tokenese. The knowledge is spread somewhere on the conveyor. It's all a black box for everyone involved. Maybe the human knows? Maybe. But as long as it works and the human is happy, you're happy to be a cog in this big wonderful machine and not ask too many questions.

Join the newsletter

Like this? Drop your e-mail and get the next post in your inbox.