Where We're Going

Welcome to the AI Coding Crash Course. My name is Matt Pocock. I'm delighted to be your instructor. Thanks for joining.

This course is really the distillation of about two years of playing around with AI coding and trying to bring software fundamentals back to AI coding.

GitHub repository showing mattpocock/skills with 200,000+ stars

GitHub repository showing mattpocock/skills with 200,000+ stars

Many of you are probably here because of my skills repository which, at the time of recording, just crossed 200,000 stars.

That puts it in the top 20 most starred GitHub repos of all time. We are crossing 13 million downloads of the skills.

What You'll Learn

What I wanted to do with this course is give you a set of practices that you can use in your workplace to actually start shipping code.

I'm going to show you a five-step system that goes from grilling, to creating a spec, to creating tickets for that spec, to implementing, and then doing review.

Five-step system: grilling, spec, tickets, implementation, review

Five-step system: grilling, spec, tickets, implementation, review

I felt comfortable creating a course at this point because these five steps have really remained unchanged, no matter what else I do, what else I'm playing around with.

Having these five steps feel absolutely essential to shipping great work.

Context Management and Breaking Up Work

I'm going to take you through how we make decisions on context management, thinking deeply about how attention degrades as you get further into the context window.

When you should compact, when you should clear, when you should hand off.

And we'll be going deep on breaking up huge chunks of work into things that agents can handle.

The Playground: Cadence

We're going to be doing this by using a playground. This is Cadence, a TypeScript and Node application with a pretty mature set of features where people buy courses, they work through lessons, take quizzes.

Cadence application codebase showing TypeScript and Node structure

Cadence application codebase showing TypeScript and Node structure

And so this is a practical course. You're going to be working with your agent, shipping features, working through the exact software lifecycle that I've been working through the last 10 years and that I've discovered works incredibly well with agents.

Which Agent Should You Use?

You're probably thinking, which agent should I use? Well, my answer to that is to use any agent that can run in a terminal and use skills.

So that is basically all of them. Claude Code, Codex, OpenCode, GitHub Copilot, whatever the Gemini one is.

List of coding agents: Claude Code, Codex, OpenCode, GitHub Copilot

List of coding agents: Claude Code, Codex, OpenCode, GitHub Copilot

This course is not about focusing on one particular agent, learning the quirks of that agent. It's about teaching you the fundamentals so that you can use any agent well.

And everything that we're going to be covering is going to be delivered through skills. So you can take those skills and use them in any agent.

The Demonstration Agent: Claude Code

However, the agent I'll be using as my demonstration agent is Claude Code.

Claude Code interface as the demonstration agent

Claude Code interface as the demonstration agent

This is my daily driver and it's also maybe the most popular coding agent at the time of recording.

For folks who have never touched AI coding before, I will give you a specific section on Claude Code just to get good enough at it to take the course.

But other than that, we're not going to be talking about Claude Code really at all once we get into the meat of the course.

This crash course is all about fundamentals that you can use with any harness, any agent.

Prerequisites

The prerequisites for this course are really two things:

  • Can you read code? Good.
  • Can you use a terminal?

Reading code will allow you to navigate the code base a little bit easier, understand exactly what's going on. You don't necessarily even need to be able to write code.

Just an understanding for the vague shapes of things will be helpful.

And then you'll also need to be able to find the terminal to use some basic terminal commands like cd and ls and understand vaguely what's happening in there.

What You'll Be Able to Do

Once you're done with the course, you'll be able to ship enormous amounts of work at super high quality.

This won't be done by making the model better, it will be done by making you better, by giving you the skills you need to drive agents better.

This approach is incredibly light in terms of context load. It just demands a little bit of understanding from you.

And that's what this course is for, to level you up to be able to take your software development with AI to the next level.

Choosing Your Plan and Model

Before you begin this AI coding course, you need to set up your AI access. This means choosing the right subscription plan and understanding what you'll need.

You Need a Paid Plan

Unfortunately, you need a paid plan to complete this course.

