# Anatomy of a Coding Agent — Coding Agents & AI-Assisted Development

Source: https://www.geekswithgeeks.com/en/coding-agents/b-anatomy

> Name the parts: model, harness, tools, context and permissions.

## The model is only one part

A coding agent is more than a language model. The **model** decides what to do next. The **harness** (the program around it) runs the **loop**: it sends the conversation and tool descriptions to the model, executes the tool calls the model requests, appends the **observations** (file contents, command output, test results) and calls the model again. **Tools** give hands and eyes: read and search files, edit files, run shell commands and tests, use git, fetch documents, call external services (for example through MCP). **Context** is everything the model can see at once (instructions, relevant files, history); **permissions** decide which tools may run without asking. Much of what makes one agent better than another lies in the harness: how well it chooses context, how reliably it edits files, how it recovers from errors, and how safely it handles permissions.

## The parts in one picture

Read top to bottom: goal in, verified change out.

```text
goal ("fix failing test") + instructions file + repo map
        |
   [ harness / loop ] <-- tool descriptions, permissions, budgets, logs
        |   ^
        v   | observations (file text, command output, test results)
   [ model ]  --- picks next action ---> [ tools: read, search, edit, run tests, git, MCP ]
        |
   done?  -- yes --> diff + summary for a human to review
          -- no  --> next step (until the step/cost limit)
```

## Read the logs of a run

The sequence of tool calls tells you exactly how an agent reached its answer. Learn to read it.

**Quiz:** What does the harness do?

- [x] Runs the loop: calls the model, executes its tool requests, feeds back the results
- [ ] Trains the model
- [ ] Replaces the tests
- [ ] Stores the model weights

*Answer:* Runs the loop: calls the model, executes its tool requests, feeds back the results. The harness is the program that turns a model into an agent.
