How AI Coding Agents Work: The Plan, Edit and Test Loop, and Where It Stops
An AI coding agent is a language model in a loop with tools: it reads code, edits files, runs tests and repeats until the checks pass or a person steps in. This explains the loop, where agents run, what gates their actions and how their makers say their work is reviewed, from the vendors' own documentation.
Checked against the vendors’ documentation named in the table and the SWE-bench paper
As of · Each product's own documentation, read November 12, 20261357910
| Agent | Where it runs | What it can do | What gates its actions | Review, in its docs' words | Source |
|---|---|---|---|---|---|
| Claude Code (Anthropic) | On your machine by default, or on cloud VMs | File operations, search, shell commands, tests, git and web | Manual, accept-edits, plan and auto permission modes; manual mode starts read-only | "You're responsible for reviewing proposed code and commands for safety before approval" | 1, 2 |
| Codex (OpenAI) | Cloud, with a separate workspace per task | Edits files, runs commands, checks its work | OS-enforced sandbox plus an approval policy; network access off by default | "Review changes and test results before committing or opening a pull request" | 3, 4 |
| Copilot cloud agent (GitHub) | A cloud development environment | Edits files, runs tests and linters; researches the repository first | Pushes only to a single copilot/ branch; workflows need a write-access user to approve them; internet access restricted | Draft pull requests "must be reviewed and merged by a human"; it cannot approve or merge | 5, 6 |
| Agent mode (VS Code) | Your editor | Reads code, edits, runs terminal commands and tools | Manual, assisted or allow-all approval levels; terminal commands need explicit approval; agents disabled in untrusted workspaces | "Review all file edits before integrating them" | 7, 8 |
| Cline | Your editor | Plan mode cannot modify files or run commands; act mode can | Plan and act modes the user switches between | Not stated in the page we read | 9 |
| Aider | Your terminal | Edits code and can lint and test after each change | Runs the lint and test commands you set; tries to fix errors when they return non-zero | Not stated in the page we read | 10 |
This is a description of what each maker's documentation says, not a test of the products, and documentation changes often; most of these pages are undated. Quotation marks are the documents' own words. Cursor's documentation, which we also read, did not state approval or context-handling behavior in the text we retrieved, so it is not in the table.
How it works
How it works
A model in a loop with tools
Anthropic’s engineering guide defines agents as “LLMs using tools based on environmental feedback in a loop”, which gain “ground truth” from the environment at each step and can pause for human feedback.11 Claude Code’s documentation describes three phases for any task: “gather context, take action, and verify results”, with a bug fix cycling through all three repeatedly, powered by “models that reason and tools that act”.1 The model is a large language model; what makes it an agent is that it chooses the next tool call from what the last one returned.
The tools: read, edit, run
The tools are ordinary developer operations. Claude Code lists file operations, search, execution (shell commands, servers, tests, git) and web;1 Cursor lists file search, web, read, edit, shell commands and browser;12 VS Code’s agent can “read the implementation behind a failing test, make a change, and run the test to check whether the change works”.7 Aider says it can lint and test automatically after each change and will try to fix errors when a command returns a non-zero exit code.10 The loop closes through those exit codes and test output: the agent reads the result and decides whether to edit again.
Where it runs
Local agents run on the developer’s machine with the developer’s permissions; cloud agents run in a sandbox. Codex says each cloud task has its own workspace and can keep working while the user’s computer is asleep;3 GitHub says Copilot’s cloud agent works in a cloud development environment and, once finished, opens a draft pull request;56 Claude Code offers both, locally by default or on managed or self-hosted cloud machines.1 The choice sets what a mistake can reach: a cloud sandbox can be cut off from the internet, which Codex does by default, while a local agent can touch whatever the user can.4
What gates an action
Every product pairs the tools with permission rules. Claude Code’s manual mode starts read-only and asks before edits, tests and commands, and its documentation says commands that do not match a rule require approval.2 Codex combines an OS-enforced sandbox with an approval policy;4 VS Code says “tool availability is separate from tool approval” and requires explicit approval for terminal commands;78 GitHub’s cloud agent can push only to a single copilot/ branch and its workflows do not run until a user with write access approves them.6 Cline separates a plan mode, which “cannot modify any files or execute commands”, from an act mode that can.9
Instructions and long tasks
Agents are told how a project works through instruction files: Codex says it reads AGENTS.md files “before doing any work”, with a combined size limit of 32 KiB by default.13 Long tasks outgrow the model’s context window, so tools summarize: Claude Code “manages context automatically as you approach the limit” by compacting the conversation into a summary, and warns that “detailed instructions from early in the conversation may be lost”.1 It also keeps file snapshots before edits, but says actions that affect remote systems, such as databases, APIs and deployments, cannot be checkpointed.1
Where it stops
The makers are explicit that the loop does not end with the agent. GitHub says Copilot “can produce incorrect or suboptimal code, including code that contains security vulnerabilities” and that output must be reviewed and tested;5 Codex says users “remain responsible for deciding whether the work is ready to use”;14 Anthropic’s guide warns of “higher costs, and the potential for compounding errors” and says human review remains crucial.11 Prompt injection is a named risk: Codex’s documentation says it “can cause the agent to fetch and follow untrusted instructions” and to “treat web results as untrusted”.4
How agents are tested
SWE-bench built 2,294 problems from real GitHub issues and pull requests across 12 Python repositories, asking a model to edit the codebase to resolve each; the best model in its 2023 paper, Claude 2, solved “a mere 1.96% of the issues”.15 SWE-bench Verified is a human-filtered subset of 500 instances, and its maintainers’ bash-only leaderboard uses “just a simple ReAct agent loop”.16 For independently verified scores see Highest SWE-bench Verified Scores in Epoch AI’s Independent Runs, and for what trials found about developer speed see do coding agents make developers faster?.
What it means for software developers
Software developers are SOC 15-1252.00 in O*NET; the role’s tasks, graded by evidence, are in the Software Developers profile. The loop above is why agents are described as assisting rather than replacing: each product’s documentation places approval, review and merge with a person.
Sources
- Anthropic, How Claude Code works, Claude Code docs (undated, retrieved 2026-11-12).
- Anthropic, Security, Claude Code docs (undated, retrieved 2026-11-12).
- OpenAI, Codex cloud (undated, retrieved 2026-11-12).
- OpenAI, Agent approvals & security, Codex docs (undated, retrieved 2026-11-12).
- GitHub, About Copilot cloud agent, GitHub Docs (undated, retrieved 2026-11-12).
- GitHub, Risks and mitigations of Copilot cloud agent, GitHub Docs (undated, retrieved 2026-11-12).
- Microsoft (Visual Studio Code), Agent tools, VS Code docs.
- Microsoft (Visual Studio Code), Security, VS Code docs.
- Cline, Plan & Act, Cline docs (undated, retrieved 2026-11-12).
- Aider, Linting and testing, Aider docs (undated, retrieved 2026-11-12).
- Anthropic, Building effective AI agents, December 19, 2024 (the page notes that much of the tooling it describes has changed).
- Cursor, Agent overview, Cursor docs (undated, retrieved 2026-11-12).
- OpenAI, AGENTS.md, Codex docs (undated, retrieved 2026-11-12).
- OpenAI, Working with agents, Codex docs (undated, retrieved 2026-11-12).
- Jimenez et al., SWE-bench: Can Language Models Resolve Real-World GitHub Issues?, arXiv:2310.06770, submitted October 10, 2023 (v3 November 11, 2024).
- SWE-bench maintainers, SWE-bench Verified (undated, retrieved 2026-11-12).