esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • Book a callContact
  • Download ResumeContact
Let’s talk

I’ll build the agent for it.

AI engineering / Advanced / 03.32

AI coding tools

Assistants that read your code and suggest changes: what kinds exist, how to work well with them, and a small checker for their output.

10 min readFree

Helpers that build with you

The last lesson, Frameworks for multimodal apps, ended with a promise: next, AI coding tools, assistants that help you build all of this. Here they are.

An AI coding tool is a program that uses a language model to read your code and write or change it for you. Think of a very fast intern. It types quickly and knows a lot of patterns. It does not know your project unless you tell it, and it can be confidently wrong.

Key words

Coding assistant
A tool that suggests or writes code while you work.
Agent
A tool that does a job in several steps by itself: read files, make a change, run a command, look at the result. The AI agents lesson explains the loop.
Diff
A list of what changed between two versions of a file. Lines that were added start with a plus sign, lines that were removed start with a minus sign.
Pre-commit check
A small script that runs just before you save a change into your project history, and warns you about anything that looks wrong.
Licence
The rules that say how you may copy and reuse someone else's code.

Tip

Tool facts in this lesson were checked on 16 November 2026. These products change fast, so open the official page before you decide.

The tools, side by side

There are many of these tools. Some live inside an editor, the program where you type code. Some run in the terminal, the plain text window where you type commands. Some run in the cloud and build whole apps from a chat.

Below is a neutral list. Each line quotes the tool's own page, and nothing more. There is no ranking, because the right tool depends on how you like to work.

  • Claude Code

    Its docs say: "Claude Code is an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools. Available in your terminal, IDE, desktop app, and browser."

  • Gemini CLI

    Its README says: "Gemini CLI (`gemini`) is an open-source terminal agent maintained for enterprise Gemini Code Assist workflows on Google Cloud." It also says it is "fully open source (Apache 2.0)".

  • Codex

    OpenAI's Codex page lists three places to use it: Codex CLI, Codex IDE extension and Codex Cloud, and says: "Choose the ChatGPT or Codex surface that fits your workflow."

  • Cursor

    Its docs say: "Cursor is a coding agent for building ambitious software." The docs also have sections on a CLI and on Cloud Agents.

  • OpenCode

    Its docs say: "OpenCode is an open source coding agent. It’s available as a terminal-based interface, desktop app, or web app."

  • Replit

    Its docs say: "Turn ideas into real apps and sites. Build, iterate, and publish with confidence." It can be used "on the web, in the Desktop App, or in the Mobile App".

Two things stand out. First, the same word can mean different things: "terminal agent", "IDE extension" (an add-on inside an editor) and "cloud agent" are three different ways to work. Second, "open source" is stated on some pages and not on others, so do not assume it. Read the page.

Why does the place matter? Because it decides what the tool can touch. A tool in your terminal can read your files and run commands on your own computer. A tool in the cloud works on a copy somewhere else. A tool inside your editor sits right next to the code you are typing. Each choice trades speed, control and risk in a different way.

You may also see the plain label "Development Tools" for this whole group. It is just the shelf these products sit on.

Quick check

Two tools both say they are coding agents. What is the safest way to compare them?

How to work well with them

A tool is only as good as the way you use it. These habits matter more than which tool you pick.

  • Give context, then small steps

    Say what the project is, which files matter and what "done" looks like. Then ask for one small change at a time, not a whole app. The Context engineering lesson goes deeper.

  • Read every diff

    Never accept a change you have not read. If a line confuses you, ask the tool to explain it, or reject it.

  • Test and keep secrets out

    Run your tests after every change. Never paste passwords or keys into a chat, and never let a key sit in code you commit.

  1. 1

    Describe the goal

    One or two sentences: what you want and why.

  2. 2

    Point at the right files

    Name the files or folders the change should touch, and the ones it must leave alone.

  3. 3

    Ask for a small step

    For example: add one function, or fix one bug. Not: rebuild the page.

  4. 4

    Read the diff

    Look at every added and removed line before you accept anything.

  5. 5

    Run the tests

    If something fails, paste the error back and fix that one thing.

  6. 6

    Save and repeat

    Commit the small change, then go to the next step.

Tip

A tool can suggest code that looks like someone else's work. Check the licence of any code you did not write, the same way you would for a library. The Closed vs Open Source Models lesson explains why licences matter.

The tool can also be fooled. Text inside a file it reads may try to give it orders. The Prompt injection attacks lesson covers this. Another reason to read every diff.

What can go wrong

These tools are built on language models, the same kind you met earlier in the course. So they share the same weak spots. The answer can change from one run to the next. The tool can sound sure and be wrong. It can invent a function that does not exist, or use a library in an old way. The How LLMs Work lesson explains why.

A real model is also slower than a normal program, and most paid tools charge for every token they read or write. A long chat that keeps your whole project in view costs more than a short one. The Tokens lesson shows how to count. Keep chats short and focused, and start a fresh chat for a new job.

Sometimes the tool refuses or fails. Nothing is wrong with you. Rephrase the task, make it smaller, or do that part by hand.

