> ## Documentation Index
> Fetch the complete documentation index at: https://docs.twill.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Harness vs LLM

> Understand the difference between the AI model and the coding agent that wraps it

## Overview

When working with AI coding agents, two components work together:

<CardGroup cols={2}>
  <Card title="LLM (Language Model)" icon="brain">
    The underlying AI model—Claude, GPT, etc.—that reasons about code and generates responses.
  </Card>

  <Card title="Harness" icon="terminal">
    The coding agent CLI: tools, commands, agentic loop, permissions, and all the features that let the model interact with your codebase.
  </Card>
</CardGroup>

## The Harness

The harness is the coding agent CLI that wraps the model. It's what transforms a language model into a functional coding assistant. Key components include:

| Component              | Examples                                                                 |
| ---------------------- | ------------------------------------------------------------------------ |
| **Tools**              | Read/write files, run bash commands, search code, web fetch              |
| **Agentic Loop**       | Multi-turn execution that lets the model plan, act, observe, and iterate |
| **Permission System**  | Controls what the agent can modify, execute, or access                   |
| **Sub-agents**         | Specialized agents for planning, exploration, verification               |
| **MCP Integrations**   | External tool servers (GitHub, Linear, databases)                        |
| **Context Management** | What files, history, and information the model sees                      |

<Note>
  Different coding agents have different harnesses. Claude Code, Cursor, Cline,
  Aider—each has its own tool set, permission model, and execution flow.
</Note>

## Why Model Providers Train on Specific Harnesses

Model providers typically use reinforcement learning (RL) to improve their models for coding tasks. This training happens on a **specific harness**:

* Anthropic trains Claude models using the Claude Code harness
* OpenAI trains models using their own coding agent infrastructure
* The model learns tool-calling patterns, when to ask for permission, how to handle errors

### What This Means

A model optimized for one harness may behave differently in another:

| Scenario                     | Impact                                                             |
| ---------------------------- | ------------------------------------------------------------------ |
| Claude in Claude Code        | Well-optimized—trained on this harness                             |
| Claude in a different agent  | Generally works well, but may have subtle differences in tool use  |
| GPT in Claude Code's harness | Works but tool-calling patterns may differ from native environment |

Modern models are designed to generalize across tool definitions, but they often perform best in their native environment where they were trained to use specific tool patterns.

## Delegate Tasks to Native Harnesses

In Twill, tasks are delegated to coding agents running in their **native environments**. Each model operates with the tools, patterns, and execution flows it was trained on.

<Info>
  By matching models to their native harnesses, you get optimal tool-calling
  behavior, better error handling, and the full capabilities each provider
  intended.
</Info>

This approach means you can choose different agents/models depending on the task and your preferences.
