Back to storiesPractical guides

Organize files with an agent: a numbered download may be a different version

Compare five actual working packs and one exact-copy control. Preserve distinct versions, copy into a new folder and verify each result. Includes inputs, script and audit records.

8 min readMarkdown
On this page7 sections

Is a download ending in (1) actually redundant?

While organizing this series’ working packs, we found business-analysis-workshop.zip and business-analysis-workshop (1).zip. The names differ by a download counter, but the files contain 9,689 and 10,125 bytes and are not identical.

A file-organizing assistant should first return what matches, what differs and the evidence. We inspected five actual downloaded packs and added one exact copy in an isolated directory as a control. The result was five distinct working copies and a complete source-to-destination log. Originals were neither moved nor deleted.

Limit the task to known inputs

The Claude Academy file-organization example organizes by file contents and includes checking the result. We applied that idea to five ZIPs created in this series, without scanning the rest of a personal Downloads folder.

This task ran in Codex with Python, not Cowork. The inputs were an editorial pack, channel drafts, a Skill-reuse pack and two business-analysis versions. A sixth file was an explicitly added control copy, not a duplicate we claimed to discover in the original folder.

Download the exercise pack for the historical inputs, inventories, copy log and script. Treat the historical ZIPs as comparison data rather than current recommended scripts to execute.

Inspect before renaming

For each explicitly named ZIP, we recorded its filename, byte size, full SHA-256 and hashes of its member contents. The utility reads archives without extracting or executing their programs.

Matching whole-file bytes identifies an exact copy in this test. Different ZIP bytes require further inspection: archive timestamps, compression and repacking can change the archive hash without changing the member contents.

Start with an inventory-only request:

python organize.py first.zip second.zip --report audit.json

Names such as latest, final or a numbered download suffix are clues, not authority for which version to retain. A real project may need release records or an owner’s decision.

The difference was in two specific files

Both business-analysis ZIPs contain eight files, with no added or removed members. README.md and plot.py differ in content, corresponding to the earlier explanation and chart revisions. We retained both versions.

ComparisonActual resultAction in this task
Two business-analysis packsDifferent bytes; two members changedCopy both
Editorial pack and injected controlExactly identical archive bytesOne working copy; retain both source records
Channel and Skill-reuse packsDistinct from each other and the other packsCopy separately

The final inventory has six inputs: five actual files plus one control, forming five different byte sequences. Exact names and groups remain in audit.json.

Actual handling of an exact copy and distinct versions
This run’s results; the duplicate was an explicitly injected control.

Copy into a new directory and retain the mapping

After reviewing the inventory, we copied distinct contents into a newly created organized directory. Originals remained in place. Each output was hashed again; the duplicate’s log entry points to the working copy already created.

The first version named outputs with hashes alone. We revised that to retain the original filename stem plus a short hash suffix, then reran into another new directory. Full hashes remain in the inventory. Short suffixes are naming aids, and existing destinations are never overwritten.

All six inputs have a destination record. The output contains five ZIPs and a log. Reusing the same destination is rejected; we checked that its existing contents stayed unchanged after rejection. An interrupted copy can leave partial new outputs, so inspect the log and directory rather than assuming a rerun rolls anything back.

Give the assistant a checkable task

Inspect only the files I specify. Do not move or delete them yet.
Return names, sizes, content hashes and possible duplicate groups.
For similarly named ZIPs with different hashes, compare member contents.
Do not infer the latest version from a download counter or timestamp.
After the inventory is reviewed, copy into a new working directory.
Log every source and destination and verify the copied bytes.
Identical bytes may share a working copy; retain every source record.
Keep distinct versions. Do not delete originals without authorization.

This connects decisions with observable actions. Check the mapping, open representative outputs, and verify the originals still exist before treating organization as complete.

Repeat the small exercise

The README contains the full command. Python 3.10 or later is sufficient, with no extra dependencies. Generate the report without --copy-to first, then choose a destination that does not exist.

Expect six records, one exact-duplicate group with two members, five distinct ZIPs and the two changed members in the business-analysis pair. audit-first.json retains the initial naming; audit.json and review.json record the final run.

This exercise covers ZIPs and exact copies. It does not test similar images, semantic document duplication, cloud synchronization or automatic deletion. Start with a bounded authorized file set and return content differences for human judgment when versions are similar but not identical.