Chapter 2. The run-and-verify loop

Learning objectives

  • Explain the relationship between local execution, development servers, and ports, and prepare a newly received repository so that it can be run.
  • Distinguish what problems tests, type checking, linting, and building each catch and what they miss.
  • Read what, where, and why something went wrong from failure output, and choose the first error to inspect.
  • Narrow down the cause of failure by confirming hypotheses one by one.
  • Verify claims of "Done" through browser confirmation and demanding evidence, and state clearly what was not verified.

Introduction

"Fix Done. All tests Pass." When working with coding agents, you see this sentence multiple times a day. However, you cannot know from the sentence alone whether the tests were actually run, whether the tests that ran covered this change, or whether the problem disappeared from the screen as well.

A side-project operator trusted an agent's report and deployed, only to receive inquiries the next morning. All tests had indeed Passed. However, the tests covered only calculation functions, while the fixed bug was on the screen. It was something that could have been known by opening the browser just once.

This chapter covers the technique of turning the statement "it is done" into "evidence that it is done." Starting with where an app runs, it looks in turn at preparing for local execution, the role of each inspection tool, how to read error messages, and the procedure for narrowing down causes. It then covers mechanisms that keep the verification loop running without requiring humans to remember it, browser confirmation, demanding evidence, and organizing context.

Key concepts

Where the app runs: browser, server, storage

Web apps typically run in three places. The user's browser draws the screen and receives button clicks. The server receives requests from the browser, performs calculations, and returns responses. Storage (databases or files) holds data that must remain even after a refresh. In a restaurant analogy, the browser is the dining area, the server is the kitchen, and the database is the pantry.

This distinction is important because the places where errors appear are different from one another.

Where the problem occurred Where the error is seen
Browser (screen code) Console in browser developer tools
Between browser and server (request/response) Network tab in developer tools, server output
Server code Terminal running the development server; server logs after deployment
Database connection Connection errors in server output (e.g., ECONNREFUSED, meaning connection refused; when the database is turned off or the address/port is incorrect)

"It appeared on the screen that it was saved" and "the data was saved" are different facts. Saving is confirmed only by refreshing or opening the app again on another device.

Local execution: development servers and ports

Local execution means running an app on your computer before putting it on the internet. It is like a family tasting event before the grand opening. The program that serves the app is called a development server, and the development server opens a numbered door called a port and waits for requests. http://localhost:3000 means 'Door 3000 on my computer'.

When you encounter an EADDRINUSE (address already in use) error while starting the development server, it means another process is already using that port. Commonly, a previously launched development server is still running in another terminal. The response is to terminate that process or launch the server on a different port. When terminating it, confirm the process ID (PID) using the port (lsof -i :3000 on macOS and Linux) and terminate only that process with kill <PID>. Commands that kill processes in bulk by name pattern are dangerous because they can terminate unrelated programs as well. Because this error is usually an issue of port occupation, it cannot be solved by reinstallation. In rare cases, code or configuration that launches the same server twice is the cause.

Preparing a newly received repository for execution

When you first receive a repository created by someone else, or created by an agent, you may want to type npm run dev right away. However, execution is possible only on top of several preparations. Confirming them in order reduces the time spent wandering.

  1. Read the README and instruction files. This is where execution commands and required preparations are written.
  2. Match the runtime version. If the repository has a version file such as .nvmrc, use that version of Node.js.
  3. Install according to the lockfile. If package-lock.json exists, install the recorded versions exactly as they are with npm ci. The npm documentation explains that this command does not run without a lockfile, halts with an error instead of adjusting discrepancies when contents differ from package.json, and touches neither package.json nor the lockfile.
  4. Fill in environment variables. Look at .env.example to confirm the required names, and put test values into a local file such as .env.local.
  5. Prepare the database. If there is a migration command, run it to create tables.
  6. Start the development server and directly open a key screen.

Errors that appear when skipping these steps are usually predictable. An error stating that environment variables are missing is a signal to revisit step 4, Cannot find module is a signal for step 3, and a database connection refusal is a signal for step 5.