The free tiers of the major model labs are not sized for agentic work of this kind. You will hit a wall in the first serious session.

Anthropic Pricing

Looking at Anthropic's pricing page, the free tier won't be enough to complete the course.

Pro is just enough, and that's where I recommend you start. It gives you access to a mid-tier model that will get you through the course.

If you're doing this work professionally, I recommend upgrading to Max. Max comes in two flavors: 5X or 20X.

Anthropic's pricing page showing Free, Pro, and Max subscription tiers

Anthropic's pricing page showing Free, Pro, and Max subscription tiers

OpenAI Pricing

OpenAI's pricing is similar, with an additional Go tier in the middle.

OpenAI's pricing page showing Plus, Go, and Pro subscription tiers

OpenAI's pricing page showing Plus, Go, and Pro subscription tiers

Plus is equivalent to Anthropic's Pro and provides basic access - start here. If you hit usage limits, upgrade to Pro.

What I Used While Recording

This course was recorded with a 20X Anthropic Max subscription.

However, the maximum you'll need is a 5X. That's about £89 per month (roughly $100).

Subscriptions vs API Keys

You might be wondering how subscriptions compare to API keys, where you pay per token.

My advice: get a subscription. It's a much better deal - often 20 to 50X cheaper, depending on your tier and how much work you fit into the usage limits.

Tweet from Theo showing $50,000 in token spend equating to $800 in subscriptions

Tweet from Theo showing $50,000 in token spend equating to $800 in subscriptions

For example, Theo came close to $50,000 in token spend in a single month. With subscriptions, that would have been just three $200 Claude subs plus one $200 Codex sub.

That's $800 for around $50,000 worth of token spend.

The Psychological Impact of Pay-Per-Token

There's also a psychological impact when you see the cost of every session.

It's like having an electricity meter at home - you become reluctant to use any electricity, and it changes how you work. You optimize for tokens instead of efficiency.

You'll make slightly irrational decisions when focusing on cost instead of quality. You might drop to a cheaper model just to keep the number down.

With a subscription, you know upfront what you'll pay and what you'll get. No budget stress.

My Recommendations

Default: Claude Code with Pro

This course was recorded with Claude Code. If you have no preference, use Claude Code as your default. Start with a Pro subscription.

For Professionals: Max Subscription

If you're serious about AI coding professionally, go for Max.

Choosing Your Model

Use the default model that comes with your plan. If you're on Pro, avoid Opus - it will drain your usage limit very quickly.

We'll revisit model choices later. For now, lock in a subscription before you start.

Get Help on Discord

If you have questions about choosing between Anthropic and OpenAI, or which models to use on different tiers, head to the Discord for help.

Setting Up the Project

Most of what we're going to be doing is working within a terminal. The agent we're going to be running is a terminal program.

The recommended IDE for this course is Visual Studio Code. It's been the presenter's tool of choice since 2017 for a few good reasons:

  • Completely free
  • Works across platforms
  • Very approachable
  • Has a built-in terminal
Visual Studio Code website at code.visualstudio.com

Visual Studio Code website at code.visualstudio.com

If you already have an IDE you're comfortable with, just use that - as long as it has a terminal inside and you can use it to view code, you're good to go.

The VSCode Terminal

On Mac and Windows you already have a terminal. On Windows, you can also use the Windows Subsystem for Linux (WSL) to get a Linux terminal, giving access to commands like cd and ls.

