Quiz: How AI Coding Agents Work and Fail¶
Test your understanding of models, context windows, agent harnesses, the ways agents fail and how to direct them with these review questions.
1. What is a context window?¶
- The window in the editor where the agent shows its changes
- The time limit on how long an agent session may run
- The list of files the agent is allowed to edit
- The largest amount of text, counted in tokens, that a model can take in at one time
Show Answer
The correct answer is D. The context window holds everything the model can use in a session: your messages, its replies, every file it has read and every command output it has seen. When a session grows past it, something has to go. Even inside it, models attend best to the start and end, as the "Lost in the Middle" study found. The other options describe an editor pane, a timeout and a permission setting.
Concept Tested: Context Window
2. What is a project instruction file such as CLAUDE.md or AGENTS.md?¶
- A log the agent writes of every command it ran
- A plain text file in the project that the harness reads at the start of every session
- A settings file that decides which model the agent uses
- A file of test results the agent pastes after each task
Show Answer
The correct answer is B. The harness loads the project instruction file into the context window before you type anything, so its rules are present in every session. It holds what the app is, how to run and test it, the conventions, and the product rules that must never break. It is the note on the fridge in the house-sitter story. It isn't a command log, a model setting or a test report.
Concept Tested: Project Instruction File
3. Why does token cost grow faster than the number of steps in a long agent session?¶
- Each step rereads the whole conversation so far, so later steps read more tokens than earlier ones
- Providers raise the price per token after the first hour
- The agent writes longer answers when it gets tired
- Every tool call is billed as a separate session
Show Answer
The correct answer is A. Each time the agent takes a step, the model reads the whole context, not just the newest message. Fifty steps at 100,000 tokens each is five million input tokens. That's why starting a fresh session for a fresh task saves money as well as attention. Providers don't raise prices mid-session (B), models don't tire (C), and tool calls aren't separate sessions (D).
Concept Tested: Token Cost
See: Token Cost
4. Early in a long session the builder types, "A check that didn't run is never counted as passed." Two hours later the agent adds a timeout to another adapter that returns "passed" when the timeout fires. What failure is this?¶
- Hallucination
- Scope creep in a diff
- Context drift
- Vibe coding
Show Answer
The correct answer is C. Context drift is when a rule given early fades as the session fills, the way the house-sitter forgot the back door. The rule may have been summarized away when the window filled, or got less attention in the middle of a long context. A hallucination invents something (A). Scope creep changes more than asked (B). Vibe coding is the builder's way of working, not an agent failure. The defense is to keep the rule in the project instruction file, which loads every session.
Concept Tested: Context Drift
See: Context Drift
5. What separates an AI coding agent from a chat assistant?¶
- The agent uses a smarter model
- The agent never makes mistakes because it runs tests
- The agent remembers past sessions on its own
- The agent wraps a model in a loop with tools, so it can read, edit, run and check on its own
Show Answer
The correct answer is D. A chat assistant hands you code and stops. An agent's harness lets the model request tools, runs them, feeds the results back, and repeats until the task is done. The model can be the same in both (A). Agents still make mistakes, though the loop helps them catch some (B). Anything an agent seems to remember is stored in files the harness loads, not in the model (C).
Concept Tested: AI Coding Agent
See: From Model to Agent
6. When is vibe coding a reasonable way to work?¶
- When changing how the app checks who may see a scan
- When building a weekend prototype or a first draft of a results page
- When writing a database migration on the live database
- When wiring the payment webhook
Show Answer
The correct answer is B. Vibe coding means accepting what the agent produces without reading it, judged only by whether the app seems to work. That's fine for a two-way door, where a mistake is cheap to see and fix. Access checks, live migrations and payment webhooks are must-be-right parts. A mistake there can look fine on screen while it hurts members or loses money.
Concept Tested: Vibe Coding
See: Vibe Coding
7. Your agent says, "All tests pass." What is the better follow-up?¶
- "Great, ship it."
- "Are you sure?"
- "Paste the test output, and show me the test that proves a timed-out check is marked not checked."
- "Run the tests again and tell me if they still pass."
Show Answer
The correct answer is C. A model sounds equally sure when it's wrong, so ask for evidence instead of conclusions. Pasted output shows what ran, and naming the test that proves a product rule shows whether the rule is covered at all. "Are you sure?" (B) invites another confident yes. Running again (D) still returns a claim, not evidence. Shipping on the claim (A) skips the check entirely.
Concept Tested: Confident Wrong Answers
8. You are setting agent permissions. Which action should need your approval every time?¶
- Running a database migration
- Reading a file in the codebase
- Searching the codebase for a word
- Running the test suite on your laptop
Show Answer
The correct answer is A. Set permissions by the door each action opens. A migration can change or delete live data, which is a one-way door, so it needs your approval each time. Reading files and searching the codebase change nothing, so let them run. Running tests locally is also low risk. The sample instruction file in the chapter lists migrations under "Ask before you" for the same reason.
Concept Tested: Agent Permissions
See: Agent Permissions
9. The agent's plan for a ninth check includes "Update the score calculation to include the ninth check." Why is that the step to question?¶
- Adding an adapter is always risky, but scoring is not
- Changing how the score is calculated touches a must-be-right part and could change what scores mean to members
- The score calculation can't be tested
- Plans shouldn't mention scoring at all
Show Answer
The correct answer is B. The score is what members act on. Changing how it's calculated is a two-way door for future scans but a one-way door for members who already acted on an old score. Before approving, the builder can ask the agent to show how the scores of a few known scans would change. Adapters follow a known pattern, so A has it backward. Scoring can and should be tested (C). Plans should name scoring changes so you can catch them early (D).
Concept Tested: Plan Before Code
10. The author built a research prototype that passed its tests but read about 27 million tokens in an afternoon. What does this show about apps that call AI models?¶
- Tests that pass prove an app's costs are under control
- Cheaper models would have prevented the problem on their own
- Every model call in an app needs limits on tokens, steps and time, because passing tests don't check cost
- Research tools should never use AI models
Show Answer
The correct answer is C. Nothing in the code was broken. The tests checked that the tool produced a report, and it did. A loop of 300 calls with 90,000 tokens each reads 27 million tokens without any test failing. The fix is limits on tokens, steps and time for every model call. Option A is the trap the story shows. A cheaper model lowers the price but not the runaway loop (B). Option D overreacts.
Concept Tested: Token Cost