Map of inspection tools

There are several kinds of automated inspections that check code, and what each catches is different.

Tool Analogy Problems caught Problems missed
Test Taste evaluation by a tasting panel Whether expected results are produced for defined inputs Behavior for which no tests were written
Type check Checking blueprint dimensions Types and counts of values passed to functions, use of nonexistent properties Cases where value formats are correct but calculation logic is wrong
Lint Kitchen hygiene checklist Unused variables, dangerous code patterns, rule violations Whether features operate as required
Build Final assembly before grand opening Errors revealed only when bundling for deployment Logic errors that occur during runtime

In TypeScript, commands such as tsc --noEmit are used to perform only type checking without creating executable files. The TypeScript documentation explains noEmit as an option to use TypeScript as a type checker without emitting compile outputs. If you add one required argument to a function, a single type check can find call sites that do not match. However, call sites that bypassed type checking, such as those using any, may be missed.

The key point is that the meaning of 'Pass' differs across tools. Just because tests Pass does not mean that screens not covered by the tests are correct, and just because type checking Passes does not mean that discount rate calculations are correct. Therefore, select inspections that fit the nature of the change, and run lighter inspections first.

Anatomy of an error message

Error messages are not long to intimidate you. They generally tell you three things:

  1. What: The kind of error (TypeError, name of the failed test)
  2. Where: File name and line number
  3. Why: The expected value and actual value, or what was missing
TypeError: Cannot read properties of undefined (reading 'filter')
    at ClassSchedule (src/components/ClassSchedule.tsx:31:18)
    at renderWithHooks (node_modules/react-dom/cjs/react-dom.development.js:15486:18)

The first line means "an attempt was made to use filter on a target that does not yet have a value (undefined)." The stack trace below it lists the functions traversed until the error occurred, starting from the innermost. Lines inside node_modules are libraries made by others, and lines inside src/ are your code. In most cases, you open the topmost line from your code, here line 31 of ClassSchedule.tsx. It is highly likely that an attempt was made to render the list before loading data.

When dozens of errors pour out, look at the very first error first. This is because if a single module cannot be found, cascading errors occur everywhere that uses that module. Fixing the first cause makes most of the errors that follow disappear along with it.

What signals the success or failure of a command most definitively is not the phrasing, but the exit code. An exit code of 0 means success, and a non-zero value means failure. Even if a flood of warnings is printed, if the exit code is 0, the command succeeded; even if the last line is quiet, if it is non-zero, it failed. The exit code of the immediately preceding command is viewed in the terminal with echo $?. In addition, programs usually write results to standard output (stdout) and errors to standard error (stderr) separately. When output is long and passed in full to an agent, sending standard output to a file (>) and combining standard error into the same destination (2>&1), as in npm test > test.log 2>&1, ensures that nothing is missed.

Narrowing down causes from failure output

Finding causes is like detective work. You gather clues, confirm suspects one by one, and do not arrest someone on unconfirmed speculation.

  1. Reproduce. Confirm whether the same failure occurs through the same procedure. If it cannot be reproduced, you cannot know whether it was fixed.
  2. Isolate the stage where the failure occurred. Where to look differs depending on whether it failed during installation, startup, build, or execution.
  3. Pick the earliest relevant error. Put aside cascading errors for now.
  4. Formulate a single hypothesis. Write it as a verifiable statement, such as "This import path has changed."
  5. Confirm only that hypothesis. If you fix multiple places at once, you cannot know what took effect.
  6. Rerun the same inspection after the modification. Confirm with the very command that failed initially.

When handing failures over to an agent, paste All of the output and say, "Fix the cause; do not paper over the error." Claude Code best practices also recommend that when assigning a build failure, paste the original error text and have it confirm success, while instructing it not to suppress errors but to fix the root cause. Representative ways of papering over errors include comments turning off type checking, skipping tests, and adjusting expected values to match actual values. If the expected value matches the requirements, the side that is wrong is the code.

