Memuat
Memuat
Watch every step above performed live, with English narration.
0 plays
Class book
Page 1 / 5
Cover: Claude from Zero to Expert Class #81: Tidying Hundreds of Files at Once
Click a page or use ◀ ▶ to turn · swipe on mobile · to enlarge
Want to go deeper?
Join one of our courses or ask us directly on WhatsApp.
Picked from the software, topic, and level of “Claude from Zero to Expert Class #81: Tidying Hundreds of Files at Once”.
Other ways we can help with Claude.
Learn with a mentor
Scheduled AI & Machine Learning courses with live guidance and a certificate.

Midjourney Course: Create Stunning AI Images from Text
★ 4.9

DALL-E Course: Creating Professional AI Images from Text
★ 4.9

Stable Diffusion Course: AI Art from Beginner to Professional
★ 4.9
Have it built for you
No time to learn Claude? Our team can do the project for you.

AI Image Creation with Stable Diffusion — Unlimited Custom Visual Production
★ 4.9

AI Image & Video Creation with Leonardo AI — All-in-One Visuals for Business
★ 4.9

AI Image Creation with Midjourney — Cinematic AI Art for Business
★ 4.9
Get notified about new Claude classes
At most one email a week. Unfollow anytime with one click.
The full narration of this video. The current sentence is highlighted while the video plays; click any sentence to jump there.
Hi, and welcome to the Automation with Claude Code session. From this episode on, Claude Code doesn't just build websites; it also handles repetitive office work. Our first case: tidying hundreds of files at once. We'll rename and move files safely, complete with a backup, a dry run, and a change log.
First, let's meet the problem. Dewi, operations manager at Maju Bersama Co., keeps supplier invoices in one folder. There are scanned files named scan zero zero four seven. Some are named however someone felt like it, such as budi invoice final two. Which supplier? Which month? Nobody knows. Some suppliers are already tidy. The files from Sinar Jaya use a clear invoice code. Then there are email attachments named with nothing but a running number. There's a file labeled new revision, which will surely be confusing in a few months. There are even invoice photos taken on a phone. Six hundred twelve files in total. Tidying them one by one would take Dewi days, and something would surely slip through. Before touching a single file, hold on to five safety rules. First, back up the folder somewhere else, such as a flash drive or cloud storage. Second, work on a copy first. The original folder is touched only after the results are proven correct. Third, ask for a dry run. The script only shows the planned changes, without changing anything. Fourth, ask for a change log. With a record of old and new names, every change can be undone. Fifth, never approve a bulk delete command right away. Tidying only needs renaming and moving. Nothing has to be deleted.
Now Dewi explains the job. The task part names the copy folder, not the original, and what should happen: rename, then move into monthly folders. The format part gives the new name pattern with an example: year and month, supplier name, then invoice number. An example always helps Claude catch what we mean. The data part explains where the information comes from: the text inside each PDF, matched against the official supplier list in an Excel file. Finally, the limits. Nothing gets deleted, doubtful files go to a manual check folder called Manual Check, and the script must have a dry-run mode. Dewi opens a terminal in the copy folder, starts Claude Code, and types a request in everyday language. Notice that Dewi asks for a report first, not changes. Claude starts by counting the folder's contents. Lines starting with a green dot are tools Claude uses, and below each one is the result: six hundred twelve files. Then Claude reads the official supplier list. There are thirty-eight names it will use as the spelling reference. Claude reports its findings. Most PDFs contain text, but seventeen are scans without text and twelve are photos. A report like this helps us judge the risk before we start. Claude also asks about something unclear: which date to use. A question like this is a good sign. Don't ignore it. Dewi answers briefly and firmly: use the invoice date, and anything unreadable goes to the manual check folder.
Claude explains its plan: one script with two modes. The dry-run mode only writes a list of planned changes. The run mode actually moves the files. Claude writes the script. We don't need to read those ninety-four lines of code. What matters is that we understand what it will do. Before running anything, Claude asks for permission. Read the command: dry-run mode, no files changed. Since it's safe, Dewi chooses Yes, just this once. The result: five hundred eighty-three files are ready to tidy, twenty-nine go to manual check, and the plan has been saved. Claude confirms that no files have changed yet, then asks Dewi to check the plan. This is the habit we must keep. Dewi opens the plan in Excel. The first column is the old name, the second the new name, and the third the destination folder. The first row is already correct. The budi final invoice turns out to be from Budi Jaya Co., number eleven eighty-two. A confusing name is now clear. The Sinar Jaya file gets the same uniform pattern. Email attachment number twelve turns out to be an October invoice from Nusa Paper. Claude read that from the document's content, not from the file name. The phone photo has no readable text, so its name stays the same and it goes to manual check, exactly as the rules say. Dewi just spot-checks a random sample, say twenty rows, before moving on. While checking, Dewi remembers one risk: two invoices could end up with the same name. Dewi asks that files never overwrite each other. Claude doesn't rewrite the whole script. It changes only three lines. This box is called a diff, a view of the changes. Red lines are removed, green lines are added. The meaning: if the destination name already exists, add the suffix underscore two. Claude runs the dry run again right away. It turns out there were four duplicate names, and all of them are now safe.
Dewi is happy with the plan. Dewi asks for the script to run for real, log every change, and prepare a way to undo it. The permission box appears again, and this time it's more serious: five hundred eighty-three files will be moved. Dewi chooses Yes once, not permanent permission. For commands that change files, avoid permanent permission. The script finishes in seconds. Every change is recorded in a log file dated today. Claude also creates an undo script. If anything goes wrong, the old names are restored from the log. Then a simple but important check: the number of files before and after. Six hundred twelve. It matches. Nothing is lost. Claude wraps up with a summary and how to undo. Dewi only needs to go through the manual check folder. Let's look at the results in numbers. Six hundred twelve files checked. Five hundred eighty-three of them were tidied automatically, complete with monthly folders. Twenty-nine need a manual check. That's not a failure; it's an honest script that doesn't guess. From explaining the rules to checking the results, it took about fifteen minutes in total. Work that usually takes days is done before lunch.
This pattern works for many jobs. Laras at Sunset Coffee, for example, could give hundreds of product photos uniform names: product name, size, then photo date. HR could tidy employee documents, one folder per person with file names by document type. Since this is personal data, do it on the office computer and don't share it anywhere. Transfer receipts and bills can be grouped by month so bookkeeping goes faster. And a crowded downloads folder can be sorted automatically by file type. Finally, save this work. Dewi asks Claude to move both scripts to a dedicated folder and write a how-to guide. The guide has four steps: copy the folder, run the dry run, check the plan, and only then run it for real. Next month Dewi doesn't need to explain everything again. One sentence is enough, and Claude uses the same script. One note: the screens in this video are simulations. Claude Code is updated often, so menu names may differ slightly. Check the official documentation if you're unsure.
We tidied six hundred twelve files safely: back up first, clear rules, a dry run that changes nothing, read the permission, then run it with a change log. In the next episode, Dewi faces another challenge: dozens of Excel files from every branch that must be merged into one. See you there!
Try these on your own after watching to lock in what you learned.
Type a question or keyword; we find the part of this episode that explains it and jump the video there.
Notes are saved with the current video time and are only visible to you.
Stuck on a step? Ask here; the instructor and other learners can answer.
No questions yet.

Cerdas Inovasi Digital Team
Software developers, BIM & 3D engineers, and AI practitioners
We build software, BIM models, games and AI automations for clients every day, and turn that hands-on work into step-by-step classes: every step is shown on screen and comes with a PDF guide you can keep.
See our clients →