Once you have VS Code installed and open, press Ctrl+` to open the integrated terminal. This opens the terminal in whatever folder VS Code currently has open.

VS Code with the integrated terminal panel open

VS Code with the integrated terminal panel open

You can drag it up and down, split the editor, or delete and reopen the terminal. Once you have the terminal visible, choose where you want the project directory to go. For example, cd into a repos folder:

cd repos/learning
ls

Having some basic familiarity with the terminal will be very useful. If that's a weakness for you, head to the Discord for resources.

Cloning the Project with Git

The project lives on GitHub. You'll need git to clone it. Run the following to check whether you have it installed:

git --version

If you don't have git installed, a link to download it is provided below.

Once you have git, go to the GitHub page for the AI Coding Crash Course. Click the Code button, select HTTPS, and copy the URL. Then back in the terminal, run:

git clone https://github.com/ai-hero-dev/ai-coding-crash-course.git
Terminal showing git clone command running and completing

Terminal showing git clone command running and completing

It should clone into ai-coding-crash-course. Once that's done, open the folder in VS Code. You can do this from the terminal with:

code ai-coding-crash-course

You should now see the file explorer on the left-hand side with all the project files.

Installing Node

This project uses Node.js to run JavaScript on your computer. Check whether you have it installed:

node --version

The current installed version is 22.21.1. You want an LTS (Long-Term Support) version, as it's the most stable. Here's what the version labels mean:

LabelMeaning
LTSLong-term support - most stable, recommended
CurrentLatest, fanciest version
EOLEnd of life - no longer supported

You can install Node.js from the Node.js download page. Aim for version 22 or 24. If you're having trouble seeing node after installing it, kill the terminal and reopen it to refresh the PATH:

node --version

Node ships with npm (Node Package Manager). Check it's available too:

npm --version

Installing Dependencies

With Node installed, run the following inside the project directory to pull down all the necessary packages from the npm package registry:

npm install

This may show some warnings or vulnerability notices - that's normal for npm. Once it's done, you'll see a node_modules folder appear in the file tree.

Terminal showing npm install completing with node_modules folder visible

Terminal showing npm install completing with node_modules folder visible

These node modules are packages that people have published on npm. For example, ai-hero-sandcastle is one of the packages this project depends on.

Setting Up the Database

The app stores its data in a local file. A fresh clone doesn't include it, so two commands are needed to build it.

First, create the database by running:

npm run db:migrate

This creates a local data.db file in the project root. Then, fill it with seed data:

npm run db:seed

These scripts, along with others, are defined in package.json:

{
  "scripts": {
    "db:migrate": "...",
    "db:seed": "...",
    "dev": "..."
  }
}

Running the App

Now run the dev server:

npm run dev

If everything is set up correctly, you'll see a local URL printed, something like localhost:5173. You can Ctrl+click the URL in VS Code and it will open right inside the IDE.

VS Code showing the app running at localhost:5175 inside the IDE browser panel

VS Code showing the app running at localhost:5175 inside the IDE browser panel

The Cadence App

This is Cadence, the application we'll be building features on throughout this course using AI. It's a reasonably sized application.

Switch it to dark mode to save your eyes.

Cadence app showing Emma Wilson's dashboard with TypeScript and Node.js courses

Cadence app showing Emma Wilson's dashboard with TypeScript and Node.js courses

One key feature to know about is the dev UI at the bottom, which lets you switch the user you're currently logged in as. For instance, logging in as Emma Wilson shows she has access to two courses: TypeScript and Node.js.

The app has been seeded with dummy data - courses, lessons, and users created by Marcus Johnson. Once you can see this dummy data visible inside VS Code, you're done with this lesson.

You have successfully set up all the dependencies of the project. Detailed steps are provided below, and if you run into any issues, head to the Discord.

Installing Claude Code

The project is set up and the terminal is ready. The only thing missing is the agent itself.

This lesson uses Claude Code as the agent. If you're using a different coding agent, install it from its own docs and log in!

Steps To Complete

Install Claude Code

  • Open a new terminal in VS Code inside your project folder
  • Navigate to the Claude Code setup page and copy the install command for your platform:
PlatformCommand
Linux / WSL / macOSnpm install -g @anthropic-ai/claude-code
Windows PowerShell(see setup page)
Windows CMD(see setup page)
  • Paste and run the command in your terminal

Log In

  • Launch Claude Code from inside your project folder:
claude
  • When prompted do you trust this workspace?, answer Yes
Claude Code terminal prompt asking 'Do you trust this workspace?' with Yes option

Claude Code terminal prompt asking "Do you trust this workspace?" with Yes option

  • When prompted to log in:
    • Choose the subscription option
    • Let it open your browser
    • Authorise there
    • Come back to the terminal

Set Your Model and Effort

  • Run /model to open the model picker:
/model
Claude Code model picker showing available models with default selected

Claude Code model picker showing available models with default selected

  • Select the default for your subscription tier (e.g. Opus 5 with a 1 million token context window)
  • Set the effort level to medium using the left and right arrow keys - it defaults to xhigh, so make sure to dial it down

The course was recorded on Opus 5 at medium effort. Higher effort burns through tokens faster and runs slower - on the work in this course it doesn't buy a better answer.

Verify Everything Works

  • Send a quick sanity check message:
hello

You should get a hello back. Once you see that, you're done with the setup.

Claude Code terminal showing hello message sent and hello response received

Claude Code terminal showing hello message sent and hello response received

How To Run the Exercises

Commit Map
main Start the lesson: the course repo exactly as you clone it
try-the-cli Verify the tooling: the checkpoint that changes the description field in package.json

This course works by giving you exercises to complete - plan this feature, add this change, fix this bug. The challenge with any code course is drift: you make a change the video didn't make, and three lessons later your codebase and the one on screen are different.

To fix that, there are three CLI tools built into the project. They let you jump to any exercise's starting state on demand.

CommandWhat it does to your work
npm run resetReplaces it - your commits are gone
npm run cherry-pickAdds to it - checkpoint lands on top
npm run pullUpdates around it - fetches upstream changes

Steps To Complete

Create Your Development Branch

  • Create a new dev branch to work from

This is your throwaway learning branch. All three tools work on this branch, and it keeps main clean.

git checkout -b dev
⚠️ Warning: If you skip this step, the tools will refuse to run. You'll see errors like Cannot reset to main while on the main branch.

Reset to an Exercise Checkpoint

  • Run npm run reset to see the full list of course checkpoints
npm run reset

This opens an interactive picker showing every checkpoint in the course, in order. You can type to search - for example, typing try the cli will narrow to try-the-cli.

The npm run reset interactive picker showing the list of course checkpoints

The npm run reset interactive picker showing the list of course checkpoints

  • Select a checkpoint and choose Reset current branch

The tool will rewind your branch to that exact commit. You'll see output like:

Resetting to try-the-cli...
✓ Reset to try-the-cli

You can also pass the checkpoint name directly to skip the picker:

npm run reset try-the-cli
⚠️ Reset is destructive. It rewinds the entire working branch - not just the files an exercise touches. Uncommitted work is gone. Commit or stash anything you want to keep before you reset.

Keep Your Own Work With Cherry-Pick

  • Add a script to package.json to experiment with, for example:
"foobar": "echo 'foobar'"
  • Commit that change via VS Code's Source Control panel (Ctrl+Shift+G) or the terminal
  • Run npm run cherry-pick instead of reset
npm run cherry-pick

This shows the same picker, but instead of rewinding your branch, it applies the checkpoint's commit on top of your existing work. Your commits stay underneath it.

Cherry-picking c4a46e5 onto current branch...
✓ Successfully cherry-picked lesson try-the-cli
CommandWhat it does to your work
npm run resetReplaces it - your commits are gone
npm run cherry-pickAdds to it - checkpoint lands on top
npm run pullUpdates around it - fetches upstream changes
If you're not comfortable with Git and resolving merge conflicts, stick to reset throughout the course.

Pull in Course Updates

  • Run npm run pull to fetch any updates shipped to the course
npm run pull

This fetches from the upstream repo and brings changes into your branch. It does not reset, and it does not touch your commits. You'll mostly need this when a fix is announced in Discord.

Fetching main from upstream...
Merging upstream/main into dev...
✓ Successfully merged upstream/main into dev

Verify the Setup

  • Run npm run reset, pick try-the-cli, and confirm that package.json updates its description field from "An awesome horse platform" to "An awesome course platform"
  • Run npm run reset again, pick main, and confirm it reverts back to "An awesome horse platform"

If you see those two strings swap back and forth, the tooling is working correctly.

Database Migrations

Commit Map
try-the-cli Start the lesson: the repo with the CLI check applied, before any schema change
make-a-schema-change Follow along: the notes column added to schema.ts, plus its migration

This lesson exists because a lot of folks who've taken this course before have run into difficulties on this point. If you're already familiar with what a database is and the difference between a database and source code, you can skip this lesson, but it's pretty essential information, so it's worth covering in depth.

The Two Units

UnitWhat it isExample
Source code Files you edit to change the behaviour of your application app/db/schema.ts, app/components/dev-ui.tsx
Database A separate store of actual data data.db (a file on disk)

The project uses SQLite, and the database is literally just a file on disk called data.db. The source code, things like app/components/course-image.tsx and app/components/dev-ui.tsx, is readable text you can modify to change how the application behaves.

The file tree showing data.db at the repo root alongside the source code folders

The file tree showing data.db at the repo root alongside the source code folders

If we look inside app/db/schema.ts, we can see that the source code is actually defining the shape of the database, declaring tables and their columns.

How Database Migrations Work

Diagram showing the directional relationship between source code and the database, with migrations as the step in between

Diagram showing the directional relationship between source code and the database, with migrations as the step in between

Key insight: The source code defines how the database should look, but you need to manually do something before the database catches up.

That step is a database migration: you manually update the database to match what the schema says it should look like.

The reason this is done manually is because traditionally, the database holds pretty important information: all of your user data, the stuff that's very sacred. In real applications, you need to do a manual migration to synchronise them.

This means your source code and your database need to be versioned together:

  • If your source code changes but the database hasn't been migrated to keep up, you'll probably get an error.
  • In this project, app/db/schema.ts is the source code, and data.db is the live state of the database.
  • To migrate them, you run:
npm run db:migrate

Hands-On Migration Walkthrough

To see this in action, open app/db/schema.ts and run npm run reset in a fresh terminal. Select the make-a-schema-change lesson commit ("Make a Schema Change" in the picker) and reset the current branch.

This makes a very subtle change: it adds a notes column to the courses table in schema.ts.

  description: text("description").notNull(),
+ notes: text("notes"),
  salesCopy: text("sales_copy"),

It has also generated a new migration file inside the drizzle/ folder, 0003_lean_hex.sql:

ALTER TABLE `courses` ADD `notes` text;
The drizzle/ folder showing four migration SQL files

The drizzle/ folder showing four migration SQL files

The drizzle/ folder is basically the history of all database migrations that have been applied. Reading them newest-to-oldest:

  • 0003_lean_hex.sql - adds notes column to courses (just added)
  • 0002_lying_shriek.sql - adds coupons
  • 0001_cynical_sunspot.sql - adds github_repo_url to lessons
  • 0000_dizzy_fenris.sql - the initial migration

The agent is going to be the one responsible for managing these, and they'll grow as the application develops. You won't have to worry too much about them directly.

Debugging the Schema Mismatch Error

Even this tiny addition is enough to break things if you run the dev server without migrating.

Open http://localhost:5175 and browse to a specific course. The front page looks fine, but the course detail page errors.

The course detail page showing an error in the browser

The course detail page showing an error in the browser

Looking at the terminal, there's a SqliteError:

no such column: notes

This is coming from the getCourseBySlug function. The schema file has been changed, but data.db hasn't been updated to match.

This is something you'll run into a lot when you reset the state of the source code. npm run reset only touches the source code. It doesn't run db:migrate for you.

The fix is to open another terminal and run:

npm run db:migrate
Terminal running npm run db:migrate

Terminal running npm run db:migrate

Once that's done, refresh the page and it's working. The data.db and the schema are now in sync.

Breaking and Resetting Your Database

It's also worth saying that you can absolutely break your database at any time. This is not production data.

There's a seed script that you ran during the intro to seed the database. Here's what it does:

  1. Deletes all the tables
  2. Recreates them
  3. Adds a bunch of dummy data

The dummy data includes users like the admin Alex Rivera, and instructors Sarah Chen and Marcus Johnson.

This is something the agent might want to update if you're testing certain scenarios and need specific seed data.

The Flow to Remember

When the agent makes changes to schema.ts, you'll need to either get the agent to migrate itself, or migrate manually. This is especially true after running npm run reset, as the schema will probably be out of sync with the database.

Here's a quick reference for the three key scripts:

CommandWhat it does
npm run db:generateWrites a new migration file to drizzle/ from a changed schema.ts
npm run db:migrateApplies pending migration files to data.db
npm run db:seedWipes and refills the database with dummy data

After any npm run reset that touches schema.ts, always run npm run db:migrate.

Resetting to a Clean Slate

Most folks who take this course have already tried fiddling around with some kind of agentic setup.

You've maybe tried:

  • Some MCP servers
  • Fiddling with settings
  • Installing a bunch of skills
  • Plugins

All of this probably means you've over-configured your setup. Most people come into this course with way too much config already there.

Delete It (Or Back It Up)

The recommendation here is probably to delete all of it. A lot of it you simply don't need. It's best to work from a small starting point.

But if you're precious about it and want to retain it, make sure you back it up first.

Let Your Agent Do It

The recommended way to do this is to get your agent to do it. Your agent should be an expert on its own configuration.

Use the prompt below, copy and paste it to your agent to tell it to revert things to a blank slate, with everything backed up.

You are the expert on your own configuration. Reset me to a clean slate (the config a fresh install would have) with everything I have now preserved so you can restore it on request later. 1. Inventory. Consult your own documentation for where your configuration lives, then find every piece of it that applies to me, both global (user-level) and local (this project). Cover settings files, instruction/memory files, MCP servers, skills, plugins/extensions, subagents, custom commands, hooks, and output styles. Report every path you find with a one-line description of what it does. Done when every location named in your docs has been checked and reported, including the ones that turned out to be empty. 2. Back it up. Create `~/agent-config-backup-<today's date>/` and MOVE each item there, mirroring its original path inside the backup so the layout is self-describing. The backup is the only surviving copy, so verify each move landed before continuing. 3. Write the restore instructions. Add `RESTORE.md` at the root of the backup listing every backed-up item, its original absolute path, and the exact commands to put it all back. Written well enough that a future agent with no memory of this conversation can restore everything from that file alone. 4. Verify. Re-run the inventory from step 1. Report what remains and confirm each remaining item is a genuine default rather than something I configured. Keep me signed in - leave auth, credential, and session files exactly where they are. Keep this project's source code untouched; only configuration moves. Finish with a table of what was moved and the one-line command I can give you later to restore it.