Verification loops and enforcement mechanisms

A verification loop is a flow that repeats fixing, running inspections, and reading results until inspections Pass. If you inform an agent of the inspection commands, it runs this loop on its own; however, a human must mention it each time, and the agent occasionally forgets. Therefore, parts of the loop are anchored with mechanisms.

Mechanism What it does Example
Task instruction Informs of inspections to run for the current task "Run npm test after implementation and show the output"
Instruction file Informs of inspection commands common to all tasks "npm run check when the task is finished"
Hook Runs inspections without exception at designated times Run formatter whenever a file is modified; inspection script before finishing
Required CI check Prevents changes that do not Pass inspections from being merged Test on every pull request; merge button blocked if it fails

The Claude Code documentation explains that hooks, unlike instruction files, operate deterministically to guarantee that the action occurs without fail. For example, a hook attached to the PostToolUse event with an Edit|Write condition runs a formatter immediately after the agent modifies a file with those editing tools. Because it cannot catch files changed by shell commands, inspect once more when finishing to ensure nothing is missed. When this hook is written into the project's .claude/settings.json and committed, the team shares the same hook. In interactive sessions, the hook runs only after approving the folder as trusted, and hooks can also be turned off via settings. Running claude -p in --bare mode, which is recommended for scripts, does not load hooks at all. The Stop hook runs an inspection script when the agent attempts to end its response, making it continue work if it fails. However, according to the documentation, if it is held eight consecutive times without a tool call, it is allowed to finish thereafter; thus, a Pass is not unconditionally guaranteed.

When you turn on "Require status checks to pass before merging" on a protected branch in GitHub, merging into that branch is permitted only when designated required checks end in success (or skipped/neutral). Even if a reviewer forgets, broken changes do not make it in. Under default settings, administrators are exempted from this rule, so to apply it without exception, turn on the option to disallow bypassing as well. In CI (Continuous Integration, a system that runs inspections automatically on every change), dependencies are installed with npm ci. The npm documentation also explains this command as intended for automated environments such as CI.

Confirming in the browser like a user

Tasks that change screens are finished only after confirming them directly in the browser. In Anthropic's long-running agent experiments as well, agents tended to mark tasks as Done without testing features properly; when explicitly instructed to test like a human user with browser automation, they uncovered bugs missed by merely reading code. Claude Code best practices also recommend capturing the resulting screen for screen changes, comparing it with designs, and fixing discrepancies.

When confirming directly, inspect the following:

  • After trying the flow of clicking buttons and entering input through to the end, whether results persist even after refreshing
  • When narrowed to mobile phone width (e.g., 360px), whether anything is clipped or overlapping
  • The states defined in Chapter 1, such as empty data, invalid input, and slow responses
  • Console in developer tools: Whether there are red JavaScript errors
  • Network tab in developer tools: Whether requests were actually sent, and what the status codes of responses were

Status codes summarize the outcome of a response in numbers. The 200s represent success, the 400s represent issues on the request side (invalid input, unauthorized, nonexistent address), and the 500s represent issues on the server side. When pressing a button yields no reaction, look at screen code if there are no requests at all in the Network tab, or look at server output if the request failed with a 500.

Distinguishing claims from evidence

An agent's "Done" is a claim. Evidence consists of executed commands and their raw output, screen captures, and confirmation procedures and results. Claude Code best practices recommend not letting it assert success, but having it show evidence such as test output, executed commands and their results, and resulting screens. This is because reviewing evidence is faster than rerunning verification and also works for unobserved sessions.

A good completion report includes What Was Not Verified along with what was confirmed.

Inspections run: npm test (42 Passed, 0 failed), npx tsc --noEmit (no errors)
Screen confirmation: Attached captures for mobile phone and desktop widths. Confirmed persistence after refresh
What Was Not Verified: Actual SMS sending (in tests, only send logs were confirmed)

Agents working in the same context can repeatedly "confirm" the same mistake. Therefore, the Claude Code documentation introduces a method of having a subagent in a fresh context attempt to refute results, preventing the working agent from grading itself.

