# What is a coding agent?

> A coding agent is an AI program that writes and runs code in a loop until a goal is met: it reads files, edits them, runs commands and checks the result.

Updated November 22, 2026 · https://usecoral.app/glossary/coding-agent

A coding agent is an AI program that writes and runs code in a loop until a goal is met. You describe the task; it reads your files, edits them, runs commands and tests, reads the output and tries again. Claude Code, Codex, the GitHub Copilot CLI, OpenCode and Gemini CLI are coding agents.

People also say “AI coding agent”, “agentic coding tool” or just “agent”. What makes it an agent is the loop and the tools, not the model behind it.

As of November 2026, from Simon Willison’s [Agentic Engineering Patterns](https://simonwillison.net/guides/agentic-engineering-patterns/what-is-agentic-engineering/), the [SWE-agent paper](https://arxiv.org/abs/2405.15793), and Anthropic’s and OpenAI’s own docs for their agents. The tools change every month, so their pages win if this one disagrees.

<p data-cta="guide_top">Every coding agent stops to ask before risky steps, and the prompt waits in a terminal you aren’t looking at. Coral puts every waiting agent in your Mac’s notch, so you answer with one key. <a href="/download">Download Coral for free</a></p>

## Where the term came from

**The definition.** Simon Willison’s working definition of an agent is short: “Agents run tools in a loop to achieve a goal.” The software calls a model with your prompt and a set of tool definitions, runs whatever tools the model asks for, and feeds the results back. Coding agents are “agents that can both write and execute code”: one of their tools runs code, so they can test their own work ([Willison](https://simonwillison.net/guides/agentic-engineering-patterns/what-is-agentic-engineering/)).

**2024: research agents.** Princeton’s [SWE-agent](https://arxiv.org/abs/2405.15793) (May 2024) gave a language model its own “agent-computer interface” to “create and edit code files, navigate entire repositories, and execute tests and other programs”, and scored well past earlier models that couldn’t run anything, on real GitHub issues from SWE-bench.

**2025: agents in your terminal.** Anthropic introduced [Claude Code](https://www.anthropic.com/news/claude-3-7-sonnet) in February 2025 as “a command line tool for agentic coding”, in research preview, and made it generally available with [Claude 4](https://www.anthropic.com/news/claude-4), adding GitHub Actions and IDE integrations. OpenAI launched Codex in April 2025 ([OpenAI](https://openai.com/index/introducing-the-codex-app/)); its [Codex CLI](https://github.com/openai/codex) is “a coding agent from OpenAI that runs locally on your computer”. By 2026 the phrase covered every agent in a terminal, an IDE, a desktop app or the cloud.

## What it looks like in practice

Every coding agent runs the same loop:

1. **Read.** Search the repo, open files, read the error.
2. **Plan.** Decide the next step, sometimes as a written plan you approve first ([plan mode](https://usecoral.app/guides/claude-code-plan-mode)).
3. **Act.** Edit a file or run a command.
4. **Check.** Read the output or the test result.
5. **Repeat** until the goal is met, then report back.

The tools behind those steps are much the same across agents: file reads and searches, file edits, a shell, often web fetch, and [MCP servers](https://usecoral.app/guides/codex-mcp) for anything else. What differs is how they decide when to ask you first:

| Agent | What it does without asking, by default | Where it stops to ask |
|---|---|---|
| **Claude Code** | Interactive sessions start in auto mode (v2.1.283 and later), where a classifier reviews each action ([auto mode](https://usecoral.app/guides/claude-code-auto-mode)) | Actions the classifier blocks, `ask` rules, questions and finished plans; Manual mode asks before every edit and command ([permission prompts](https://usecoral.app/guides/claude-code-permission-prompts)) |
| **Codex** | Edits and commands inside the project, in an OS sandbox with no network (`workspace-write`, `on-request`) | Writing outside the project or needing the internet ([Codex sandbox](https://usecoral.app/guides/codex-sandbox)) |
| **OpenCode** | Most tools allowed | Actions outside the project ([OpenCode vs Claude Code](https://usecoral.app/guides/opencode-vs-claude-code)) |

Coding agents also run where nobody is at the keyboard: `claude -p` in a script, Claude Code GitHub Actions, `codex exec`. There, an action that needs approval doesn’t get one: it’s skipped or fails. That’s the starting point of a [software factory](https://usecoral.app/glossary/software-factory).

<p data-cta="guide_body">When an agent on your Mac stops to ask, Coral shows it in the notch with what it wants to run. <a href="/download">Get Coral, free</a></p>

## Coding agent vs autocomplete, chat assistants and background agents

| Term | What it does | Who runs the code |
|---|---|---|
| **Autocomplete** | Suggests the next lines as you type | You |
| **Chat assistant** | Answers questions and writes code you paste in | You |
| **Coding agent** | Takes a whole task, edits files, runs commands and tests, iterates | The agent, inside the permissions you set |
| **[Background agent](https://usecoral.app/glossary/background-agents)** | A coding agent that runs without you watching, often in the cloud or CI | The agent, and you meet the result as a PR |

Two terms sit one level up. [Agentic engineering](https://usecoral.app/glossary/agentic-engineering) is the practice of building software with coding agents. [Agent orchestration](https://usecoral.app/glossary/agent-orchestration) and an [agent swarm](https://usecoral.app/glossary/agent-swarm) are about running many of them at once.

## A worked example: “fix the failing date test”

Here’s what one task looks like in Claude Code in Manual mode, step by step. It’s an illustration of the loop, not a recorded run.

1. You type: *“The test in `dates.test.ts` fails since yesterday. Find out why and fix it.”*
2. The agent runs a search for the test name and reads the test file. Reads need no approval.
3. It wants to run `npm test -- dates`. **Prompt:** allow this command? You press yes.
4. It reads the failure (an off-by-one in a time zone conversion), then reads the function under test.
5. It wants to edit `formatDate.ts`. **Prompt:** allow this edit? You check the diff and press yes.
6. It runs the test again (allowed this time, if you picked “don’t ask again”) and sees it pass.
7. It reports what was wrong and what it changed.

Two of those seven steps waited on you. In [auto mode](https://usecoral.app/guides/claude-code-auto-mode) the classifier would likely have passed both, and in Codex’s default sandbox neither needs approval. Either way, the agent did the reading, the guessing and the retrying. Your part was the decisions.

## Where it stops

A coding agent works only while it can keep going:

- **Every prompt pauses the loop.** The agent doesn’t do anything else while it waits. If you’re in another window, it waits until you notice.
- **More agents, more waiting.** People run [several agents at once](https://usecoral.app/guides/run-multiple-claude-code-agents) in separate worktrees. Each one stops on its own schedule, and you become the queue they wait in.
- **Context runs out.** Long sessions get worse as the window fills ([context engineering](https://usecoral.app/glossary/context-engineering)), so long tasks need notes, compaction or a fresh session. Notes that outlive the task are the idea behind an [AI second brain](https://usecoral.app/glossary/ai-second-brain).
- **Trust is your call.** Skipping prompts entirely ([`--dangerously-skip-permissions`](https://usecoral.app/guides/claude-code-dangerously-skip-permissions), Codex’s `--yolo`) is safe only in a container or VM.

## Where Coral fits

[Coral](https://usecoral.app/features) doesn’t replace your coding agent. It sits next to the ones you already run, in any terminal:

- **Every waiting agent in your Mac’s notch.** Claude Code, Codex, the Copilot CLI, OpenCode and Grok in one list, whoever has waited longest first.
- **Answer with one key.** Press 1, 2 or 3 to answer a permission prompt or a question, and see what the agent wrote just before it asked. ⌘Z takes it back within two seconds.
- **Jump to the right terminal.** One key lands on the exact tab, in tmux, Ghostty, iTerm2, Terminal, WezTerm, kitty, Alacritty and the terminals in VS Code, Cursor and Windsurf.
- **Away from your Mac.** Alerts on your iPhone are Free. Answering from the phone, and agents on your SSH servers, are [Pro](https://usecoral.app/pricing).

## Questions

### What is an AI coding agent?

An AI program that takes a coding task and carries it out on its own: it reads your files, edits them, runs commands and tests, reads the results and repeats until the task is done. Claude Code, Codex, the Copilot CLI, OpenCode and Gemini CLI are examples.

### What is the difference between a coding agent and an AI coding assistant?

An assistant suggests code (autocomplete, or answers in a chat) and you run it. A coding agent runs it: it edits files and executes commands and tests itself, then fixes what failed, inside the permissions you allow.

### What are examples of coding agents?

In the terminal: Claude Code, the Codex CLI, the GitHub Copilot CLI, OpenCode and Gemini CLI. Many also run in IDE extensions, desktop apps, the cloud and CI, such as Claude Code GitHub Actions.

### Is it safe to let a coding agent run commands?

Within limits. Claude Code reviews actions in auto mode or asks first in Manual mode, and Codex runs commands in an OS sandbox. Skipping all checks is safe only in a container or VM with nothing you can’t lose.

### Can a coding agent work without me?

Yes, in headless runs like `claude -p`, `codex exec` or a GitHub Actions job. With nobody there to approve, anything that needs approval is skipped or fails, so those runs depend on rules you write in advance. Teams that start agents from triggers call that a [software factory](https://usecoral.app/glossary/software-factory).
