AI Learning Hub › Learn AI › Self-Paced Courses › VS Code: Files, Changes, and AI Agents › Work with Files, and Find Things
Module 4 ยท Beginner
Work with Files, and Find Things
Creating, renaming and deleting in the Explorer are real operations on real files. Searching the whole project is how you find out what else a change would touch.
By the end
- Create, rename and delete files from the Explorer, knowing these act on disk
- Tell find-in-this-file apart from search-across-the-project
- Use project search to find out what else a change would touch
- Open a Markdown file’s rendered preview
This is the shortest module in the course, and it exists for one habit: before you change something that appears in more than one place, find out where else it appears.
File operations are filesystem operations
The Explorer’s context menu gives you the operations you would expect — new file, new folder, rename, delete — plus one that is useful for staying oriented, which reveals the file in Finder or File Explorer. Open it by right-clicking a file, or from the keyboard with the context-menu key.
Module 2 made the point and it bears one repetition, because it is the thing people get wrong in both directions. These are real operations on real files. A file you create exists on disk immediately, before you type anything into it or save. A file you delete is gone from the folder, and recovering it is your operating system’s job rather than the editor’s.
Saving is worth a sentence of its own. VS Code marks an edited file with a dot in its tab until you save it, and some projects turn on automatic saving. If you have changed a file and something downstream — a browser preview, a command, an agent — still sees the old version, an unsaved file is the first thing to check.
Two different kinds of find
There are two search tools and people reach for the wrong one constantly.
- Find in this file
- Searches the file you are looking at. Good for jumping to a line. It knows nothing about the rest of the project.
- Search across the project
- Searches every file in the open folder and groups the results by file. This is the one that answers “where else does this appear?”
Reach the second through the Command Palette with View: Show Search, or from the magnifying-glass icon in the Activity Bar.
The count at the top is the part to read. “Two results in one file” and “two results in two files” mean quite different things for a change you are about to make.
A small practical thing: Markdown preview
Files ending in .md are Markdown — plain text with light formatting marks. READMEs are Markdown, and so are the instruction files that some AI tools read, which Module 8 comes to. VS Code can show you a rendered version beside the source: open the Command Palette and run Markdown: Open Preview to the Side.
That is the whole feature. It is here because otherwise learners read ## Files as a typo rather than as a heading.
Exercise: find out what a change would touch
The practice project mentions a room number in more than one place, which is exactly the situation where changing the obvious one is not enough.
- Open the practice folder and run a project search for
180. - Write down how many files contain it, and which ones, before changing anything.
- Open
index.htmland change the room number from 180 to 290. Save the file. - Run the same search again.
- Answer: is the project now consistent, or is there still an occurrence somewhere that says something different?
What you should have found
The number appears in index.html, in notes.md, and in assets/room-info.txt. Editing the page alone leaves the two note files describing the old room, so the project is now internally inconsistent even though the page looks right.
Whether that matters depends on what the notes are for — and that is a judgment, not something search can make for you. What search did was make sure you got to make it. Having changed one file without looking, you would not have known there was a decision to take.
This is the habit the rest of the course builds on. An agent asked to “fix the room number” faces exactly the same question, and may answer it differently than you would. Knowing where a string lives is how you check.
Leave the project as it is. Module 6 picks up the change you just made and looks at it from a different angle.