Starting fresh when context gets tangled

As seen in Chapter 1, all failed attempts also accumulate in a conversation's context. When fixing the same problem multiple times, a context with accumulated failed approaches invites the same mistakes. Claude Code best practices recommend clearing context with /clear and starting over with more specific instructions incorporating lessons learned if an agent gets the same problem wrong after being corrected more than twice in a single session. A clean session with better instructions is almost always better than a long session with accumulated corrections.

Remember two things before starting fresh. First, even if you clear the conversation, the code on disk remains as is. If changes from failed attempts remain, first decide whether to revert to the last verified commit (Chapter 3). Second, leave a handoff note to pass to the new session. Writing down what was attempted, what failed, and which hypotheses were ruled out prevents walking down the same path again.

If you are reluctant to discard the conversation, summarize it focusing on directed content using /compact <instructions>.

Instruction files are context; blocking is done by hooks

When you write "Do not update snapshots all at once" in an instruction file, agents generally follow it. They generally follow it, but not without fail. The Claude Code documentation explains that Claude treats CLAUDE.md as context rather than hard enforcement. Guidance is also attached stating that if an action must be prevented regardless of Claude's judgment, use a PreToolUse hook. The previously discussed PostToolUse runs immediately after a tool is used, whereas PreToolUse intercepts before the tool executes to block that call.

Suppose a team building a plant rental app wants to prevent bulk snapshot updates under any circumstances. The team attaches a PreToolUse hook to the tool that runs shell commands, making it reject the command if it contains a bulk update option. They do not delete that single line from the instruction file. It remains useful for preventing the agent from taking that path from the start.

There are five handler types that hooks actually execute:

Type What is executed
command Shell command
http HTTP endpoint
mcp_tool MCP tool
prompt LLM prompt
agent Agent

Choose the type based on whether judgment rules can be written down in advance. When the rule is clear, such as "reject if the command contains this option," command is sufficient. prompt and agent delegate judgment back to a model. Therefore, they are suited to reviews requiring context reading rather than strict prohibition rules that must be enforced without exception.

Unattended verification: claude -p and --bare

There are times when an agent must be run even when no one is in front of the terminal. A scheduled job that bumps dependencies and finishes inspections every night is a representative example. In Claude Code, such tasks are executed with claude -p. Earlier documentation introduced this as a separate feature called 'headless mode', but current documentation treats it as a way to use the Agent SDK from the CLI. The same SDK is also used in Python and TypeScript. There are three output formats: text, json, and stream-json. If a script needs to parse results, json is easier to handle.

An option to know first when writing scripts is --bare. With this option attached, Claude Code does not automatically discover and load hooks, skills, plugins, MCP servers, auto-memory, or CLAUDE.md. The documentation recommends this mode for scripts and SDK calls. There is also an advance notice that it will become the default for -p in a future release (as of November 2026 documentation).

Due to this default change, verifications previously entrusted to instruction files or Stop hooks may be omitted. Even if verification is omitted, the command executes to completion, making it difficult to notice that it was missed. Suppose a developer operating a flower shop inventory app alone has claude -p touch synchronization code every night. This developer has trusted that the single line "npm test when finished" in the instruction file takes care of testing. From the day the default changes, that test will not run. Write inspections that must run directly in the prompt. Have whether it Passes determined by exit code by having CI run the inspection separately after the agent invocation finishes.

What automated security scans reveal

Apps built with Lovable have two types of security scans. Quick scan finishes a set bundle of checks in a few seconds and runs automatically on every publish. Deep scan runs only when initiated directly by the user. Compared to the previous enforcement mechanisms table, Quick scan is close to a required check, while Deep scan is close to a task instruction that someone must remember to trigger. On days when sensitive features like payments or member information are attached, run Deep scan directly.