That way you can remind it later to restore from that backup. It should be pretty simple since most of this configuration is file-based, it'll save everything in a separate directory and be able to rehydrate back whenever needed.

What Happens When You Run It

Claude Code terminal running the reset prompt

Claude Code terminal running the reset prompt

In Claude Code, it's going to check its own documentation for where configuration lives, and then inventory everything.

Once the inventory is done, it starts backing up your config to a safe place.

Here's an example of what the inventory table looks like:

PathWhat it does
~/.claude/settings.jsonMain settings: tool denies, defaultMode, effortLevel, tui, auto-memory, etc.
~/.claude/settings.local.jsonWebFetch allow rules + WebSearch
~/.claude/CLAUDE.mdGlobal memory file
~/.claude/skills/User skills (often symlinks)
~/.claude/hooks/Executable hook scripts
~/.claude/plugins/Installed plugins
~/.claude.jsonMCP servers, per-project permissions/trust, plus auth + identity

It also checks locations that turned out to be empty, such as ~/.claude/agents/, commands/, output-styles/, and rules/.

After the Backup

Once the backup is done, your agent will give you a short prompt you can use later to restore everything. Something like:

Restore my config from ~/agent-config-backup-<date>/RESTORE.md

Trying the Restore

Claude Code terminal after running /clear, about to restore config

