Home › Courses › Build an Autonomous Coding Agent

Build an Autonomous Coding Agent

Your own Claude Code: plan, edit, test and commit, built from scratch

Build a small version of Claude Code in Python. Over six lessons it learns to read a codebase, plan a change, edit files safely, coordinate edits across several files and undo them if something fails, run the tests, and commit the result with a summary.

6 lessons · 6 labs · 1 working coding agent

What you finish with

Curriculum

Tools

Anthropic Claude API · tree-sitter · Pydantic · pytest · GitPython

Common questions

Do I need to complete Course 01 first?

Strongly recommended. This course assumes you already understand the basic tool-use/agent-loop pattern from Build Your First AI Agent from Scratch and moves quickly into codebase-specific complexity on top of it.

How much does this cost to run?

Budget for it: one realistic task through the finished agent typically costs 50k-200k tokens, roughly $0.50-$2.00 at Sonnet pricing, and you'll run it more than once while debugging. Lesson 1 says so up front.

Is this safe to run on my real projects?

The course is built specifically around the safety patterns that make this reasonable: backups before every write, full rollback on any failure, and plan validation before execution. Still, start on a repo you have backed up elsewhere or that's under version control with a clean working tree.

What do I end up with?

A real CLI tool, `code_agent.py "<task>"`, that reads your repo, plans a change, safely edits the relevant files, runs your real tests, iterates on failures up to 3 times, and commits with a generated message and a verifiable summary of what changed.

Key terms in this course

Agent

Continue your learning path

Agentic AI Engineering

Start the Build an Autonomous Coding Agent course

Create a free account — the opening phases of 29 of 35 courses, and the first lesson of every phase, are free, no credit card. Or see Pro pricing.

All courses · Pricing · About · FAQ · Glossary · Projects by topic