Quick scan warns about tables that lack rules controlling access per record. Documentation cites misconfigured RLS (Row-Level Security, rules determining who can read and write each row) as a common cause of data leaks. The same documentation also notes that while these tools help find common problems, they cannot guarantee complete security. The absence of warnings merely means that nothing was caught by the defined checks, not that the app is secure.

Suppose a warning appeared on the bookings table of a yoga studio reservation app. On September 23, 2026, Lovable revamped the project Security screen. This screen explains what each finding means for the app and users, and groups findings by security domain. Read that explanation before fixing. After fixing the rules, log in alternately with two member accounts to confirm that neither can see the other's bookings, and capture the screen. The scan indicates where to look. Leave evidence that it was fixed through hands-on confirmation.

Going deeper

Passing tests and useful tests

The fact that a test passes is not evidence that the test is useful. A useless test passes even when bugs exist. There are four typical cases.

Useless test Appearance How to confirm
A test that copies the implementation Calculates the expected value the same way as the code Check whether the expected value was derived independently from requirements
An assertion that is too weak Only confirms that "a result exists" Check whether it compares specific values or states
A test that has never failed Passed even before the fix Temporarily revert the fixed code and check whether it fails
A test altered to fit the result Changed the expected value as soon as it failed Look for changes to expected values in test files within the diff

The most powerful confirmation is seeing the failure first. When fixing a bug, write a reproduction test first, and confirm that the test fails before fixing it. Claude Code best practices also cite the example of describing symptoms and directing it to "write a failing reproduction test, then fix it." Only a test that fails before the fix and passes after the fix proves that fix.

A similar trap is batch-updating snapshot tests (tests that store a previous version of a screen or output and compare against it). If failed snapshots are overwritten all at once as the 'new baseline', intended changes and unintended changes become accepted as correct together. Before updating, confirm for each failed snapshot whether it was what this task intended to change.

Tests that fail occasionally

A test that passes sometimes and fails at other times without any code changes is called a flaky test. When running it again makes it pass, one might want to move on, but in most cases there is a real cause.

  1. Tests share state. If they use the same test database or global variables, data left behind by preceding tests corrupts subsequent tests. A representative sign is passing in isolation but failing when running All. Playwright documentation emphasizes that each test must be completely isolated and executed independently to increase reproducibility and prevent cascading failures.
  2. The waiting method is wrong. When a screen element appears late, checking whether it "exists" only once makes the result depend on that exact moment. Playwright's web-first assertions (await expect(locator).toBeVisible()) wait and retry until conditions are met, but checking directly with isVisible() returns the result immediately without waiting. Pausing for a fixed duration still fails in slow environments and wastes time in fast environments.
  3. Relying on external factors. Results vary depending on real external APIs or the current time. In tests, responses and time are kept fixed.

Configuring retries merely masks symptoms and does not eliminate the cause. Because tests that fail occasionally in CI can be fixed only with information from the moment of failure, Playwright documentation guides users to use the trace viewer (a tool that retraces recorded execution steps step-by-step) rather than videos or screenshots for analyzing CI failures, and to configure it to retain traces on the first retry of a failed test.

When results differ between my computer and elsewhere

"It works on my machine" is the oldest joke in software development. When results differ, differences between the two environments are the cause. The difference is usually one of the following.

Difference Example How to align
Runtime version The major version of Node.js differs between my computer and CI Maintain a version file and ensure both sides use the same version
Installed dependencies A different minor version was installed via npm install Commit the lockfile and use npm ci in CI
Environment variables Values exist only in local files on my computer Document required names and include them in CI and deployment configurations as well
Operating system Unless a case-sensitive format is explicitly chosen, macOS APFS does not distinguish case in file names, whereas Linux does Match the casing of import paths exactly to the actual file names
Execution method Verified only on the development server without running a production build Run the build command locally before deployment as well

Environment variables have particularly many pitfalls. According to Next.js documentation, the rule is to exclude .env*.local files from the repository via .gitignore, and the test environment (NODE_ENV=test) does not read .env.local. This is designed so that everyone's tests produce identical results; if a test relies on values in my .env.local, failing elsewhere is expected behavior.

