Automation & Agents
After-the-Move Cleanup Checklist: What to Fix, What to Leave Alone, and When It's Safe to Delete
Finishing a move is not about carrying the files over. It is about turning every finger that still points at the old place, then taking the signpost down. Fix the generators first, clean the existing files next, always run one more full scan, and look for live pointers before you delete.
The one idea that matters
Classify first, then touch anything.
Old paths left over after a move are not all the same. There are three kinds, and each needs different handling:
| Type | Example | What to do |
|---|---|---|
| Live guidance | “Check progress in old-path/status.md”, how-to notes, file locations in a project map |
Must fix — someone will follow it |
| Generators | Document templates, default paths in scripts, config templates | Fix first — they keep copying the error out |
| Historical narrative | “We originally put X in old-path/, then moved it to Y” |
Do not touch — changing it rewrites the record |
The classic beginner mistake is a global search-and-replace that also rewrites the history, turning it into “we originally put X in the new path,” which is no longer history. The second most common mistake is cleaning symptoms without shutting down the production line: every file is fixed, the template still has the old path, and the next new file brings the error back.
Why a redirect stub becomes a dead signpost
Many people leave a “moved, new location is here” note as a transition, then forget it. Its value only goes down:
- Right after the move: it guides you, highest value.
- A while later: everyone knows the new location, so it just adds one extra hop.
- After a second move: the “new location” it points to has moved too. It is now a signpost to a place that does not exist.
Stage three is worse than having no redirect at all. Without one you go look for the thing yourself. With a wrong one you follow it and arrive at nothing. And no mechanism will ever tell you it has gone stale.
Step by step
Step 1: Inventory first, do not edit yet
Search the whole project for the old path string and list the results. If you code, grep -rn "old-path" . works. If not, the global search in VS Code, Obsidian, or Notepad++ does the same job. Look, do not change. The output is a table of which files, which lines, and which of the three types each one is.
Step 2: Exclude historical archives
Logs, backups, and old snapshots stay out entirely. They record a past state and should keep their original form. Exclude those folders from the search up front so you cannot slip.
Step 3: Fix the “generators” first to stop the bleeding
In what is left, find the template-type files and fix them first. The test: “Will this file’s content be copied into newly created files?” If yes, it is a generator. Finish this step before moving on, or you will clean and regenerate at the same time.
Step 4: Batch-replace the existing files
Use batch tools for the clear-cut cases; doing it by hand is fine too, but go longest path first. If you are changing both old-folder/sub/ and old-folder/, do the long one first. The reverse order breaks the long one.
Step 5: Scan everything again (the most important step)
Do not trust the batch tool’s output. It tells you what it changed, not what it missed. Re-run the Step 1 search. It usually surfaces stragglers that the batch rule could not catch, and they share one trait: the path is embedded inside something else.
- A hardcoded absolute path that looks different from the relative one you searched for
- A path buried inside an instruction string that a person will copy and run, the most damaging kind
- Leftovers from an earlier move: you thought there was one wave, there were two
Step 6: Verify the new paths actually exist
For every path you rewrote, confirm the file or folder is really there. Do not only verify that the old path is gone; verify that the new path is reachable. They are not the same check — you may have rewritten it to another place that does not exist either.
Step 7: Checklist before deleting a redirect stub
- Does it hold unique information? If its mapping table is more complete than your official reference, copy the missing rows over first.
- Who still points at it? This is the key one. Search beyond this project: config files, startup scripts, other projects, bookmarks, permission settings, scheduled tasks.
- Does any automation read it? Schedulers, CI, sync tools.
- Is the official reference updated? Once the stub is gone, that reference is the only conversion table left.
Delete only after all four are confirmed. A note on order: the key prerequisite is finding out who depends on it, not making a backup. Stubs rarely hold unique content, so a backup means little. What actually bites is a config file you forgot that still points at it.
Step 8: Put a teardown date on your to-do list
If you left a new redirect this time too, write its teardown date into your to-do list right now. A transition plan without a teardown date is a permanent plan.
Traps you will hit
Trap 1: Global replace rewrote the history too
A log says “we put the config in A, then moved it to B.” After the replace it reads “we put it in B, then moved it to B” — meaningless, and you can no longer tell where it was. Fix: always do Step 2.
Trap 2: Cleaned the symptoms, the template keeps generating
Two weeks after cleanup, three new files show up carrying the old path, because the template was never changed. Fix: do Step 3 first.
Trap 3: The batch script misses “embedded” paths
Batch rules usually look for a fixed string. A path wrapped in an absolute path, an instruction string, or a different spelling (slash direction, trailing slash or not) slips through. Fix: the Step 5 full scan, using the shortest keyword you can, such as only the old folder name. Accept a few false positives rather than miss one.
Trap 4: The redirect’s “new location” moved too
The sneakiest one, because it looks maintained: it has content, an explanation, and complete formatting. Fix: include the redirect stub itself in the Step 1 inventory. It is not part of the solution; it is part of the cleanup list.
Trap 5: Forgot to sync permissions or allowlists after cleanup
“Allow access to path X” style settings may have piled up many rules that point at old paths. They never throw an error; they simply never match, while the config file grows heavier and harder to read. Fix: count config files in the Step 7 “who still points at it” search, and verify the file is still valid afterward. JSON breaks easily.
Universal rescue: how to ask an AI when you are stuck
Search syntax and batch-replace tools differ by operating system and tool. When you are stuck, copy the block below to any AI assistant and replace the angle brackets with your situation:
I am a complete beginner. My operating system is <Windows / macOS>, and the tool I use is <VS Code / Obsidian / terminal / other>.
My situation: I moved a folder from <old name> to <new name>, and many files still contain the old path.
What I want to do: <e.g. find every file that still contains the old path, without touching the logs and backup folders>
What I tried: <what you did>
What happened: <what you actually saw; paste any error message exactly as shown, do not rewrite it>
Please walk me through it one step at a time, stating exactly where to click and what to type.
Before any batch edit, show me how to search only, without modifying, so I can confirm the scope first.
If you do not have enough information to decide, ask me first. Do not guess.
Three points: say you are a beginner, so the AI lowers the jargon; paste the error message verbatim, since a paraphrase misleads the diagnosis; and explicitly ask for “search only, no changes” first, because batch edits are not reversible and checking the scope before acting will save you many times.
One-line summary
Cleanup after a move is not “finish carrying things over.” It is “turn every finger that points at the old place, then take the signpost down”: fix the generators first, clean the existing files, always scan once more after the batch, find live pointers before deleting, and set a teardown date the moment you leave a new redirect.
This is part of an ongoing series of field notes and AI tool tests. To get the full SOPs and future posts, subscribe to the newsletter.
Support this work:Support on Ko-fi