Coding Agent
AI that takes a task and changes the code itself
An AI agent specialized for software work: it takes a task, reads the repository, edits multiple files, runs commands and tests, and keeps looping until it can verify the result.
A classic code assistant does autocomplete: as you type, it predicts the next line or block and you press Tab. You stay in the driver's seat; you decide which file to open and when to run the tests.
A coding agent takes a task and drives the work itself: it finds and reads the relevant files, makes a plan, edits several files, runs build and test commands in a terminal, and if something fails it fixes it and tries again. It does this inside an agent loop and hands the result back to you as a diff or a pull request.
Technically, a coding agent = language model + harness. The model
makes the decisions; the harness gives it tools (file read/edit, bash,
search, MCP), project instruction files (CLAUDE.md, AGENTS.md) and a
permission/sandbox layer. That is why the same model can perform
differently in different agents.
As of October 2026, the common products come in three shapes:
- Terminal (CLI): Claude Code, OpenAI Codex CLI, GitHub Copilot CLI, Antigravity CLI, and the open-source OpenCode.
- In the IDE: Cursor, Copilot agent mode in VS Code, Cline, and the Claude Code / Codex extensions.
- In the cloud, in the background: Claude Code cloud sessions, Codex Cloud, Copilot cloud agent, Cursor Cloud Agents. You hand off the task, the agent works in its own virtual machine, and you move on.
Autocomplete is like a friend who finishes your sentences: fast, but you're still the one writing.
A coding agent is like handing work to a brand-new but very fast intern. You say "fix this bug on the checkout page"; they read the code, make the change, run the tests, and come back with "here's what I changed, the tests pass." As with any intern, you need to describe the job clearly, limit what they're allowed to touch, and never ship their work without reviewing it.
In a Laravel project, php artisan test shows two failing tests. In the
terminal you tell the agent: "Find the two failing tests, explain why
they fail and fix them. Don't touch the migration files."
The agent reads the test output, opens the related controller and model files, finds that the problem is a date-format conversion, edits two files and re-runs the tests. If one is still red, it keeps looping. At the end it shows the green test run, the diff of the changed files and a short explanation. You read the diff and commit if you're happy. Had you given the same task to a cloud agent, you would have received a pull request instead.
{
"permissions": {
"allow": [
"Bash(npm run *)",
"Bash(git diff *)"
],
"deny": [
"Bash(git push *)",
"Read(./.env)",
"Read(./secrets/**)"
]
}
}# Writes only inside the workspace; leaving the sandbox needs approval
sandbox_mode = "workspace-write"
approval_policy = "on-request"# Claude Code: print mode with turn and budget limits
claude -p --max-turns 20 --max-budget-usd 5.00 \
"Fix the failing tests and summarize the changes"
# Codex CLI: non-interactive run
codex exec "Fix the failing tests and summarize the changes"- Well-defined work that spans several files: bug fixes, writing tests, refactors, dependency upgrades
- Tasks that can be verified automatically: if tests, a linter, a type checker or a build can answer 'is it done?'
- Exploring an unfamiliar codebase: 'how does authentication work, and in which files?'
- Handing recurring maintenance to a cloud agent in the background and reviewing the result as a PR
- Work whose requirements aren't clear even to you; write down what you want first, then hand it over
- Unreviewed use on code where mistakes are expensive (payments, authorization, data deletion) and there are no tests or other automated checks
- In an environment with access to secrets, a production database or a live server, without a sandbox and permission rules
- One-line changes; autocomplete or editing by hand is faster
Accepting the diff without reading it
Even when the agent says 'tests pass', it may have loosened a test, skipped a check or changed a file it shouldn't have. Review agent-written code like a teammate's PR.
Turning every permission on
Modes such as Claude Code's bypassPermissions, Codex's danger-full-access or Cursor's Run Everything switch off the approval step or the sandbox. Claude Code's docs recommend bypassPermissions only for isolated containers and VMs; treat the others the same way.
Underestimating prompt injection
A README, issue, web page or MCP tool result that the agent reads can carry hidden instructions. If the agent can also reach your secrets and the network, that can turn into data exfiltration. Restrict network access and keep secrets where the agent can't read them.
Bloating the context and the bill
Long sessions, unused MCP servers and huge log outputs cost tokens again on every turn. Clear the session when a task is done, filter large outputs and split work into smaller pieces.
Confusing the model with the agent
An agent's success doesn't come from the model alone; tools, instruction files and permissions matter too. Trying the same model in a different agent, or improving your project instruction file, can make more difference than switching models.