Coding agent
In shortA coding agent is an AI tool that reads a codebase, edits files and runs commands and tests in a loop to finish a programming task.
In plain words
A coding assistant in an editor suggests the next line. A coding agent does more: you describe a task, and it works through it. Anthropic describes its Claude Code as an agentic coding tool that reads your codebase, edits files, runs commands and integrates with your development tools. Several vendors and open-source projects offer similar tools, in the terminal, in editors and on the web.
The usual loop is the one of any AI agent: the tool reads files to understand the project, makes a plan, changes code, runs the tests or the program, reads the errors, and tries again until it passes or you stop it. It uses tool use for file access and shell commands, and often MCP to reach issue trackers, design files or databases. Project files with standing instructions, such as a CLAUDE.md, tell the tool your conventions.
Why it matters
- Time: Chores such as writing tests, fixing lint errors, updating dependencies and writing release notes can be handed over.
- Cost: A coding agent reads many files and repeats steps, so it uses many tokens. On a chat plan it can eat the usage limit fast. Anthropic notes that Claude Code usage counts toward the same limit as its chat apps.
- Quality: The code can look right and still be wrong. Tests and your review are the safeguard.
- Control: The tool can run commands on your machine. Work in a version-controlled folder, approve risky commands, and keep it away from files with secrets, such as
.envfiles with API keys. - Security: Code, issues and web pages the agent reads may contain hidden instructions (prompt injection). Use least privilege and review what it does.
- Start small: Anthropic advises the simplest solution that works, and more agent autonomy only when it pays off.
Example
A test fails in your project. You write: "The test for the invoice total fails. Find the cause, fix it, and run the tests." The agent opens the test and the invoice code, spots a rounding error, changes one function, runs the test suite, sees a second failure, fixes that too, and reports the changes. You read the diff, run the tests yourself and commit.
Common misconceptions
- "It replaces the developer." It speeds up work, and someone must still define goals, review and own the result.
- "If the tests pass, the code is good." Tests only cover what they test. Weak tests pass weak code.
- "It is safe to give full access." Limit file and command access to what the task needs.
Questions and answers
What is the difference between a coding agent and a code assistant?
An assistant suggests code while you type. An agent takes a task, reads the project, edits files, runs commands and tests, and iterates on its own.
Are coding agents safe to use?
They run commands and change files, so use version control, approve risky steps, keep secrets out of reach and review every change.
Why do coding agents use so many tokens?
They read many files and repeat the loop of edit, run and fix, and each step adds to the context.
Read next
- AI agent
An AI agent is a system where a model plans, uses tools and checks results in a loop to reach a goal with little step-by-step guidance.
- Tool use (function calling)
Tool use, also called function calling, lets a model request an outside action, such as a search or a calculation, which an app runs and feeds back.
- MCP (Model Context Protocol)
MCP (Model Context Protocol) is an open standard for connecting AI applications to external data, tools and workflows through one shared interface.
- Usage limit
A usage limit caps how much you can use an AI chat plan in a set period, such as a session or week, before you must wait or pay more.
- Prompt injection
Prompt injection is an attack where text a model reads, such as a web page or file, contains instructions that make it act against its user.