← Back to context

Comment by weego

2 days ago

what is a harness? The comments below are mixing IDE/ADE but other suggestions are purely terminal things and I don't get what their value is over just a terminal. Is a harness like a loop where it's just a vague thing that everyone nods about but everyone is nodding at something different?

The harness is the agent. LLM's can be asked to output things in JSON for example. The LLM then literally asks for things like "execute this cmd" or search/replace this string. The LLM outputs text, but in a deterministic format that can be parsed. The harness calls the LLM, exposes tools, executes tools the LLM asks for, gates tool use based on security controls. It's the runtime that the agent uses to do work.

  • Are the LLM and agent the same thing? Why different nouns ?

    • The LLM is the core model, but the harness has the prompts/tool definitions, guidance/recovery/correction code. The harness itself is the agent, because same model may perform vastly differently on different harnesses. Agent is the system working as a whole, harness+llm.

    • LLM is just the thing generating text. It can generate a book, an article, a paper or a conversation. It's the raw "autocomplete" mechanism. You give it input, it generates output.

      The agent/harness is the sotware that leverage this "dumb" autocompletion engine to do useful things by sending the good input to the model and doing useful things with the output.

    • LLM is the digital brain. Agent is a software robot with "sensors" (tooling to read data from files/web) and "actuators" (tooling to perform changes in the environment) that is based on the digital brain.

My understanding is that the harness is the set of function calls (or tool calls) that let the LLM interact with your codebase. It's independent of the IDE or CLI.

The tool calls will be, among other things, something like ReadFile, RipGrep, PatchFile, Shell.

When people talk about the value of different harnesses, they're also implicitly talking about the quality of the system prompt.

The same exact model, when given a different set of tools and a different system prompt, can behave differently.

A harness is the tooling around an LLM that uses its responses to do work. For example, let's say a harness sends your message to the LLM and the LLM emits a tool call - the harness is responsible for processing that tool call, executing the tool, and then sending its response back to the LLM to get more of its turn. The harness is responsible for keeping the conversation history to send back to the LLM each time it needs more completion. The harness is responsible for displaying the user interface that allows you to send instructions to the LLM or configure MCP servers or whatever. Claude Code is a harness, Pi is a harness, OpenCode is (technically) a harness, it's basically the LLM "client". The model is what generates the completions itself, but the harness is how you invoke it. And generally when people say "agent" they mean the harness hooked up to some model.

Harness is a set of artisanal prompts.

  • You might be joking, but a harness provides much more than just the prompts: at a minimum, it provides the system prompt and the built-in tools that the LLM can use, but it can also provide things like subagent management, custom compaction logic, session forking, etc.

It’s a new buzzword where everyone says it but means entirely different things. You can use it to sound smart whenever there’s a conversation about how you’re not extracting value from your coding agent and also when you are extracting really good value. Very flexible term!

  • No it actually means a thing. A harness is the loop while(true) {command = ai.prompt(response); response = run(command);}