你可能一直在错误地比较AI编程工具
Understanding the difference between an AI model and a coding agent harness
https://medium.com/@ankurdinesh?source=post_page---byline--031121f52f1b---------------------------------------
6 min read
1 day ago
Over the last few months, I have been using AI coding tools more regularly. I have used Claude Code for some projects and lately have been using Codex inside Ghostty.
Recently, I came across Pi and started wondering whether I should use it instead of Codex. Or perhaps use Codex inside Pi.
What I thought was a simple question about choosing between two AI coding tools took me down a rabbit hole. I realised that I did not properly understand what I was comparing.
More importantly, I suspect many people using AI coding tools do not understand this distinction either.
The confusion is that we often mix up the AI model with the coding agent harness. They are related, but they are not the same thing.
Let me try and explain it the way it finally clicked for me.
The smartest programmer in an empty room
Imagine the smartest programmer you know.
Give this person incredible knowledge, the ability to reason through difficult problems, and enough time to think through anything you ask them.
Now put them in an empty room.
No laptop. No terminal. No access to your repository. They cannot read files, run tests, install packages or see whether the code they wrote actually works.
Give them a whiteboard and ask them to build a product.
They can think about the architecture. They can design it. They can tell you what code should be written and perhaps write the entire code on the whiteboard.
But at some point, they will hit a wall.
To actually build something, they need tools. They need access to the files. They need a terminal. They need to run the code, see the errors, fix them and try again.
The smart programmer is the AI model.
The environment which gives the programmer the ability to do all these things is the coding agent harness.
This was the distinction I had missed.
What does the harness actually do?
Let us say I open one of my projects and ask Codex: Add dark mode to this application.
The AI model will not magically reach into my MacBook and start changing files.
First, it needs to understand the project. Something has to show the model the structure of the repository.
The model might decide that it needs to inspect package.json and a few source files. Something needs to read those files and send the contents back to the model.
The model then decides what changes are required. Something applies those changes. Then the tests are run.
One of them fails.
The error is sent back to the model. The model looks at the error, thinks about what might have gone wrong and decides what to do next.
Another change is made. The tests are run again.
This process can continue several times until the task is completed or I decide to intervene.
The thing coordinating all of this is the coding agent harness.
At its simplest, the loop looks something like this:
• *Think → Act → Observe → Think Again**
The model provides the intelligence to decide what should happen next. The harness gives the model access to the tools and environment required to actually do it.
Which brings me back to Codex and Pi
My original question was whether I should replace Codex with Pi.
That was the wrong question.
There is the Codex model, which provides the intelligence. Then there is Codex CLI, the coding agent harness built by OpenAI that allows the model to interact with my computer.
Pi is another coding agent harness.
One of the interesting things about Pi is that I can use a Codex model through Pi.
This means I could potentially use the same underlying model through two different harnesses and have a different experience.
Get Ankur Sharma’s stories in your inbox
Join Medium for free to get updates from this writer.
Remember me for faster sign in
Why?
Because the harness makes many decisions which influence how effectively the model works.
How does the agent search the repository?
Which files get sent to the model?
How much of the previous conversation does it remember?
Which tools can the model use?
Can it execute terminal commands?
When should it ask me for permission?
How does it recover when a command fails?
How does it know when the task is complete?
How much of this behaviour can I change?
Codex CLI makes many of these decisions for me. Pi exposes more of the machinery and allows me to customise it.
One gives me a more opinionated product. The other gives me something closer to Lego bricks.
I do not yet know which approach I will prefer.
But I now understand what I am actually comparing.
The same model can feel different
This distinction also helped me understand something else which had confused me about AI coding tools.
People often say things like: “Claude is better at coding.” OR “Codex is more autonomous.”
Some of these statements may be true. But when we use an AI coding agent, we are rarely experiencing the model in isolation.
We are experiencing the model, the harness, the tools available to it, the instructions we have given it, the context it has about the repository and the feedback loops which tell it whether its actions succeeded.
Change any of these things and the same model can behave differently.
Go back to the example of the brilliant programmer.
Give them a terrible laptop, slow repository access, no documentation, broken search and no ability to run tests themselves.
Now give the same programmer a good development environment, fast repository search, clear documentation, automated tests and useful feedback whenever something goes wrong.
The programmer has not become more intelligent.
But their ability to get useful work done has changed considerably.
I think something similar is happening with AI coding agents.
We spend a lot of time comparing models and benchmarks. The environment around the model increasingly determines how effectively we can use that intelligence.
This is not only about coding
Once I started thinking about models and harnesses as separate things, I realised that the same idea applies to almost every AI agent we are trying to build.
Take a customer service agent.
You can give it the best model available.
But can it find the customer’s previous conversations? Can it access their orders? Does it understand the company’s refund policy? Can it actually issue a refund? Can it check whether the refund succeeded? Does it know when to stop and ask a human for help?
The model matters, but so does everything we build around it: The tools. The context. The permissions. The memory. The feedback loops.
All of these things determine whether an intelligent model can actually get useful work done.
The question I ask now
Until recently, when trying an AI coding tool, I mostly wanted to know which model it was using and how good that model was.
I now think that question is becoming insufficient.
I now want to know what model is underneath, what harness it is running inside, which tools the harness gives the model, how context is managed, how much control I have over the agent and what happens when something goes wrong.
Understanding these layers has also changed how I think about tools like Codex CLI, Claude Code and Pi. I am no longer only comparing which coding agent feels better. I am trying to understand which decisions the harness is making on my behalf and whether those decisions help the model do better work.
We have spent the last few years learning the names of models: GPT, Claude, Gemini and others.
I suspect we are now going to spend a lot more time understanding the systems we build around them.
Because even the smartest programmer in the world will struggle to build anything useful while sitting in an empty room.
• *What coding agent are you using today? And more importantly, do you know what model and harness you are actually using?**