The same applies to performance. Because development servers execute code differently from production builds, measurements before and after a fix must be taken under identical conditions close to deployment for a valid comparison.

At work

Salt Bread Bakery: 9:00 AM that does not save

A customer reported on the reservation app of 'Salt Bread Bakery', a neighborhood bakery, that "selecting a reservation time does not save." Before fixing it, Minjae, the operator, reproduced the symptom first. Selecting afternoon time slots saved successfully, but selecting 9:00 AM resulted in nothing happening even when pressing the save button. The developer tools console was silent, and the network tab had a record of a request going out and returning with a 400. It was an issue with the request content, not the screen.

Passing the reproduction procedure to the agent, Minjae said, "Add a test that catches this symptom first, and show me that it fails before fixing it." The agent immediately proposed fixing the format validation code, but Minjae refused. Without seeing the failure first, he could not trust a Pass after the fix. The test failed as expected, and the output printed Expected: "09:00" / Received: "9:00". The leading zero of the time string was missing, tripping the server's format validation.

When the agent fixed the function that creates the time, the new test passed. The agent reported "Done", but Minjae did not stop there. He ran All tests and type checks, selected 9:00 AM in the browser to save, and saw in the network tab that the request succeeded with 200 and that the reservation remained even after refreshing. Only then did he commit.

Because there was reproduction, a test could be written; because the failure before the fix was observed, that test could be trusted; and because there was browser confirmation, it was possible to state that the symptom had disappeared.

Green Star Botanical Garden: In front of 47 errors

Jiho, Green Star Botanical Garden's developer who operated a plant management app for members, tasked the agent with organizing scattered plant helper functions into the src/lib/plants/ folder. After the work, running npm run build unleashed 47 errors.

The agent proposed two options. One was to add comments skipping type checking on every line where an error occurred, and the other was to revert the folder reorganization entirely. Jiho rejected both. This was because the first option would merely cover up the errors while leaving the cause intact, and the second option would discard even the requested reorganization work.

Jiho read the output from the beginning. The very first error was Cannot find module '@/lib/plant-utils' in src/app/watering/page.tsx. Most of the subsequent errors appeared to be cascading errors in every file using functions and types imported from this module because they could not be found. Jiho formed a single hypothesis: "There are still files importing the old path." He then tasked the agent with confirming only that hypothesis.

Find all files that import the old path '@/lib/plant-utils' and replace them with the new path.
Do not change any other code. After changing them, run npm run build again and show the entire output.

In the rerun build, the errors were reduced to two. The remaining two had a different cause. During the reorganization process, the watering calculation function had been modified to take an additional season value, but the two call sites remained in the old way. Jiho evaluated whether this change was within the requested scope. Since he had only assigned folder reorganization, changing the function's signature was out of scope. Having the agent restore the function to its original shape allowed the build to pass.

Jiho then ran type checks and tests, and opened the watering schedule screen in the browser to confirm that dates were the same as before. The 47 errors stemmed from two causes. Thanks to starting from the first error and confirming hypotheses one by one, he was able to fix them without covering them up or discarding the work.

Common mistakes

  1. "The test passed, so we are done." A Pass looks like the end. However, tests only confirm the scope they cover. If the screen was changed but there are no screen tests, it is not done before browser confirmation.
  2. "For a failing test, you just need to fix the expected value." It is fast because it only requires changing a single number. However, if the expected value matches the requirements, the code is what is wrong. When an agent suggests modifying or skipping a test is the moment requiring the greatest caution.
  3. "If running it again passes, it is fine." When a rerun passes, it brings relief. However, failing occasionally usually has causes such as shared state or improper waiting, and failing with the same value every time is a logic error. Rerunning cannot substitute for root cause analysis.
  4. "If there are many errors, there are many problems." When the number is large, it can look daunting. However, dozens of errors often cascade from a single cause. Look at the very first error.
  5. "The agent said it was certain." A confident report inspires trust. But confidence is not evidence. Demand evidence such as commands, output, and screens, and ask what What Was Not Verified is.
  6. "If you clear the conversation, the work also resets to the beginning." A new session feels like a fresh start. However, even if the context is cleared, code changes on disk remain. Whether to revert is decided separately with Git.

