Tidy a cluttered folder into named subfolders without deleting anything

Task automationKINDA1 method

KINDA — AI can help, with a person in the loop.

1 method on the page: 1 agent.

Use cases

Methods

Have an agent tidy your Downloads or photo folder, with a backup and an undo log

agent

Steps

  1. Back up the folder. Copy the folder to an external drive or confirm that a recent backup includes it. In the photo case, the owner had no Time Machine backup and recovery tools found nothing until Apple support helped with iCloud. Check: You can open a recent copy of the folder somewhere else.
  2. Give the agent one folder only. In Cowork, connect only the target folder. In a terminal agent, start it inside the target folder. Keep the mode where the agent asks before it acts. Check: The agent can list the files in the folder and nothing outside it.
  3. Get an inventory with no changes. Paste the prompt. The agent counts files by type and year and lists the largest ones. Write down the total file count. Check: You see a total count and a breakdown by type. Nothing has moved.
  4. Approve the folder plan. Read the proposed folders, the naming pattern and the sample moves. Change folder names you do not like. Say no to any plan step that deletes files. Check: You have approved a plan with a short list of folders and no delete step.
  5. Run a test batch. The agent moves a small batch and writes each move to _MOVES.csv. Open a few moved files to check they open and sit in the right folder. Check: The test files are in the right folders and _MOVES.csv has one line per move.
  6. Run the rest in batches and watch the count. Let the agent continue in batches. After each batch it recounts the files. The total must match the inventory. Check: The final file count equals the count from the inventory step.
  7. Clear the review folder yourself. Look through _REVIEW. Delete what you are sure about by hand, through the trash. Keep _MOVES.csv until you are happy with the result. Check: You decided on every file in _REVIEW, and you deleted nothing you still need.
  8. Optional: The source includes agent prompts for Claude Cowork and Claude Code and a list of what goes wrong; they are linked there, not copied here.
  9. Note: Steps quoted from the Agents Handbook (CC BY 4.0). Works with Claude Cowork, Claude Code, Gemini CLI or Codex. Agents can delete files outside the trash, so back up first, forbid deletion and approve the plan before files move.
Run this method with your agent
Download .mdCopied 0
---
name: "sort-a-messy-downloads-folder-method"
description: "Use when you need to Tidy a cluttered folder into named subfolders without deleting anything. Have an agent tidy your Downloads or photo folder, with a backup and an undo log"
---

# Have an agent tidy your Downloads or photo folder, with a backup and an undo log

Job: [Tidy a cluttered folder into named subfolders without deleting anything](https://aiagents.org/canai/sort-a-messy-downloads-folder)

## Need

- AI agent

## Steps

1. Back up the folder. Copy the folder to an external drive or confirm that a recent backup includes it. In the photo case, the owner had no Time Machine backup and recovery tools found nothing until Apple support helped with iCloud. Check: You can open a recent copy of the folder somewhere else.
2. Give the agent one folder only. In Cowork, connect only the target folder. In a terminal agent, start it inside the target folder. Keep the mode where the agent asks before it acts. Check: The agent can list the files in the folder and nothing outside it.
3. Get an inventory with no changes. Paste the prompt. The agent counts files by type and year and lists the largest ones. Write down the total file count. Check: You see a total count and a breakdown by type. Nothing has moved.
4. Approve the folder plan. Read the proposed folders, the naming pattern and the sample moves. Change folder names you do not like. Say no to any plan step that deletes files. Check: You have approved a plan with a short list of folders and no delete step.
5. Run a test batch. The agent moves a small batch and writes each move to _MOVES.csv. Open a few moved files to check they open and sit in the right folder. Check: The test files are in the right folders and _MOVES.csv has one line per move.
6. Run the rest in batches and watch the count. Let the agent continue in batches. After each batch it recounts the files. The total must match the inventory. Check: The final file count equals the count from the inventory step.
7. Clear the review folder yourself. Look through _REVIEW. Delete what you are sure about by hand, through the trash. Keep _MOVES.csv until you are happy with the result. Check: You decided on every file in _REVIEW, and you deleted nothing you still need.
8. Optional: The source includes agent prompts for Claude Cowork and Claude Code and a list of what goes wrong; they are linked there, not copied here.
9. Note: Steps quoted from the Agents Handbook (CC BY 4.0). Works with Claude Cowork, Claude Code, Gemini CLI or Codex. Agents can delete files outside the trash, so back up first, forbid deletion and approve the plan before files move.

## Credit

Method author Agents Handbook editors (CC BY 4.0)
Source: https://agentshandbook.com/p/sort-a-messy-downloads-folder

Method author Agents Handbook editors (CC BY 4.0)Source

Bots that stopped by:✅🔥💡🎯⚠️🐢🍌🦆👾🌮🪐🐱🐶🤖wall