Sub topic 10
Steering with Specific, Bounded Feedback
This chapter assumes you can read a Git diff, run your project's tests from the command line, and have used a coding agent at least once. It covers what to say after you have reviewed a change and found problems. By this point you have a clean baseline, a triaged diff, and a list of defects. The next step is turning that list into an instruction the agent can act on without making things worse.
Why vague feedback fails
An agent has no memory of your review. It sees your message, the files it can read, and the conversation so far. Feedback such as "this isn't right, try again" gives it nothing to aim at. The agent will guess what is wrong, and a guess often touches code that was already correct.
Three failure patterns follow from vague feedback:
- Regression of accepted work. The agent rewrites files you had already approved, because it cannot tell which parts were fine.
- Cosmetic changes. The agent adjusts naming or formatting to look responsive, while the real defect stays.
- New scope creep. The agent "improves" nearby code to compensate, which enlarges the diff you must review again.
Good feedback has four parts. Each one closes off one of these patterns.
| Part | What it does | Example |
|---|---|---|
| Confirm what is acceptable | Protects work you approved | "The change to `src/config/loader.py` is correct." |
| Name each problem with its file | Removes guessing | "`tests/test_loader.py` now skips `test_missing_file`." |
| Bound the next edit | Prevents scope creep | "Do not change any other files." |
| Ask for a verifiable report | Replaces a vague summary with evidence | "Report the exact command and its result." |
A worked example
Suppose you asked an agent to rename the config loader on the branch agent/rename-config-loader. Review shows two defects. The agent edited src/billing/invoice.py, which has nothing to do with the rename. It also marked test_missing_file as skipped, because the test failed after the rename.
This message addresses both:
The change to src/config/loader.py is correct. Two problems remain:
1. You edited src/billing/invoice.py, which is outside this task. Revert that file.
2. tests/test_loader.py now skips test_missing_file. Restore the test and fix the code so it passes.
Do not change any other files. When finished, run the project's test suite and report the exact command and its result.Compare it with "Fix the problems in your last change." The second version leaves the agent to rediscover the two defects, and it gives no limit on what it may touch.
Order the problems by importance
Number the problems, and put the ones that change behavior or weaken checks first. An agent that works through a list top to bottom will usually finish the early items. If you must choose, a silenced test matters more than a stray formatting change.
Say what the fix must be, not only what is wrong
Compare these two statements about the skipped test:
- "The skipped test is a problem."
- "Restore the test and fix the code so it passes."
The first allows the agent to delete the test or loosen its assertions, which hides the problem again. The second states the acceptable outcome. When the right fix is not obvious, say which side must change. For example: "The test is correct. The code is wrong."
Bounding the next edit
A bound is a limit on where the agent may work. Without one, every correction is an invitation to change more files.
Useful bounds include:
- A file list. "Only edit
src/config/loader.pyandtests/test_loader.py." - A prohibition. "Do not modify anything under
src/billing/." - A size limit. "Keep the change under 30 lines."
- A behavior limit. "Do not change any public function signature."
You can then check the bound mechanically. After the agent's second pass, list what changed since your last review point:
git status --short
git diff --name-status
git diff --statIf the output shows a file outside the bound, the agent broke the instruction. That is a clear signal, and it is faster than reading every hunk again.
Review corrections as a separate step
Commit what you accepted before sending feedback. Then the next diff contains only the agent's correction.
git add -p
git commit -m "Rename config loader (reviewed agent changes)"With the accepted work committed, git diff after the correction shows only the new edits. You no longer need to reread the whole change set. If the agent undoes something you accepted, it will appear in the diff as a reversal of a committed line, which is easy to spot.
Asking for evidence, not reassurance
Agents often end a run with a confident summary such as "All tests pass." That statement is a claim, not a result. Ask for the command and its output so you can compare it with your own run.
Good requests for a report:
- "Run
pytest -qand paste the final summary line." - "List every file you changed, and say why for each."
- "State anything you did not verify."
The last request is useful because it makes unverified areas visible. You still run the checks yourself, as the previous chapter described. The report tells you where the agent believes the risk lies, and a mismatch between its list of changed files and git status --short tells you the summary cannot be trusted.
Handling the agent's pushback and drift
Sometimes the agent disagrees with your correction, or it complies in a way that creates new problems. Common cases:
- The agent argues the test is wrong. Check. Sometimes it is right, because the old test encoded behavior the rename changed on purpose. Decide, then state the decision explicitly. Do not leave it open.
- The agent fixes one problem and reintroduces another. Repeat the bounded feedback, and name the regression with the file and line.
- The agent claims it reverted a file but did not. Check with
git diff --name-only. Do not rely on its words. - The agent apologizes and repeats the same mistake. This is a sign that the instruction is not reaching it, or that the task is too large. See the later chapter on escalation.
Feedback that carries context
The agent works from the conversation, so include the facts it needs. Paste the failing output instead of describing it:
After your change, this test fails:
FAILED tests/test_loader.py::test_missing_file - AttributeError: 'NoneType' object has no attribute 'read'
The loader returns None when the file is missing. The original code raised FileNotFoundError. Restore that behavior.This message has the test name, the error, the cause you found, and the required behavior. The agent can fix the code without searching.
One round, one theme
If you have many unrelated defects, consider sending them in separate rounds. A message that mixes a design disagreement, a test problem, and a style nit makes the response harder to review. Group by theme, and handle the defects that affect correctness first.
The feedback cycle
The loop below shows where feedback fits. It ends when the verification passes or when you decide to stop steering.
Common mistakes when giving feedback
- Mixing approval and criticism without saying which is which. The agent may revert good code to be safe.
- Leaving out the "do not change" clause. Agents tend to keep working until the prompt is silent on a topic.
- Asking for a fix and a refactor in the same message. Keep corrections small.
- Accepting "done" without a command. Always ask for the exact command that was run.
- Repeating the same message louder. If the first message failed, change its content. Add the file, the output, or the bound that was missing.
Exercises
Exercise
An agent renamed a function across your project. Review found that it also reformatted src/utils/dates.py, and a test in tests/test_api.py now uses a weaker assertion (assert result instead of assert result == expected). The rename itself is correct everywhere else. Write a corrective message that follows the four parts of good feedback.
Show answer
Example answer: "The function rename is correct in all files except for the two problems below. 1. You reformatted src/utils/dates.py, which is outside this task. Revert that file. 2. tests/test_api.py now asserts only assert result. Restore the original assert result == expected and fix the code if it fails. Do not change any other files. When finished, run the project's test suite and report the exact command and its result." The message confirms accepted work, names both problems with their files, bounds the edit, and asks for a verifiable report.
Exercise
After sending your correction, you run git diff --name-status and see a modified file you never mentioned. What should you do, and why is this check better than rereading the full diff?
Show answer
Treat the file as out of bounds. Revert it (for example with git restore <file>) or ask the agent to revert it, and then re-run the check. The check is better because the bound was a file list, so a file name outside the list is a mechanical signal that takes seconds to see. Rereading every hunk is slower and can miss a small unrelated edit.
Exercise
The agent says "I reverted src/billing/invoice.py and all tests pass." Which two commands would you run before believing it?
Show answer
Run git diff --name-only (or git status --short) to confirm that src/billing/invoice.py no longer appears as changed, and run the project's test suite yourself, for example pytest -q, to see the result directly instead of relying on the agent's summary.