Write a file-reorganising script from a mapping table
A file-reorganising script with a dry-run mode that prints every proposed move and an undo log format.
Choose one of three approaches. The steps for that option appear below.
Choose an option above. On a phone, swipe the tabs left or right to see all options →
Claude: checks mapping, drafts script, you run it
Claude checks your mapping and drafts a dry-run-first script. You decide collisions and run the script yourself.
You
Gather files
Claude
Check mapping
You
Decide collisions
Claude
Draft script, table
You
Back up and run
Gather the listing and mapping CSV
Use:You
Have ready: the folder listing and the old-to-new mapping CSV.
Check
Check both files are the versions you mean to use.
Check the mapping for collisions
Use:Claude
Ask Claude to check the mapping table for collisions and unmapped names and propose fixes.
Details
What to paste into the tool
Task: Collision list; Unmapped files; Proposed fixes. Check the mapping for collisions (two old patterns mapping to the same new path) and for files that match no pattern. Return a collision list, an unmapped list, and a proposed fix for each. Do not invent mappings for unmapped files; flag them.
Decide collisions and approve the mapping
Use:You
Read the collision and unmapped lists, decide how each collision is resolved and approve the final mapping CSV.
Check
Decide how each collision is resolved. Check every unmapped file stays explicitly unmapped.
Draft the script and expected moves
Use:Claude
Ask Claude for a script with dry-run default and undo log, then an expected dry-run table from the listing.
Details
What to paste into the tool
Task: Script file content; Usage notes. Draft a script that applies this approved mapping CSV to this folder listing. Requirements: dry-run is the default and prints every proposed move; moves are copy-then-rename operations, and deletion is never part of the script; it writes an undo log (old path, new path, timestamp) for every move; it stops on any name not covered by the mapping and reports it as 'unmapped'. Keep the codes as they are. Include short usage notes. Task: Expected move table covering every listed file exactly once. Using the listing, the approved mapping and the usage notes, produce the table the script's dry run should produce: every listed file exactly once, each with a destination or an explicit 'unmapped'. Do not add or drop files. Keep the codes as they are.
Back up, dry-run, then run the script yourself
Use:You
Back up first. Run the dry run, compare it with the expected table, then run the real moves yourself.
Check
Check the script defaults to dry-run and contains no delete operation. Keep a backup before running. Run the dry run and check it lists each listing file exactly once with a destination or an explicit 'unmapped', matching the expected table; only then run the real moves yourself. The workflow changes no files.
ChatGPT: drafts script and test fixture from your mapping
You build the mapping. ChatGPT drafts the script and a sample fixture. You test on the fixture first.
You
Build mapping
ChatGPT
Draft script, fixture
You
Test, back up, run
Build and check the mapping table
Use:You
Build and check the mapping table yourself from the folder listing, and pick a few example file names per pattern.
Check
Check the mapping for collisions (two old patterns landing on the same new path) and for files no pattern covers; unmapped files stay explicitly unmapped.
Draft the script and a sample fixture
Use:ChatGPT
Ask ChatGPT to draft the dry-run-first script from your finished mapping, then a small fixture of invented sample file names.
Details
What to paste into the tool
Task: Downloadable script file; Usage notes. Attached is my approved old-to-new mapping CSV, plus a few example file names per pattern. Write a script that applies the mapping to a folder listing. Requirements: dry-run is the default and prints every proposed move; moves are copy-then-rename (source constraint: 'Default to copy or dry-run; deletion is never part of the script.'); it writes an undo log (old path, new path, timestamp) for every move; it reports any name the mapping does not cover as 'unmapped' and stops. Give me the script as a downloadable file with short usage notes. Task: Fixture file of sample file names covering each pattern and edge case. From the approved mapping CSV, generate a small fixture file of invented sample file names: several names per pattern, plus edge cases (names matching no pattern, names two patterns could both claim). Use clearly invented sample names, not real ones.
Test on the fixture, back up, then dry-run
Use:You
Run the script on the fixture, compare each line with your expectation, repeat after fixes. Then back up and run the full dry run.
Check
Check the fixture covers every mapping pattern and the known edge cases before using it. Keep a backup before running. Run the dry run over the full listing and check it lists each listing file exactly once with a destination or an explicit 'unmapped'; only then run the real moves yourself. The workflow changes no files.
Cursor: drafts the script, dry runs find collisions
Cursor drafts the script first. Your dry runs, not a model's guess, find collisions and unmapped files.
You
Set up and back up
Cursor
Draft script
You
Dry-run, fix, run
Set up a working folder and back up
Use:You
Have ready: the folder listing and the old-to-new mapping CSV. Set up a local working folder, back up the real files and copy both in.
Check
Keep a backup before any run. The workflow itself changes no files; only you run the script later.
Draft the dry-run-first script
Use:Cursor
Ask Cursor to draft the dry-run-first script as a file in the working folder from your first-pass mapping and listing format.
Details
What to paste into the tool
Task: Script file saved into the working folder; Usage notes. It must default to a dry run that prints every proposed move, contain no delete operation (source constraint: 'Default to copy or dry-run; deletion is never part of the script.'), write an undo log (old path, new path, timestamp) per move, and list every collision (two old patterns claiming one new path) and every name the mapping does not cover as 'unmapped'. Save it into the working folder with usage notes as comments.
Run dry runs, fix mapping, then run moves
Use:You
Run the dry run; its output is the collision and unmapped report. Edit the mapping, re-run until clean, then run the real moves yourself.
Check
Treat the printed collision and unmapped lines as the report, not a model-predicted one, and note anything that looks wrong. Decide how each collision is resolved and record it in the mapping yourself; unmapped files stay explicitly unmapped. Re-run the dry run after each edit until its output matches your intent. Check the final dry run lists each listing file exactly once with a destination or an explicit 'unmapped'; only then run the real moves yourself.
Compare the three approaches
Option A: Claude: checks mapping, drafts script, you run it
Best when: You want everything reviewable in one thread
What it does: Claude checks and drafts; you decide and run
Strong at: Drafts and edits text in many formats
Limit: Usage capped in 5-hour and weekly windows
Free plan: Yes
Option B: ChatGPT: drafts script and test fixture from your mapping
Best when: You want to keep the mapping judgement and test cheaply first
What it does: You build the mapping; ChatGPT drafts; you test and run
Strong at: Writes, rewrites and summarises text
Limit: Free plan limits file uploads, image generation, voice and data analysis
Free plan: Yes
Option C: Cursor: drafts the script, dry runs find collisions
Best when: You trust executed output over model predictions when checking
What it does: Cursor drafts the script; you run dry runs and fix
Strong at: Runs coding agents that write and change code
Limit: Cloud agents need Premium or above
Free plan: Yes
Before you paste into any AI tool, remove any confidential information. Put it back at the end.
Owner decides every collision resolution before drafting.
Owner reads the script and confirms it defaults to dry-run and contains no delete operation.
Owner compares the expected table with the real dry-run output.
Owner keeps a backup and runs the script themselves; the workflow changes no files.
Dry run lists each listing file exactly once with a destination or explicit 'unmapped'.
Check the result against your original inputs. Approve it before sharing or acting.
What still needs checking
Exact message-size or upload limits for an ~800-name listing are not published on the cited pages, so paste/upload feasibility is unchecked in every option.
ChatGPT and Cursor plan-level data terms were not captured on this read.
Whether any vendor trains on the pasted or uploaded listing under the owner's plan is still to confirm for options A, B and C.
Option C: the cited cursor.com quote covers handed-off tasks, autonomous and parallel work and terminal use only; reading and writing files in a local working folder is not covered and is unchecked.