AI Learning Hub › Learn AI › Self-Paced Courses › VS Code: Files, Changes, and AI Agents › See What Changed

Module 6 · Beginner to intermediate

See What Changed

Three places the editor reports a change, and how to read a diff line by line — including the changes a finished page looks perfectly fine about.

By the end

  • Find a file’s change state in the Explorer, the editor gutter and the Source Control view
  • Say what the letters M and U mean
  • Read a diff line by line and name what was added, removed and modified
  • Explain why a correct-looking result does not establish a correct change
  • Find a change nobody asked for

This is the module the rest of the course exists for. Everything before it was orientation; everything after it is what you do once you can read a change.

The skill is narrow and transfers everywhere. Given a file that is different from how it was, you want to be able to say precisely what is different — not approximately, not from memory, and not from somebody’s summary of their own work.

The editor tells you three times

Before you open anything called a diff, VS Code has already reported that something changed, in three places at once.

The Explorer in a VS Code window. The file draft.md has the letter U beside its name. The file index.html has the letter M beside its name. Three other files have no letter. The Source Control icon in the strip of icons on the left carries a small badge showing the number 2. Along the bottom of the window the branch name main is followed by an asterisk.
Change state reported in the file tree, on the Source Control icon, and in the status strip — without any Git view being open. VS Code 1.142.0, macOS, October 2026. Open full-size image: the Explorer showing a file marked U, a file marked M, and a count badge of 2 on the Source Control icon (opens in a new tab)

Beside two of the file names there is a letter. M means modified — Git was already tracking this file and its contents have changed. U means untracked — Git can see the file but it is not part of the recorded history, usually because it is new.

The icon in the Activity Bar carries a count of how many files are in one of those states, and the status strip at the bottom shows the branch name with an asterisk after it, which is Git’s way of saying there is uncommitted work here.

The letters matter more than the colors. VS Code tints these as well, and the tinting is genuinely useful, but the letters are what you should read and what this course will always name. Color is a second channel, not the message.

A few Git words, kept short

You will meet five terms and need only enough of each to read the interface. GitHub Without the Jargon teaches the model properly; this is the vocabulary needed to make sense of what is on screen.

Modified
A file Git is tracking has changed since the last recorded version.
Untracked
Git can see the file but has never recorded it. New files start here.
Staged
A change you have selected to go into the next commit. Editing a file does not stage it.
Commit
A recorded snapshot of the changes you staged, with a message saying what they were.
Branch
A line of work. The name in the status strip tells you which one you are on.

The Source Control view

Open it with View: Show Source Control from the Command Palette. This is where every changed file is listed in one place.

The Source Control view in the Primary Side Bar. At the top is a box for a commit message and a Commit button. Below them a group headed Changes carries the number 2 and lists two files: draft.md marked U, and index.html marked M. The index.html row shows three small action icons. Lower down, a section headed Graph shows a single earlier commit on the branch main.
Two changed files under a single Changes heading. There is no Staged Changes group yet, because nothing has been staged. VS Code 1.142.0, macOS, October 2026. Open full-size image: the Source Control view listing two changed files under a Changes heading (opens in a new tab)

Microsoft’s documentation describes the split this view can show: select a file under Changes “to review unstaged edits, or in Staged Changes to review what the next commit will contain.” In the screenshot there is only one group, because nothing has been staged. Module 7 is about that second group and the decision it represents.

Reading a diff

A diff is a view of one file in two states at once: how it was, and how it is now. VS Code marks removed lines with a minus and added lines with a plus, and numbers them in two columns so you can see where each version sat.

Here is the one that matters. Someone was asked to correct a room number on the event page from 180 to 290. Here is what they actually did.

A diff editor comparing a committed version of index.html with the current one. Two lines are marked with a minus sign as removed. The first removed line is a paragraph reading Thursday, November 12, Room 180, with the digits 180 highlighted. The second removed line is a paragraph about the evening of fictional oral argument that ends with a closing paragraph tag. Three lines are marked with a plus sign as added. The first is the same Thursday paragraph but reading Room 290, with the digits 290 highlighted. The second is the oral argument paragraph with no closing tag at the end. The third contains only the closing paragraph tag on a line of its own.
Two lines removed, three added. The room number changed as asked. So did something nobody asked about. VS Code 1.142.0, macOS, October 2026, on the course practice project. Open full-size image: a diff showing a room number change and a displaced closing paragraph tag (opens in a new tab)

Work through it slowly, because the pattern repeats everywhere.

The first removed line and the first added line are the same sentence with one difference: Room 180 became Room 290. VS Code highlights the digits within the line, so you can see that the rest of the sentence is untouched. That is the change that was requested, and it is correct.

The second removed line is the paragraph about the evening of oral argument, ending with its closing </p> tag. The second and third added lines are the same sentence — but the closing tag has moved onto a line of its own. Nothing was added to the page and nothing was deleted from it. A tag simply relocated.

This is why a modified line shows up as a removal plus an addition rather than as an edit in place. A diff does not describe intentions; it reports which lines are no longer there and which lines are new.

What the finished page does not tell you

Open the page in a browser after that change and it looks completely correct. The room number is right, the paragraph reads normally, the layout is unchanged. In HTML, a closing tag on its own line renders identically.

So the result passes inspection and the change still contains something nobody asked for. A working page tells you what the output looks like. A diff tells you what was altered to produce it. Those answer different questions, and only the second one tells you whether the work matches the request.

Whether that stray tag matters is a judgment call, and reasonable people land differently. It may be harmless tidying. It may be the visible edge of an agent rewriting more of the file than you expected. The point of this module is not that the change is wrong — it is that you got to decide, because you read the diff.

Why this gets harder with an agent

When you make a change yourself, you have a memory of it. You know you touched one line, because you were there. That memory is doing more work than people realize, and an agent’s edit gives you none of it.

What you get instead is a summary: I updated the room number. That is usually true and almost never complete. It is a claim about the diff, and the diff is sitting right there.

Exercise: read a change you did not make

If you did the Module 4 exercise, your practice project already has a modified file. If not, open index.html, change the room number to 290, and save.

  1. Open View: Show Source Control. How many files are listed, and what letter does each carry?
  2. Open index.html in the editor and look at the left margin beside the line numbers. The changed lines are marked there too.
  3. Open the diff for that file by selecting it in the Source Control list.
  4. Write down, in your own words, one line per change: what was removed, what was added, and which parts of each line differ.
  5. Open index.html in a browser. Does the page look wrong in any way?
How to be sure you are looking at a diff

The tab tells you. A diff tab is labeled with the file name followed by (Working Tree) — index.html (Working Tree) — and the editor shows two columns of line numbers. A plain file tab carries just the name and one column.

If you would rather use a command than the list, open the Command Palette and run Git: Open Changes with the file open. One thing to watch: the first match offered is usually Git: Open All Changes, which is a different command. The one you want is the entry named git.openChange, a line or two below it.

The last step is the one to sit with. The page was fine. The change still deserved reading. That gap is the reason this module is the longest one in the course, and it is the entire premise of the capstone.