Reading Code You Didn't Write
The most important skill in AI-assisted building is not writing code — it's reading what the AI wrote and knowing if it does what you asked.
You are not going to write Python from scratch. Claude will write it. Your job is to read what Claude produced, understand what it does, and verify that it does what you actually asked for.
This is the skill that separates people who successfully use AI-assisted building from people who run a script, get unexpected results, and give up. It has nothing to do with programming ability. It is a reading skill.
Why Reading Beats Running
When Claude generates a script, it is doing its best to match your intent from a description. That match is usually very good. It is not always perfect. A script can:
- Read the right file but write output to a different location than you expected
- Process all rows when you meant to process only new rows
- Silently skip rows that have empty cells instead of flagging them
- Work correctly on your test data but fail on edge cases in the real data
None of these problems are visible until you look. Running the script without reading it first is flying blind.
How to Read a Function You've Never Seen
A function is the basic unit of a Python script. It takes some inputs, does something, and (usually) returns an output. Reading a function means answering four questions:
What goes in? Look at the function's inputs — the names listed inside the parentheses. They tell you what data the function expects.
What does the middle do? Skim the body for verbs: open, write, filter, calculate, send. Each verb is the function doing something to your data.
What comes out? Look for return statements. Whatever follows return is what the function gives back.
What can go wrong? Look for if statements and try/except blocks. These are the places the code protects itself against bad inputs or failures.
You don't need to understand every line. You need to answer these four questions. Claude can fill in any gaps.
The Explain-This Loop
The most powerful tool in your reading toolkit is deceptively simple: paste the code into Claude and ask it to explain what it does in plain English.
Here's the protocol:
- Claude writes a script for your task
- You read through it and mark anything you don't immediately understand
- You paste those sections back to Claude and ask: "Explain what this part does, in plain English, as if I'm not a developer"
- Claude gives you the translation
- You compare that translation to your original intent
- If they match: proceed. If they don't: revise the prompt and regenerate
This loop catches the gap between what you asked for and what was actually built. The gap is usually small. But on a script that runs against real business data, small gaps matter.
A Quick Reference: Three Python Patterns You'll See Everywhere
You don't need to memorize these. But when you see them, you'll know what they mean.
Opening a file:
with open("data.csv", "r") as f:
# everything here can read from f
The "r" means read-only. Nothing is changed. When the with block ends, the file closes automatically.
Looping through lines:
for line in f:
# this runs once for every line in the file
If the file has 500 lines, this block runs 500 times. The variable line holds the current line's content on each pass.
Writing output:
with open("output.txt", "w") as out:
out.write("result goes here\n")
The "w" means write — it creates the file if it doesn't exist and overwrites it if it does. That's important: if the file already has content, "w" wipes it. Ask Claude to confirm this if you're unsure.
Building Your Annotation Habit
Professional developers leave comments in their code — short notes explaining why a piece of code does what it does. When you receive AI-generated code, adding your own comments as you read is a useful way to prove to yourself that you understand it.
You don't write comments in Python syntax. You ask Claude: "Add a comment above each section explaining what it does in one sentence." Claude will add the annotations. Then you read the annotated version. If a comment still doesn't make sense, that's your next question.
The BuildChallenge below gives you a small function to read, annotate, and explain. It's the closest thing to practice this skill has — and the skill compounds fast.