The biggest risk is trust. When code arrives fast and looks tidy, it is easy to skim it. Slow down on the parts that handle money, passwords, personal data and anything a stranger can type into. Those are the places where one wrong line hurts people.

A small checker for AI changes

Reading is slow, and tired eyes miss things. A pre-commit check can catch the obvious ones for you. Here is a tiny one in plain Python. It scans a made-up diff and looks only at added lines. It hunts for three things: a string that looks like a secret key, a TODO marker (a note that says "fix this later"), and a print() debug line left behind.

It keeps track of the line number in the new file. The diff header tells it where each block starts. Removed lines do not count, because they are gone from the new file. Unchanged lines only move the counter. One shortcut: it skips any line starting with three dashes, so a removed line like that would slip past. For a classroom check that is fine.

Python
import re

# A made-up diff, as an AI tool might hand it to you.
DIFF = """\
diff --git a/app/pay.py b/app/pay.py
--- a/app/pay.py
+++ b/app/pay.py
@@ -1,6 +1,12 @@
 import requests
+API_KEY = "sk_live_51Hx9aBcDeFgHiJkLmNoP"
+
 def charge(amount):
-    return requests.post(URL, json={"amount": amount})
+    # TODO: handle failed payments
+    print("charging", amount)
+    reply = requests.post(URL, json={"amount": amount})
+    return reply.json()
"""

SECRET = re.compile(r"(api[_-]?key|secret|token|password)\s*=\s*[\"'][^\"']{8,}[\"']|sk_live_\w+", re.I)
TODO = re.compile(r"\b(TODO|FIXME|XXX)\b")
DEBUG = re.compile(r"^\s*print\(")

def check(diff):
    findings = []
    new_line = 0
    for raw in diff.splitlines():
        hunk = re.match(r"@@ -\d+(?:,\d+)? \+(\d+)", raw)
        if hunk:
            new_line = int(hunk.group(1)) - 1
            continue
        if raw.startswith(("+++", "---", "diff ")):
            continue
        if raw.startswith("-"):
            continue  # removed lines do not exist in the new file
        new_line += 1
        if not raw.startswith("+"):
            continue  # unchanged context line: only count it
        text = raw[1:]
        if SECRET.search(text):
            findings.append((new_line, "secret-like string", text.strip()))
        if TODO.search(text):
            findings.append((new_line, "TODO marker", text.strip()))
        if DEBUG.match(text):
            findings.append((new_line, "print() debug line", text.strip()))
    return findings

results = check(DIFF)
for line, kind, text in results:
    print(f"line {line}: {kind}: {text}")
print(f"{len(results)} finding(s). A person must still read the diff.")

Output

line 2: secret-like string: API_KEY = "sk_live_51Hx9aBcDeFgHiJkLmNoP"
line 5: TODO marker: # TODO: handle failed payments
line 6: print() debug line: print("charging", amount)
3 finding(s). A person must still read the diff.

Read the output line by line. Line 2 is the key, line 5 the TODO, line 6 the debug print. The removed line in the diff was not counted, which is why the numbers match the new file and not the old one. This code uses no model, so there is nothing to stand in for. It runs free and gives the same answer every time.

In real projects people wire a check like this into a pre-commit hook, a script the version-control tool runs before each save. Then it runs on every change, human or AI, without anyone remembering.

Tip

This is a teaching check, not a security scanner. Real secrets come in many shapes, and this one catches only a few. A clean result does not mean the change is safe. A person must still read the diff.

Quick check

The checker prints no findings for a diff. What does that mean?

The whole course in one path

This is the last lesson of the course, so here is the path you walked. Each step stands on the one before.

  1. 1

    Models and tokens

    What a language model is, how text becomes tokens, and what that costs.

  2. 2

    Prompts

    How to ask clearly, with instructions, examples and limits.

  3. 3

    Context

    What the model sees at once, and how to choose it well.

  4. 4

    Retrieval

    Finding the right facts first, then letting the model use them.

  5. 5

    Tools and agents

    Letting a model call functions and work through a task in steps.

  6. 6

    MCP

    A shared way to connect models to tools and data.

  7. 7

    Safety

    Injection, privacy, bias, and testing how things break.

  8. 8

    Monitoring and evals

    Watching a live product and scoring answers on purpose.

  9. 9

    Multimodal

    Images, speech and more, beyond plain text.

AI coding tools sit on top of all of that. They are one more product built from the same parts: a model, some context, a few tools and a loop.

Quick check

Which habit protects you most when a tool changes your code?

What to build next

Choose something small that you would really use: a tool that sorts your notes, a helper that answers questions about one document, a form that checks itself. Small means you can finish it.

Build it in layers. Start with one plain model call. Add a good prompt. Add the right context. Add retrieval or a tool only when the plain version falls short. Add a simple test and a way to watch it. Keep your coding tool on a short leash, and read what it writes.

That's the end of AI engineering. Pick one small product idea and build it, one lesson at a time.

Sources

How is this lesson?

Last updated on 16 November 2026

Learn with me

Every lesson is free. I add new ones as I learn. Have a question, or want help with your own work? Book a short call.