Summary at a glance

Topic What to remember
Where errors live Screens in the console, requests in the Network tab, servers in the terminal and logs
Port conflicts EADDRINUSE means someone is already using the port. Check the PID and shut down only that process
First run README → runtime version → npm ci → environment variables → migrations → run
Verification tools Tests check behavior, types check format, linters check patterns, builds assemble for deployment
Reading errors What, where, and why. The topmost line of your own code, the very first error, exit codes
Narrowing down causes Reproduce → isolate the stage → first error → single hypothesis → confirm → rerun the same check
Enforcement mechanisms In order of strength: instructions < guidelines files < hooks < required CI checks
Browser All flows, narrow screens, persistence after refresh, console and status codes
Evidence Commands and raw output, captures, even What Was Not Verified
Managing context If corrections fail more than twice, use /clear and better instructions. Revert code separately

Check the official docs

Self-check

2-1. When starting the development server, Error: listen EADDRINUSE: address already in use :::5173 appeared. What does this mean, and how do you respond? Also name one method that should be avoided when responding.

2-2. The agent reported "Test execution result: 0 failures." Opening the output revealed Tests: 0 passed, 0 total. What is the reason this result must not be accepted as a Pass, and what is the first cause to suspect?

2-3. There is no reaction even when clicking the 'Send' button on the inquiry form. What do you look for in the browser developer tools' Console and Network tabs, respectively, and how do you isolate the location of the problem based on the results?

2-4. In the following output, which file and line should you open first, and what is the reason?

TypeError: Cannot read properties of null (reading 'price')
    at sumLines (src/checkout/summary.ts:47:12)
    at OrderPanel (src/components/OrderPanel.tsx:18:9)
    at renderWithHooks (node_modules/react-dom/cjs/react-dom.development.js:15486:18)

2-5. Dozens of lines of yellow warnings were printed in the build command output, and there is no error message on the last line. What is the most definitive way to confirm whether this command succeeded?

2-6. While fixing a discount calculation bug, the agent added a new test, and that test passes. Explain a simple way to confirm that this test actually catches that bug.

2-7. An app that worked fine on a MacBook fails only in CI running on Linux with Module not found: Can't resolve './components/header'. The actual file name is Header.tsx. What is the cause, and how do you fix it?

Hands-on tasks

Exercise

A full cycle with failure output (45 minutes)

  1. In a practice app, intentionally introduce a bug into a function (e.g., omitting the last item from a sum).
  2. Write a test that catches that bug first, and directly confirm that it fails.
  3. Write down what, where, and why from the failure output on paper.
  4. Paste All output to the agent and assign: "Fix the cause, do not change the tests, and show All test output and the exit code."
  5. Temporarily revert the fixed code, confirm that the test fails again, and then restore it.

Done when: The cause written down matches the location fixed by the agent, both the failure output before the fix and the Pass output (exit code 0) after the fix remain together, and there are no changes to the test file.

Exercise

Locking verification into mechanisms (50 minutes)

  1. In a guidelines file, write a one-line check command to run at the end of work (e.g., npm run check).
  2. Configure the hook feature of your tool so that a formatter or linter runs whenever a file is modified, and commit that configuration file to the repository (in Claude Code, PostToolUse in .claude/settings.json).
  3. Assign a small screen change to the agent, then confirm traces that the hook actually ran.
  4. View the results in a browser at mobile width and desktop width, and record whether there are errors in the console and the status codes of network requests.
  5. Organize the Done report into three columns: 'Tests Run, Screen Verification, What Was Not Verified'.

Done when: Committed hook configurations exist, records remain showing that the hook ran even though the agent was not separately instructed to do so, and in the three-column Done report, the 'What Was Not Verified' column is not empty or states the reason why it is empty.