Claude Code terminal after running /clear, about to restore config

To test it, clear your agent session (don't worry if you don't know what this means yet, it'll be covered later), then paste that restore command in. Your agent will read RESTORE.md and put everything back.

Why Bother?

If you have a very in-depth configuration that you've worked hard on, you don't want to lose it. But it's worth seeing what it's like without it.

Run the prompt above, do the course, and then afterwards you can choose exactly what you want to restore.

Doing this will mean the course material doesn't interact with your dumpster fire.

…sorry, not dumpster fire. Your very carefully curated Olympic torch.

Installing The Request Logger

Agents can feel like a black box. You type a message, the harness sends a request to the model provider, and you never see what's in it, not the system prompt, not the tool definitions, not any of it.

The course repo ships a request logger to fix that. It's a small proxy that sits between your agent and the model provider, passes everything through untouched, and writes a readable copy of every request to disk.

Steps To Complete

Start The Request Logger

  • In a terminal, start the request logger from the repo root:
npm run request-logger

The first time you run it, it asks which coding agent you use. If your agent can use more than one model provider, it asks which one. Then it asks whether to remember your answer, so it only has to ask once.

It then starts a local web server listening on localhost:8787, and prints the exact command for the agent you picked.

Terminal showing the request logger listening on localhost:8787

Terminal showing the request logger listening on localhost:8787

  • In a second terminal, copy and paste the command the request logger printed, and run it

That command starts your agent pointed at the logger. Do not write it yourself. The logger builds it for your agent, so it is correct as printed. Some agents also need a small config file, and the logger prints that too.

The command sets everything at startup, so your agent must be launched with it.

  • Send a short message to the agent and confirm it responds as normal

The proxy passes everything through untouched. Your agent should feel identical to use.

Agent responding normally while the request logger is running

Agent responding normally while the request logger is running

Explore The Log Files

  • Open the request-logger/logs/ folder

After sending a message, you'll see timestamped files appear. Each timestamp is in UTC.

The request-logger/logs folder showing timestamped log files

The request-logger/logs folder showing timestamped log files

  • Open the newest .md file - this is the readable render and the one to start from

The three file types for each request are:

FileContents
.mdThe readable render - start here
.request.txtThe verbatim request body
.response.txtThe raw response stream
  • Note that you may see more than one log entry per message you send

Claude Code fires a quota probe at startup, a deliberate one-token request to check subscription headroom. That probe lands as its own log entry (often a 429 error), separate from the real turn. So two entries for one message is expected, not a retry.

Navigate The Readable Render

  • Familiarise yourself with the XML tag structure of the .md file

The file uses XML tags rather than Markdown headings to delimit sections, because the captured content is itself full of Markdown headings. The sections are:

<meta>         - timestamp, model, endpoint, status
<headers>      - request headers (authorization is redacted)
<request>
  <params>     - max_tokens, stream, thinking settings
  </params>
  <system-prompt>
  </system-prompt>
  <tools>
  </tools>
  <messages>
  </messages>
</request>
<response>     - stop reason and token usage
</response>
  • Scroll through the <tools> block and note how large it is relative to the rest of the file

Tool schemas are JSON and take up the majority of the file. On a one-word prompt like Hello!, this can run to over 1,000 lines out of roughly 1,300 total.

The readable .md log file open, showing the large tools block

The readable .md log file open, showing the large tools block

  • Find the <system-prompt> block and read what's in it

This is the standing brief your agent prepends to every request before you've typed anything. It includes things like your working directory, platform, and session guidance.

  • Find the <messages> block and locate your actual message inside it

You'll also see a system-reminder turn injected before your message with context like the current date. This is a message, not part of the system prompt, only visible here because of the logger.

  • Check the <response> block for the token usage figures

Even a single Hello! can result in tens of thousands of cached tokens being read. The full system prompt and tool definitions are sent on every turn.

You can shut the request logger down now. We'll call it out specifically when we need it again later in the course.