Level 2 · Agents & Sub-Agents

What Makes a Coding Agent Different From Chat

A coding agent is different from chat because it can keep a goal in view while it reads your project, uses tools, checks results, and adjusts its next step.

Chat Answers; Agents Work

The basic difference is not that a coding agent is “smarter” than chat. It is that the agent is placed inside a loop. Chat usually takes your prompt and returns an answer. A coding agent takes your goal, looks for relevant context, chooses an action, observes what happened, then decides what to do next. That loop is what makes it useful in a codebase.

For a first-time user, this changes how you should think about the interaction. You are not only asking, “What code should I write?” You are asking the agent to operate in your working environment. It can inspect files, search symbols, run tests, read errors, edit code, and repeat. A good request is therefore goal-shaped: “Fix the failing login test without changing the public API” is better than “What might be wrong with login?”

The tradeoff is that agents can make real changes, so vague goals are risky. If you ask a broad question, you may get broad edits. Give the task, the relevant background, constraints, and what you want the agent to ask before proceeding if something is unclear. A simple pattern is: task, information, constraints, and ask. For example: “Update the settings page to save timezone. The API already accepts timezone. Keep the existing UI style. Ask before changing database schema.”

The Agent Loop

Once you give the goal, the agent starts by building context. Context means the information currently available to the model: your prompt, files it has read, command output, prior messages, and sometimes structured notes it keeps while working. Unlike a chat answer, the agent does not need you to paste every file manually. It can search the repository, open likely files, and learn the local patterns before editing.

Then it chooses a tool. A tool is any capability outside plain text generation: file reading, file editing, shell commands, test runners, linters, browser automation, issue trackers, or APIs. In practice, code is the universal interface. If a task can be reached through the filesystem, a command, or an API, an agent can often operate on it.

The loop is simple: reason about the next useful step, act with a tool, observe the result, and adapt. If tests fail, the failure becomes new context. If a search finds a helper function, the agent can use that instead of inventing one. If a command errors because a dependency is missing, it can choose a narrower verification path. This is why agents feel different from chat: the useful answer is not written all at once. It is produced through contact with the project.

Sub-Agents Are Division of Labor

As tasks get larger, one agent trying to do everything can lose focus. Sub-agents solve this by giving smaller, specialized jobs to separate workers. A planning sub-agent might outline the files and risks. A writing sub-agent might draft an implementation. A validation sub-agent might check whether the result meets the criteria. The main agent, often called the orchestrator, decides when to call each one and how to use their output.

You do not need sub-agents for every task. For a small bug fix, one agent loop is usually enough. Sub-agents become useful when the work has different modes that benefit from separation: research versus implementation, generation versus review, or broad exploration versus strict validation. The value is not ceremony. It is reducing confusion by giving each worker a narrower job.

The failure mode is duplicated effort or false confidence. A sub-agent can miss context, make assumptions, or validate the wrong thing. Treat sub-agent output as structured assistance, not authority. Ask the orchestrating agent to preserve the important state: decisions made, files touched, tests run, and criteria still unchecked. Shared state, even as a simple checklist or outline, keeps the workflow from becoming a pile of disconnected suggestions.

MCP Extends the Workspace

The agent’s power depends on what it can reach. MCP, short for Model Context Protocol, is a way to connect models to external systems through standardized tools. You can think of it as a connector layer. Instead of the agent only seeing local files and shell commands, MCP can expose a database, documentation source, issue tracker, cloud service, CRM, or internal system as tools the agent can call.

This is the same shift from advice to execution. A chat model can tell you how to look up a customer record. An agent with the right connector may be able to fetch the record, compare it to code, draft a change, and run a check. In coding work, MCP is often used to bring in repository metadata, pull request comments, docs, tickets, or deployment information without forcing you to copy and paste everything.

The risk is over-connecting. More tools mean more surface area for mistakes, stale data, permissions problems, and accidental changes. Start with the tools needed for the job: filesystem, terminal, tests, and perhaps one project system such as GitHub or documentation. Add connectors when they remove repeated manual lookup, not because they sound impressive.

How To Work With One

The practical skill is learning to manage the loop. Start by giving the agent a specific outcome, the boundaries it must respect, and the verification you expect. Say whether it may edit files, run commands, install packages, or only inspect. If the task is high stakes, ask it to summarize its plan before editing. If correctness matters, ask it to run the relevant tests and report exactly what passed or failed.

Do not micromanage every line unless you have to. The point of an agent is that it can discover, act, and recover. Your job is to set direction and constraints, then read its checkpoints: what it found, what it changed, and what evidence supports the result. When it gets stuck, improve the context instead of rewriting the whole request. Provide the missing error, the intended behavior, or the file that defines the pattern.

A coding agent is not just chat with file access. It is a goal-driven loop wrapped around tools. That loop lets it turn a request into a sequence of grounded steps: read, act, observe, revise, and verify. Once you understand that, you can stop treating the agent like an answer box and start using it as a junior operator in your development environment, with clear instructions, limited permissions, and evidence-based review.

Key takeaways

  • A coding agent works through a loop: read context, choose a tool, act, observe results, and continue toward the goal.
  • Context is the information the agent has available, including your prompt, files it reads, command output, and prior decisions.
  • Tools let the agent do work outside text generation, such as searching files, editing code, running tests, or calling APIs.
  • Sub-agents are useful when a task benefits from separated roles such as planning, implementation, and validation.
  • MCP connects agents to external systems, but each new connector should have a clear job and appropriate permissions.
  • The best agent prompts define the task, background information, constraints, and what evidence should prove the work is done.