AI for Work
Advanced: Use Claude Code to Build a Dry-Run Folder Inventory
Summary
Cihan's view: Ask Claude Code to inspect a bounded sample folder, report each file's path, type, and proposed action, and stop before changing anything. Review the inventory for missing files, collisions, and sensitive content. A dry run gives you a change list to approve, not permission to edit the folder.
Batch file changes are where a small shortcut can become a large cleanup job. A dry-run inventory gives you something concrete to review before Claude Code renames, moves, or deletes anything.
Advanced builder lesson. Evidence label: documentation-based guide with fictional input and illustrative output. This workflow was not executed here, and the folder below is fictional.
What you need
- Claude Code installed and authenticated. The official overview documents terminal, IDE, desktop, and web surfaces, with access requirements varying by setup.
- A disposable sample folder, not a production or shared drive.
- A naming rule written in plain language.
Claude Code’s workflow documentation supports inspecting a codebase, asking for a plan before editing, and working in small, verifiable steps. This lesson applies that boundary to a folder inventory.
1. Define the boundary
Create this fictional folder map in your task brief:
Folder: ./sample-handoffs
Allowed action now: read filenames and file types only
Excluded: hidden files, credentials, customer data, and folders outside this path
Naming rule: report a proposed YYYY-MM-DD-topic.ext name only when the date is present
Required output: inventory table and collision list
Forbidden now: rename, move, delete, overwrite, upload, or commit
Acceptance check: every visible sample file appears once, with no write action
The folder contains:
2026-10-21_supplier-notes.txt
supplier-notes-final.txt
handoff-draft.md
2. Start in plan mode
From the project root, run:
claude --permission-mode plan
Then paste:
Inspect only ./sample-handoffs.
Do not edit, rename, move, delete, overwrite, upload, or commit anything.
Ignore hidden files and anything outside that folder.
Return a Markdown table with:
- relative path
- detected extension
- proposed filename, only when the date and topic are explicit
- collision or ambiguity
- recommended action: keep, review, or propose rename
Also return a collision list and the exact commands you would run later.
Do not run those commands. Stop after the inventory.
Plan mode is a review boundary. Keep the command list as a proposed artifact, not as evidence that anything changed.
3. Review the illustrative inventory
| Relative path | Type | Proposed filename | Collision or ambiguity | Action |
| --- | --- | --- | --- | --- |
| 2026-10-21_supplier-notes.txt | text | 2026-10-21-supplier-notes.txt | None stated | Propose rename |
| supplier-notes-final.txt | text | None | Date is absent; "final" is ambiguous | Review |
| handoff-draft.md | Markdown | None | Topic and date are absent | Keep |
Collisions: None confirmed. Review the proposed rename against the folder before applying it.
This is an editor-written illustrative artifact. It is not a captured Claude Code result.
4. Approve one change at a time
If the inventory passes review, leave plan mode only when you are ready to make a separately approved change. Ask for one rename, then request a fresh listing and compare the result with the approved path. Do not turn a proposed batch into an automatic batch.
Acceptance checks
- Every allowed visible file appears exactly once.
- Hidden files and outside paths are absent.
- Files without an explicit date are not given invented dates.
- Proposed names do not overwrite an existing path.
- The session ran no write command during the inventory.
- The proposed command list is reviewed before any later action.
Troubleshooting
- The inventory includes outside files: stop and narrow the path in the prompt and working directory.
- A proposed name loses meaning: mark it review instead of guessing a date or topic.
- A collision appears: keep both originals and ask for a new naming rule; do not overwrite.
- Claude starts editing: stop the session and restart in plan mode with the forbidden actions stated first.
No-code alternative
In a file manager, sort the sample folder by name, copy the visible filenames into a spreadsheet, and add columns for proposed name, collision, and approval. This is slower, but it gives you the same review artifact without adding a coding tool.
Limits and safe use
Use a disposable folder first. Do not include credentials, private customer files, or shared drives. A plan is not a backup. Preserve originals until a person has reviewed the inventory and approved a specific change.
TRY this on a small sample folder. SKIP production folders and bulk destructive actions. USE the workflow when a reviewed dry-run list is more valuable than a quick rename.