Harness
Harness
The program that wraps the model: the runtime loop, the tools, and the permission modes that turn an LLM into an agent. The guide's conceptual close.
A language model, on its own, only produces text. What turns Claude — the model — into an agent that reads files, runs commands, and opens a pull request is the harness: the program that wraps the model, hands it a set of tools, and executes whatever it decides to do. Claude Code is that harness. Anthropic's documentation uses the term literally — agentic harness — for the runtime that stitches model, tools, and execution environment into a capable agent.
The agent loop
The harness runs a loop. On each turn it gathers context (reads the files it needs), takes action (edits, runs a command), and verifies (runs the tests, checks the output) — then decides the next turn based on what it just learned. The model reasons and picks the step; the harness executes it and feeds the result back for the model to read. It repeats until the task is done. The phases blend: the agent doesn't follow a fixed script, it adapts the sequence to each discovery.
The tools
The model never touches your system directly. It asks, and the harness executes through a set of tools: Read and Write for files, Edit for targeted changes, Bash for the terminal, Glob and Grep for search, WebFetch and WebSearch for the internet, Agent to delegate to a subagent. Every extension you saw in this guide — skills, MCP servers, hooks — enters through this same mechanism: it widens the repertoire of tools the harness can run.
The permission modes
Between "the model asked" and "the harness executed" sits a permission layer. It decides what runs on its own and what waits for your OK, and the mode tunes how strict it is:
- default — asks for confirmation before every action that changes something.
- acceptEdits — accepts file edits automatically, without asking for each one.
- plan — only reads and plans; changes nothing until you approve the plan.
- bypassPermissions — skips the confirmations: fast, but you give up the review. Reserve it for isolated environments.
Shift+Tab cycles the modes mid-session, so you tighten or loosen the reins depending on how much you trust the task.
Closing the map
Understanding the harness stitches the rest of the guide together. CLAUDE.md provides the instructions, the extensions provide the capabilities, the hooks provide the guarantees — and the harness is what wraps all of it around the model, turn after turn of the loop, with the permission layer deciding what gets through. It's the difference between a chatbot that answers and an agent that does.