Skip to main content

AI Coding Agents

Coding agents go beyond inline suggestions — they can read your codebase, run commands, browse documentation, and iterate through a task autonomously. This page explains how they work and how to use them effectively.

How Agents Work

Agents operate in a plan → act → observe → repeat loop. The model is given a goal, a set of available tools, and the results of previous actions. It decides what to do next.

Tool Calling

The agent doesn't just generate text — it invokes structured functions: read a file, write a file, run a terminal command, make an HTTP request, search the web. The model decides when to call a tool, what arguments to pass, and how to interpret the result.

Planning

Well-designed agents decompose a large task before executing:

"I need to: (1) understand the current authentication flow, (2) identify all files involved, (3) make the changes, (4) run the test suite."

Reading an agent's chain-of-thought output before it starts acting is worthwhile — it tells you if it understood the task correctly, before it does any work.

Memory

  • In-context: the conversation and tool call history in the active session. Lost when the session ends.
  • External: files the agent reads (your codebase, CLAUDE.md, README) or writes (notes, scratchpads). This is how you give agents persistent knowledge across sessions.

Agents don't retain state between sessions automatically. Provide context explicitly — via CLAUDE.md, .github/copilot-instructions.md, or a task description file — so the agent isn't starting cold.

Human-in-the-Loop

Most coding agents pause and ask for approval before irreversible actions: writing files, running commands, making API calls.

caution

Don't approve agent steps blindly. Read what the agent proposes to do before approving. An agent with terminal access can delete files, push commits, or call external services if you let it run unchecked.

Available Agents

Built into VS Code Copilot Chat — no extra install required if you already have Copilot.

  • Can read workspace files, create and edit files, and run terminal commands, all with per-step approval prompts.
  • Supports MCP servers as tools — see MCP Servers.
  • Start here. The lowest-friction way to get agent capabilities — no extra accounts or API keys needed if the team already has Copilot.

Reference: Copilot Agent Mode docs

Claude Code

Anthropic's official CLI-based agentic coding tool. Runs from the terminal against your full repository.

  • Reads CLAUDE.md at startup for project context — see Prompt Engineering.
  • Strong multi-step reasoning; handles large, cross-file tasks well.
  • Best for: complex refactors across many files, generating thorough documentation, long-horizon tasks.

Reference: Claude Code docs

Practical Tips

  • Scope the task clearly. "Add input validation to this form component and its tests" is better than "improve the codebase."
  • Write explicit success criteria. Tell the agent what "done" looks like before it starts.
  • Commit or stash first. Before starting an agent session, commit your current state so you can git reset cleanly if the run goes wrong.
  • Review the full diff. Run git diff before accepting agent changes. Don't just check the files mentioned in the session summary.
  • Use instruction files. Put your stack and conventions in CLAUDE.md or .github/copilot-instructions.md so the agent doesn't have to guess. See Prompt Engineering.
  • Extend the agent's reach with MCP. Connect MCP servers to give agents access to GitHub, your database, or external APIs. See MCP Servers.

Resources