A Claude Code Skill for finding and removing duplicate documents in WeChat folders
微信文档去重工具 - 自动识别并清理微信产生的重复文档文件
WeChat (微信) tends to create multiple copies of the same document when:
- Files are forwarded multiple times
- Files are saved from different chats
- Sync issues between devices
This results in files like:
document.pdf
document(1).pdf
document(2).pdf
These duplicates waste significant storage space.
This skill scans your WeChat folder, identifies duplicate documents by content hash (not filename), and safely moves duplicates to a quarantine folder.
- Content-based detection: Uses MD5 hash to identify truly identical files
- Safe operation: Moves files to quarantine instead of deleting
- Smart retention: Keeps the oldest (original) file
- Detailed report: Generates a markdown report of all actions
# Clone to your skills directory
git clone https://github.com/rolandwong/wechat-dedup.git ~/.claude/skills/wechat-dedupgit clone https://github.com/rolandwong/wechat-dedup.git
cd wechat-dedup
python3 dedup.pyJust say:
微信去重清理微信重复文件wechat dedup
python3 ~/.claude/skills/wechat-dedup/dedup.py- Scan: Finds all PDF and Word documents in WeChat folder
- Hash: Groups files by size first (fast), then by MD5 hash (accurate)
- Select: Keeps the file with earliest creation time
- Move: Moves duplicates to
~/微信重复文件_待删除/ - Report: Generates
去重报告.mdwith full details
| Parameter | Default | Description |
|---|---|---|
| Scan Path | WeChat folder | Auto-detected on macOS |
| File Types | PDF, DOC, DOCX | Can be extended |
| Quarantine | ~/微信重复文件_待删除/ |
30-day holding period |
| Keep Strategy | Oldest file | By creation time |
- Python 3.8+
- macOS (for WeChat path detection)
- No external dependencies
- No direct deletion: Files are moved, not deleted
- Original paths recorded: Full paths saved in report
- Recoverable: Files can be restored from quarantine
- Preview mode: Review before executing
Inspired by fclones by Piotr Kołaczkowski:
- Size grouping (O(n)): Files with unique sizes can't be duplicates
- Hash only when needed: Only compute MD5 for size-matched files
- Streaming hash: Memory-efficient for large files
MIT
Created by Roland Wong with Claude Code
Part of the awesome-claude-skills ecosystem