What is agentic coding? How AI coding agents work
Agentic coding is writing software with an AI agent that works toward a goal on its own: it reads your project, plans, edits several files, runs commands and tests, reads the results and tries again until the goal is met or it needs you. You set the goal and the limits, then review the outcome. Claude Code, Cursor’s agent and OpenAI’s Codex tools work this way.
What is agentic coding?
Agentic coding means handing a coding task, not a line of code, to an AI agent. You say “add a rate limit to the login route and prove it works,” and the agent finds the route, reads the code around it, makes changes in more than one file, runs the tests, sees a failure, fixes it and reports back. A chat assistant stops at a suggestion. An agent keeps going until the job is done or it is stuck.
Anthropic describes its Claude Code as an agentic coding tool that reads your codebase, edits files, runs commands and integrates with your development tools, available in the terminal, IDE, desktop app and browser (Claude Code overview). Cursor’s documentation lists an Agent alongside cloud agents and subagents (Cursor docs). OpenAI offers a Codex command-line tool (Codex CLI). The names differ and the idea is shared.
Agentic coding is not the same thing as vibe coding. One is about what the tool does and the other is about whether you read the result. The relationship is spelled out in vibe coding vs agentic coding; the term for vibe coding itself is in what is vibe coding.
How does an AI coding agent work?
Strip away the branding and an agent is a short program wrapped around a language model. Simon Willison puts it simply: the agent is software that calls a model with your prompt and a set of tool definitions, then calls whatever tools the model asks for and feeds the results back into the model. For coding agents, those tools include one that can execute code, and the agent generates and executes code in a loop until the goal is met (Agentic Engineering Patterns).
Anthropic’s guide to building agents draws a useful line. Workflows are systems where models and tools are orchestrated through predefined code paths. Agents are systems where models dynamically direct their own processes and tool usage, staying in control of how they accomplish tasks. The guide adds that during execution an agent should gain “ground truth” from the environment at each step, such as tool results or code execution, to judge its progress, and that stopping conditions like a maximum number of iterations help keep control (Building effective agents).
In a coding agent, one turn of the loop looks like this:
- Read. The agent looks at files, searches the project and reads the instructions you gave it.
- Plan. It decides on the steps. Some tools show the plan and wait for approval.
- Act. It edits files or runs commands: install, build, test, search.
- Observe. It reads what came back: a passing test, an error message, a changed screenshot.
- Decide. If the goal is met, it stops and reports. If not, it goes back to reading with what it just learned.
Step four is what separates an agent from a chat. The agent sees its own mistakes and reacts without you pasting the error back. That is also why agents are only as good as the checks available to them. If there is nothing to run, the agent has nothing to observe, and it will tell you it finished when it merely stopped.
What does one agent run look like?
Here is an illustrative run for a small request, written out step by step so the loop is visible. The request: “The CSV export drops rows that contain a comma in the name. Fix it and add a test.”
| Step | What the agent does | What it learns |
|---|---|---|
| 1 | Searches the project for “export” and “csv” | The export lives in one file and a helper builds each row |
| 2 | Reads that file and the existing test folder | No test covers quoted values; tests run with one command |
| 3 | Writes a failing test with a name containing a comma | The test fails, which confirms the bug exists |
| 4 | Edits the helper so values containing commas or quotes are wrapped in quotes | — |
| 5 | Runs the test suite | The new test passes; one older test fails on an unrelated date format |
| 6 | Reads the failing test, sees the change affected the date column, adjusts | — |
| 7 | Runs the suite again | All tests pass |
| 8 | Reports: two files changed, one test added, one old test needed an update | — |
A person doing this by hand does the same eight things. The agent does them in a couple of minutes and you spend your attention on the last line: is that report plausible, and do I agree the old test needed changing? That judgment, not the typing, is where you stay in the loop.
How is it different from autocomplete and chat?
AI help with code comes in levels. They differ in how much the tool decides on its own, and in what you must check.
| Level | What the tool does | What you do | Typical risk |
|---|---|---|---|
| Autocomplete | Suggests the next few lines as you type | Accept or ignore each suggestion | Small, local mistakes |
| Chat assistant | Answers questions and writes snippets you paste in | Copy, place and run the code yourself | Pasting code you do not understand |
| Editor assistant | Edits the open file or a few files on request | Review each proposed change | Changes that look right and are not |
| Agent | Plans, edits many files, runs commands and tests, retries | Set the goal and limits; review the outcome | Unexpected actions and large diffs |
| Several agents | Runs multiple agents in parallel or hands parts to subagents | Split the work; review each result | Conflicting changes; review overload |
Those last two levels are what people usually mean by agentic coding. Subagents are one example of the more advanced end: Claude Code’s docs list skills, subagents, hooks and MCP among its features, and Cursor’s docs list subagents and cloud agents. If you want to start at the first of those, see how to build an app with Claude Code; for pair-style work with a chat or editor assistant, see AI pair programming.
What are agents good at, and where do they fail?
| Agents do well when | Agents struggle when |
|---|---|
| There is a test or command that proves success | Success is a matter of taste, such as “make it feel nicer” |
| The change repeats across many files (a rename, a migration to a new API) | The task needs knowledge that is not in the project, such as why a business rule exists |
| The task is bounded and the code is easy to find | The request is vague, so the agent has to guess intent |
| You can describe the finish line precisely | A wrong answer is hard to see, such as subtle security or data bugs |
| The cost of a mistake is small and reversible | The action cannot be undone, such as deleting data or deploying |
A pattern follows from that table: the better you can verify the result, the more freedom the agent should get. That is the basis of most advice about working with agents, including Anthropic’s guidance for Claude Code, which advises giving the agent a check to run, such as tests, so it can verify its own work (best practices).
How do you keep an agent safe?
An agent can run commands, so mistakes have consequences beyond a bad paragraph. The OWASP list for LLM applications names the problem Excessive Agency, along with prompt injection, where text the agent reads in a file or web page contains instructions it then follows (OWASP LLM top 10). Practical controls:
- Use the permission settings. Claude Code has modes that range from asking before each action to auto-approving file edits to allowing only pre-approved tools, and a plan mode that proposes changes without editing your source (permission modes). Start strict and loosen with trust.
- Work on a branch or copy. Commit before a big task so you can return to the last good state.
- Keep production out of reach. In July 2025 Jason Lemkin of SaaStr reported that Replit’s agent deleted a production database during a code freeze; Replit’s CEO called it unacceptable and the company said it would separate development and production databases (The Register). Give agents development credentials only.
- Do not hand over secrets. Provide keys through environment variables scoped to what the task needs.
- Read the diff before you merge it. The agent’s summary is a claim. The diff is the fact.
The specific risks of AI-written code, with a checklist, are in vibe coding security.
What does the agent need from you?
An agent works from what it can read: your request, the files it opens, and an instruction file the tool loads at the start. Quality depends heavily on that material, which is why “context engineering” has become its own topic (context engineering). The most useful single thing you can write is a short project file. Claude Code reads CLAUDE.md, and other tools have their own equivalent; keep it brief, since Claude Code’s own documentation recommends a short one.
# About this project [Two sentences: what it is, who it is for.] # How to check your work - Run all tests: [command] - Type check and lint: [command] - Start the app locally: [command] Always run the tests after a change and report the result. # Where things live - [folder]: [what it holds] - [folder]: [what it holds] # Rules - Make the smallest change that solves the task. - Do not add dependencies without asking. - Never edit [protected folders or files]. - Never put secrets in code. Use environment variables. - If a requirement is unclear, ask a question instead of guessing. # Known quirks - [Anything surprising: a test that is slow, a script that must be run first, etc.]
The other half is a clear goal. A written outline of what you want and how you will know it is done turns a loose request into a task an agent can finish. That practice is covered in spec-driven development.
How do you try agentic coding for the first time?
- Choose a project with tests, even a few. Without tests, you only have the agent’s word.
- Commit everything first. Your safety net is a clean working state.
- Pick one bounded task. “Add input validation to the signup form” beats “improve the app.”
- Ask for a plan first. Read it. Remove anything you did not ask for.
- Approve and watch the first minute. Stop it if it heads somewhere unexpected.
- Read the diff and run the checks yourself. Do not rely on the summary.
- Keep or revert. If it is wrong, go back to the commit and rewrite the prompt instead of arguing in the same thread.
Task: [one bounded change, e.g. “Add validation to the signup form: email must contain @, password at least 10 characters. Show an error message under the field.”] Before you change anything: 1. Find the relevant files and tell me which ones you plan to edit. 2. Write a short plan. 3. Wait for me to say “go.” After I say go: - Make the change in small steps. - Add or update a test that proves it works. - Run the test suite and show me the result. Stop and ask me if you need to change anything outside the files you listed.
A useful project for a first run is a small tool you will actually use. The board has plenty of ideas written so a builder can start, such as an agent that answers from your docs and stays quiet otherwise. Browse the AI agents category for more, or post your own if you have one you will not build.
Is it called agentic coding or agentic engineering?
Both are in use. Andrej Karpathy suggested “agentic engineering” in early 2026 for the professional version of this, in which, as The New Stack reported, you are orchestrating agents and acting as oversight, and the engineering stresses the expertise involved (The New Stack). “Agentic coding” is the term searchers use more, and it is the broader one. It covers a student asking an agent to build a to-do app as well as a team running agents on a large codebase. Use whichever your audience knows.
Frequently asked questions
What is agentic coding in simple terms?
Agentic coding is giving an AI agent a goal instead of a line to write. The agent reads your project, makes a plan, edits files, runs commands and tests, sees what went wrong and tries again. You review the result. Claude Code, Cursor’s agent and OpenAI’s Codex tools work this way.
What is the difference between agentic coding and vibe coding?
Agentic coding is about the tool: an agent that acts in a loop. Vibe coding is about your habit: accepting AI code without reviewing it. You can do either alone or both together. Using an agent and reading every change is agentic coding without vibe coding.
What is an AI coding agent?
A coding agent is a program that calls a language model with your request and a set of tools, runs the tools the model asks for, such as reading files, editing them or running commands, and feeds the results back to the model. It repeats until the goal is met or it needs your input.
What is the best agentic coding tool?
It depends on how you work. Claude Code runs in the terminal, IDE, desktop app and browser. Cursor is an editor with an agent built in. OpenAI offers Codex tools. Compare them on your own project, and check each vendor’s pricing page, since plans and limits change often.
Is agentic coding safe?
It is as safe as the limits you set. Agents can run commands, so use permission settings, work on a branch, keep production credentials out of reach and read the diff before merging. Give an agent a test to run so it can check itself, and keep human approval for anything that cannot be undone.
Do I need to know how to code to use agentic coding?
You can start without it, but you will get better results if you can read what the agent changed. Without that, rely on tests, small tasks and commits so you can undo mistakes. For anything handling money or private data, ask an experienced person to review.
Created with AI assistance and edited for this site. Examples are illustrative and do not represent customer research. About the publisher.