📁 File Management

Batch Rename Files

Smart batch file renaming with Cowork - supports rules, content-based, and date-based naming

★☆☆ Beginner 5-10 min January 10, 2025

Overview

Manually renaming dozens or even hundreds of files is a frustrating task. Cowork can help you intelligently identify file content and batch rename according to your specified rules, greatly improving efficiency.

Use Cases

  • Rename photos by date: IMG_1234.jpg2025-01-10_001.jpg
  • Name documents by content: Identify PDF content for automatic naming
  • Standardize naming format: Remove special characters, unify case
  • Add prefix/suffix: Batch add project numbers or dates

Steps

Step 1: Describe Renaming Requirements

In the Claude dialog, explain the renaming rules you want:

Help me rename all photos in ~/Photos/2025Trip/ folder:
- Format: date_sequence.jpg (e.g., 2025-01-10_001.jpg)
- Sort by photo capture date
- Sequence numbers start from 001

Step 2: Preview Rename Plan

Claude will scan the folder and generate a rename preview:

Rename Preview:
┌─────────────────────────────────────────────────────┐
│ Original Name            →  New Name               │
├─────────────────────────────────────────────────────┤
│ IMG_20250110_123456.jpg  →  2025-01-10_001.jpg     │
│ DSC_0892.jpg             →  2025-01-10_002.jpg     │
│ photo_2025_01_10.png     →  2025-01-10_003.png     │
│ ...                                                 │
└─────────────────────────────────────────────────────┘

47 files will be renamed

Review the preview carefully to ensure it meets expectations.

Step 3: Confirm Execution

Once confirmed, tell Claude to execute the rename:

Confirmed, please execute the rename

Cowork will automatically complete all file renaming and report the results.

Backup Recommendation: Before batch renaming, it's recommended to back up important files. Although Cowork shows a preview, rename operations are difficult to undo.

Advanced Usage

Smart Naming Based on File Content

For PDFs, documents, and other files, Claude can identify content and name automatically:

Help me rename PDF files in ~/Documents/Contracts/ folder:
- Identify each PDF's title or contract name
- Format: ContractName_SigningDate.pdf

Batch Add Prefix

Add prefix "[v2.0]" to all files in ~/Projects/Designs/

Regex Replacement

Replace all spaces with underscores in filenames in ~/Downloads/, and remove special characters

You can combine multiple rules, for example: sort by date first, then add prefix, then unify to lowercase. Claude will execute them in order.

Common Questions

Q: What if new filenames are duplicated?

A: Cowork automatically detects duplicate names and alerts you in the preview. It typically adds sequence suffixes to avoid conflicts.

Q: Can I rename only specific file types?

A: Yes! Specify the file type in your description, such as "only rename .jpg and .png files".

Q: Does it support nested folders?

A: Yes! You can specify "include subfolders" and Claude will recursively process all files.

Real Case

"I had over 3000 photos with messy filenames. Using Cowork, I renamed them all by date in 10 minutes, and it even auto-created folders by year and month!" — Reddit user