CompCode Academy

Lesson 4 of 6 · Free to read

Keep a prompt log and review the diff

Keep a prompt log and review the diff

Audience: Final-year students and engineers in their first three years
Prerequisites: Lessons 1–3
Time: about 20 minutes
What you will keep: a PROMPTS.md file you can show in an interview or a pull request
This lesson does not cover: your team's code review process (follow it where it exists).

Why this matters

Six weeks after a change, someone asks why the code works the way it does. "The AI wrote it" is not an answer anyone accepts. A short trail of what you asked, what you accepted and what you rejected lets you defend the change, and it shows reviewers and interviewers that you were in charge.

Speed without a trail is luck, not skill.

The prompt log

Keep one PROMPTS.md per task or pull request. You do not need every prompt, just the ones that shaped the code. Each entry has five parts:

### 3 · Constrain
**Why:** the AI changed three files when I asked for one fix
**Prompt:** Change only list_tasks in app/main.py. No renames. Output a diff.
**Result:** a two-line diff in list_tasks
**Decision:** accepted, after running pytest (6 passed)

The Decision line matters most. Write accepted, rejected or edited, and one reason. "Rejected: used a function that does not exist in pydantic 2" is worth more than ten accepted entries, because it shows you checked.

Add one entry, even when the AI was not involved, for a moment where you chose not to use AI and why. Reviewers notice.

Reviewing an AI diff

Read the diff, not the chat. The chat says what the AI intended; the diff is what it did. Go through it in this order:

  1. Size. Is it about the size of the change you asked for? If it is much bigger, that is scope creep: reject it and re-brief.
  2. Names. Does every function, method and package exist in the version you have installed? Check anything you do not recognise.
  3. Behaviour. For each changed line, can you say what it does and why? If not, ask the AI to explain that line, then decide.
  4. Edges. What happens with an empty list, a missing field, a date in the past, a very large input? Is there a test for the one most likely to break?
  5. Secrets and side effects. No keys, tokens or passwords in the code. No new network calls, file deletions or config changes you did not ask for.
  6. Proof. Run the tests yourself. Paste the result into the log.

Making a reviewable pull request

When AI helped, make the pull request easy to trust:

  • Keep it small: one change, one reason.
  • Describe what changed and how you tested it, in your own words.
  • Link or attach PROMPTS.md, if your team is happy with that.
  • Point out anything you are unsure about. Saying "please check the timezone handling, I am not certain" is a strength, not a weakness.

Exercise: start your log

Create PROMPTS.md now. Add:

  1. Your mode card from lesson 1.
  2. The fabrication you caught in lesson 3, as an entry with a Decision line.
  3. One sentence for each of the six review steps above, in your own words.

You will add at least six real entries during the lab in the next lesson.

Key points

  • Log the prompts that shaped the code, with a decision and a reason.
  • Review the diff, not the chat.
  • Small, honest pull requests get merged faster.

New free lessons and course updates. Unsubscribe from any email.