AI coding agents
A language model in a loop with tools: it reads files, runs commands and edits code, sees each result, and decides the next step until the task is done.
9 technologies on this page ↓How it works
You give the agent a goal, such as “fix the failing tests”. A program around the model, often called the harness, sends the model your request plus its context: instructions, earlier messages and the tools it may call. The model doesn’t act by itself. It answers with a proposed tool call, such as “read src/auth.ts” or “run npm test”. The harness checks that call against your permission rules, runs it (often inside an OS sandbox), and appends the output to the context. The model reads that result and proposes the next call, and the loop repeats until it answers in plain text: run the tests, read the error, find the file, edit it, run the tests again. Instruction files checked into the repository (AGENTS.md, CLAUDE.md, GEMINI.md) are loaded at the start of every session, because each session begins with an empty context. Extra tools, such as an issue tracker or a database, plug in through the Model Context Protocol (MCP), a JSON-RPC protocol where a server lists its tools (tools/list) and the agent calls them (tools/call). Everything the agent reads, runs and writes lands in one context window of limited size, so managing what goes into it decides how well the agent works.
A contractor working from a radio. They can’t see the house; they ask you to read a label, try a switch or open a wall, and you report back exactly what happened. The house rules taped by the door (the instruction file) tell them what not to touch, you refuse requests that break them (permissions), and their notebook only holds so many pages, so a good contractor writes a short summary before starting a fresh one.
Reach for it when
- Changes you can check automatically: failing tests, type errors, lint fixes, dependency upgrades
- Finding your way around an unfamiliar codebase before you change it
- Mechanical work across many files, such as a rename or an API migration with a clear pattern
- Backlog tickets a cloud agent can turn into draft pull requests while you do something else
Think twice when
- Nobody will review the result: agents produce plausible code that can be wrong
- There is no way to verify the change (no tests, no build, no way to run it)
- The agent would get credentials or network access it doesn’t need; prompt injection in a web page or issue can steer it
- Hard design problems in a codebase no one on the team understands well enough to review the plan
A real example
Dex Horthy of HumanLayer describes fixing a bug in BAML, a 300,000-line Rust codebase Horthy had never worked in. The agent first wrote a research document on how the relevant code works. The first attempt concluded the bug was invalid, so Horthy threw it away and ran the research again with more steering. A second session turned the research into a short implementation plan, and a third implemented it. The pull request took about an hour and was approved by the maintainer the next morning. A plan written without the research also “would have worked”, but fixed the problem in a worse place.
Kinds of ai coding agents
Specific products, and what each does differently.
Terminal agents →
Agents you start in a shell, in your repository, that use the tools already installed on your machine.
Gemini CLICommercialGoogle’s open-source terminal agent for Gemini models; since 18 June 2026 it serves only paid API keys and business licences, as Google moved free and consumer users to Antigravity CLI.Editor agents →
Agents in a panel inside the code editor, working on the open project and showing their edits as reviewable diffs.
Cloud agents →
Agents that run each task on a machine in someone else’s cloud, take work from a chat, ticket or web app, and come back with a pull request.
| Terminal agents | Commercial product | Anthropic | Proprietary | 2026-10-09 | |
Gemini CLI | Terminal agents | Commercial product | Apache 2.0 | 2026-10-09 | |
| Terminal agents | Commercial product | OpenAI | Apache 2.0 (CLI) | 2026-10-09 | |
| Terminal agents | Open source | Anomaly Innovations | MIT | 2026-10-09 | |
| Terminal agents | Open source | Warp | AGPL 3.0 (UI framework crates MIT) | 2026-10-09 | |
| Augment Code | Editor agents | Commercial product | Augment Code (Augment Computing, Inc.) | Proprietary | 2026-10-09 |
| Editor agents | Open source | Cline Bot Inc. | Apache 2.0 | 2026-10-09 | |
| Editor agents | Open source | Zed Industries | GPL 3 (editor), AGPL 3 (server components), Apache 2.0 (GPUI) | 2026-10-09 | |
| Cloud agents | Commercial product | Cognition | Proprietary | 2026-10-09 |
Permissions and sandboxes#
An agent can run any command you could, so two separate layers decide what actually happens. Permission rules say which tool calls run without asking, which prompt you, and which are refused. Claude Code checks deny rules first, then ask, then allow, so a broad deny such as Bash(aws *) can’t be undone by a narrower allow. OpenCode uses the same three outcomes but starts permissive: most actions default to “allow”. Most agents also offer a read-only planning mode that explores without editing.
The second layer is an operating-system sandbox around the commands the agent runs. Codex and Claude Code use Seatbelt on macOS and bubblewrap on Linux to confine writes to the working directory and to block or filter network access; Codex turns its sandbox on by default and keeps .git read-only even inside the workspace. Gemini CLI’s sandbox is opt-in (-s) and can use Seatbelt, Docker, Podman or gVisor. Cloud agents go further and run each task on a separate virtual machine or container.
Rules on command text are easy to sidestep: Claude Code’s docs note that a deny rule on curl doesn’t match the same program called by its full path or inside sh -c. The sandbox is what holds. Network access matters most, because anything the agent reads, such as a web page or an issue comment, can carry instructions (prompt injection) that it may follow.
Four terminal agents side by side#
They share the loop; they differ in which models they drive, which instruction file they read and how hard they fence in commands.
| Agent | Instruction file | Models | Command sandbox | Licence |
|---|---|---|---|---|
| Claude Code | CLAUDE.md; reads AGENTS.md in its place | Claude, via Anthropic or Bedrock, Google Cloud and Microsoft Foundry | Seatbelt or bubblewrap, set up with /sandbox | Proprietary |
| OpenAI Codex CLI | AGENTS.md, up to 32 KiB combined by default | OpenAI models, with a ChatGPT plan or an API key | On by default: Seatbelt, or bubblewrap plus seccomp | Apache 2.0 |
| Gemini CLI | GEMINI.md; the file name is configurable, e.g. to AGENTS.md | Gemini | Opt-in: Seatbelt, Docker, Podman, gVisor or LXC | Apache 2.0 |
| OpenCode | AGENTS.md; falls back to CLAUDE.md | 75+ providers, plus local models | Permission rules; most actions default to allow | MIT |
Context engineering: research, plan, implement#
In “Advanced Context Engineering for Coding Agents” (August 2025), Dex Horthy of HumanLayer argues that each turn of an agent is a stateless function call: context window in, next step out. The context is the only lever you have, so optimise it for correctness, completeness, size and trajectory. The worst things it can contain are, in order, incorrect information, missing information and too much noise. Searching files, reading code flow, test and build logs and large JSON from tools all fill it up.
Horthy’s answer is “frequent intentional compaction”: build the whole workflow around context and keep utilisation around 40–60%. Work happens in three steps, each in a fresh session that starts from the last step’s markdown file. Research finds the relevant files and how data flows, often using subagents so their searching never enters the main context. Plan lists the exact changes and how each phase will be tested. Implement works through the plan phase by phase, writing progress back into the plan file.
Human attention goes where it has the most leverage. A bad line of code is one bad line, a bad line in a plan can become hundreds, and a misunderstanding in the research can become thousands, so people review the research and the plan more closely than the diff. Horthy is clear about the limits: it isn’t magic, it needs someone engaged for hours, an attempt to remove Hadoop from parquet-java failed because the research didn’t go deep enough, and Horthy’s team of three was spending about $12,000 a month on Opus. Claude Code’s own docs make a similar point: performance degrades as the context fills, so explore and plan before you code.
A minimal AGENTS.md#
Plain Markdown with no required fields, at the repository root. Agents read the nearest file in the directory tree, so a monorepo can add one per package.
# AGENTS.md
## Setup
- Install dependencies: `pnpm install`
- Run the tests: `pnpm test` (must pass before you finish)
## Conventions
- TypeScript strict mode; no `any`
- Put new API handlers in `src/routes/`, one file per resource
## Don’t
- Edit generated files in `src/gen/`
- Commit or push; leave that to a humanIn code · python
import shlex
import subprocess
ALLOW = {"echo", "python3"} # permission rule: these run without asking
def run(command: str) -> str:
argv = shlex.split(command)
if argv[0] not in ALLOW:
return f"denied: {argv[0]} needs approval" # a real harness asks the user here
done = subprocess.run(argv, capture_output=True, text=True, timeout=60)
return (done.stdout + done.stderr)[-2000:] # trim: long logs eat the context window
def model(context: list[dict]) -> dict:
"""Stand-in for the LLM: reads the whole context, proposes the next step."""
script = ["echo starting", "rm -rf build", "python3 -c 'print(6 * 7)'"]
step = sum(1 for m in context if m["role"] == "tool")
if step < len(script):
return {"tool": "run", "input": script[step]}
return {"answer": "6 * 7 = " + context[-1]["content"].strip()}
context = [{"role": "user", "content": "Use Python to work out 6 * 7"}]
while True: # the agent loop
reply = model(context)
if "answer" in reply:
print(reply["answer"])
break
result = run(reply["input"]) # the harness, not the model, executes the call
print(f"run({reply['input']!r}) -> {result.strip()!r}")
context.append({"role": "tool", "content": result})
# run('echo starting') -> 'starting'
# run('rm -rf build') -> 'denied: rm needs approval'
# run("python3 -c 'print(6 * 7)'") -> '42'
# 6 * 7 = 42Worth exploring
Often confused with
Where it came from2021–2025
The first popular AI coding tools completed code as you typed. GitHub Copilot’s technical preview in June 2021 suggested whole lines or functions, powered by OpenAI’s Codex model, but it couldn’t open another file, run the code or see whether its suggestion worked. Research then gave models a way to act. The ReAct paper (October 2022) had a model interleave reasoning with actions against an outside environment and read back what happened. SWE-bench (October 2023) turned that into a hard test: 2,294 real GitHub issues from 12 Python projects, where the best model, Claude 2, resolved 1.96%.
In 2024 the loop met software engineering. Cognition announced Devin in March, an agent with a shell, editor and browser in a sandbox, and reported 13.86% on a quarter of SWE-bench. In May, SWE-agent showed that the interface mattered as much as the model: custom commands for viewing, editing and testing code lifted it to 12.5%. Anthropic’s December 2024 guide put the idea plainly: agents are “typically just LLMs using tools based on environmental feedback in a loop”, and they need ground truth from the environment, such as test results, at each step.
2025 brought the terminal agents: Claude Code in February, OpenAI’s Codex CLI in April and Gemini CLI in June. Shared conventions followed. Anthropic had open-sourced MCP in November 2024 as one protocol for tools, OpenAI released AGENTS.md in August 2025 as one place for project instructions, and in December 2025 both moved to the Linux Foundation’s new Agentic AI Foundation. By then the open question was less whether agents could code than how to feed them: practitioners such as Dex Horthy called it context engineering, getting the most out of today’s models by controlling exactly what they see.
Why it’s built this way
- Let the model drive a loop of tool calls
- One-shot generation can’t check itself. Running tests and reading the output gives the model ground truth at each step, and code is unusually well suited to this because results can be verified automatically.
- Design the tools for the model, not just reuse human ones
- SWE-agent found that a purpose-built agent-computer interface beat raw shell access, and Anthropic reported spending more time optimising tools than prompts, for example requiring absolute file paths after the model kept getting relative ones wrong.
- Keep instructions in a file in the repository
- Each session starts with an empty context. A checked-in Markdown file (
CLAUDE.md,AGENTS.md) is loaded every time and reviewed like code;AGENTS.mdchose a vendor-neutral name so one file works across agents. - Keep a human able to say no
- Agents run real commands with real credentials. The MCP spec says there should always be a human in the loop able to deny tool calls, and agents add permission rules, sandboxes and read-only plan modes so autonomy can grow step by step.
Timeline
- 2021
GitHub Copilot’s technical preview brings AI code completion to the editor
- 2022
The ReAct paper has a model interleave reasoning with actions
- 2023
SWE-bench tests models on 2,294 real GitHub issues; the best solves 1.96%
- 2024
Devin (March) and SWE-agent (May) work real issues in a sandbox; MCP open-sourced (November)
- 2025
Claude Code, Codex CLI and Gemini CLI launch;
AGENTS.mdreleased in August - 2025
MCP and
AGENTS.mdmove to the Linux Foundation’s Agentic AI Foundation (December)
- GitHub blog: Introducing GitHub Copilot, your AI pair programmer (June 2021)
- Yao et al.: ReAct, Synergizing Reasoning and Acting in Language Models (arXiv, Oct 2022)
- Jimenez et al.: SWE-bench, Can Language Models Resolve Real-World GitHub Issues? (arXiv, Oct 2023)
- Cognition: Introducing Devin, the first AI software engineer (Mar 2024)
- Yang et al.: SWE-agent, Agent-Computer Interfaces Enable Automated Software Engineering (arXiv, May 2024)
- Anthropic: Building effective agents (Dec 2024)
- Anthropic: Introducing the Model Context Protocol (Nov 2024)
- Anthropic: Claude 3.7 Sonnet and Claude Code (Feb 2025)
- OpenAI: Introducing Codex (mentions the Codex CLI launch the month before; May 2025) · archived copy, original
- Google: Gemini CLI, your open-source AI agent (June 2025)
- Linux Foundation: Formation of the Agentic AI Foundation with MCP, goose and AGENTS.md (Dec 2025)
- AGENTS.md: a simple, open format for guiding coding agents
- Model Context Protocol spec: Tools (human in the loop able to deny tool invocations)
- Dex Horthy (HumanLayer): Advanced Context Engineering for Coding Agents, written version (Aug 2025)
Sources20
- Anthropic: Building effective agents (LLMs using tools based on environmental feedback in a loop)
- VS Code docs: Understand AI agents (agent loop, agent harness)
- Claude Code docs: How Claude Code works (agentic loop, context window, permission modes)
- Claude Code docs: Best practices (context fills fast; explore, plan, then code)
- Claude Code docs: Configure permissions (deny, then ask, then allow; what Bash rules don’t match)
- Claude Code docs: Sandboxing (Seatbelt on macOS, bubblewrap on Linux)
- Claude Code docs: How Claude remembers your project (CLAUDE.md, AGENTS.md)
- Claude Code docs: Third-party integrations (Bedrock, Google Cloud, Microsoft Foundry)
- Codex docs: Agent approvals and security (sandbox modes, Seatbelt, bwrap and seccomp, prompt injection)
- Codex docs: Custom instructions with AGENTS.md (discovery order, 32 KiB default limit)
- Gemini CLI docs: Provide context with GEMINI.md files
- Gemini CLI docs: Sandboxing (Seatbelt, Docker, Podman, gVisor, LXC)
- OpenCode docs: Rules (AGENTS.md, Claude Code compatibility)
- OpenCode docs: Permissions (allow, ask, deny; permissive defaults)
- OpenCode docs: Providers (75+ LLM providers, local models)
- Model Context Protocol docs: Architecture (JSON-RPC 2.0, stdio and Streamable HTTP)
- Model Context Protocol spec: Tools (tools/list, tools/call)
- AGENTS.md: format, nested files, FAQ
- Cognition: Devin is now generally available (first-draft PRs for backlog tasks; Dec 2024)
- Dex Horthy (HumanLayer): Advanced Context Engineering for Coding Agents, written version (Aug 2025)