Build real things

Project 4: automate a boring job safely

Use Claude Code on files, with checks and an undo plan.

3 min + hands-on18 / 18

Goal: let Claude Code do a repetitive job on a folder of files, for example renaming 100 photos or cleaning a spreadsheet export, without risking your originals.

  1. Copy the folder first. Work on the copy.
  2. Describe the job and the rules. Ask for a preview before any change.
  3. Check the preview. Look at three random examples.
  4. Approve. Then ask Claude to write a short log of what changed.
  5. Keep the original until you are sure.

Prompt: safe batch job

In this folder there are photos named IMG_1234.jpg. Rename them to YYYY-MM-DD_place_number.jpg using the date from each file's metadata; I will tell you the place. First show me a table of old and new names for the first 10 files and do not rename anything yet. Never overwrite or delete a file. If a date is missing, list the file and skip it.

It sets a preview, a safety rule and an edge-case rule.

Know your safety netsCheckpoints only track edits through Claude's own file tools, and they are not git. For real jobs, work on a copy or use git.
Next step: non-interactive modeOnce a works, you can run it as a one-off command with claude -p "your prompt" to build it into scripts. Test on a few files first.

Make it run every week

When the job works reliably, turn it into a scheduled task with /schedule, for example “every Friday at 17:00, sort new photos in Downloads into folders by month and list what you moved”. Desktop scheduled tasks can reach your local files; cloud tasks keep running when your computer is off.

Common problems and fixes

ProblemFix
Some files were skippedGood: your edge-case rule worked. Ask for the list and handle those by hand.
The preview looks right, the result does notRestore from your copy, then run on 10 files only and compare.
You are not sure what changedAlways ask for a log of every change as the last step.

Check yourself

1. What should you do first with a batch job?
2. Why include "never overwrite or delete a file"?
3. Your batch job works well. How do you run it automatically every Friday?

Tip: use ← and → to move between lessons.