Duplicate File Cleanup: Hardlink-based Deduplication - Reclaim Disk Space with Agent Skill Preserving Paths

Foreword

In Downloads, WeChat/QQ folders, and cloud drive sync directories, the same Office document or installation package is often duplicated multiple times. Directly deleting duplicates can easily mistakenly remove versions that have the “same name but different content,” and it also causes records in chat logs or cloud drives to point to invalid paths. Below is an introduction to the community Skill “Duplicate File Cleaner · Hard Link Deduplication”: trigger scanning and organizing within an Agent conversation, use MD5 to identify true duplicates, and merge data blocks using hard links while keeping paths and filenames unchanged.

What is this

Duplicate File Cleaner · Hard Link Deduplication (Coordinate @user_37b3d0df/duplicate-file-cleaner, current version 1.3.0) is a community Skill on SkillHub, categorized under it-ops-security, published by user_37b3d0df, and requires no API Key (requires_api_key=false).

It targets office and daily file scenarios: scanning Office/Word/Excel/PPT/WPS, PDF, txt/csv/md, images, installation packages, compressed archives, etc., and covering duplicate copies in WeChat/QQ/DingTalk file directories, Downloads, cloud drive sync directories, and asset libraries. The core idea is to reclaim space using hard links—the disk retains only one copy of the content, while all paths remain openable as usual. It uses MD5 to determine duplication, so files with the same name but different content will not be misidentified as duplicates.

Official Page: SkillHub - Duplicate File Cleaner · Hard Link Deduplication
Clue Entry: api.skillhub.cn Page

Core Features

Scanning and Deduplication

  1. Precisely identify files with completely identical content based on MD5.
  2. Defaults to the “Office File Scan” preset (v1.2), with support for a fast mode (v1.1).
  3. Supports stopping the scan (v1.2).
  4. Installation package scenarios: Installed detection, pairing of installation packages with extracted software directories (v1.2); extracted software directories can be moved or deleted (v1.1).
  5. One-click location of WeChat/QQ file directories (v1.1).

The deduplication execution utilizes hard links rather than simple copy deletion. After execution, paths, filenames, and sizes remain externally consistent. The original opening methods on the WeChat/Cloud Drive side are unaffected, and the underlying data blocks are merged into a single copy.

Security Boundaries and v1.3 Trust Mechanisms

Hard Boundaries (skipped or rejected during scanning and execution): Code files, library files, development directories (including .git / node_modules / venv), virtual disks, mail libraries, temporary files, etc.

v1.3 Security and Trust (According to the official description):

  1. Three-layer CSRF protection: Startup random token, Host header, and Origin header validation to reduce the risk of remote triggering of deletion by arbitrary web pages or plugins.
  2. Reversible Hard Links: Execution writes to logs/undo_*.tsv, and the UI provides an undo button for atomic restoration.
  3. Pre-execution Preview: /api/preview returns the number of affected items, bytes to be reclaimed, volume types, cross-volume pairings, and the first 3 samples, requiring a secondary confirmation via a pop-up.
  4. The log directory degrades to %TEMP% when needed, with explicit prompts on failure.
  5. NTFS / Cross-volume Pre-checks: Non-NTFS batches are rejected entirely.

The implementation is pure Python standard library, zero dependencies, providing both Graphical User Interface (GUI) and Command Line Interface (CLI) usage.

Installation and Enablement

SkillHub CLI must be present on the local machine before installation. If not installed, check the version according to the official documentation first:

command -v skillhub && skillhub --version

If not installed, perform a full installation (including CLI and default Skills):

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

Install this Skill to the current Agent’s skills directory (must use --dir, otherwise the default ./skills/ might not be recognized by the Agent). The SkillHub page requires installation of:

@user_37b3d0df/duplicate-file-cleaner

Cursor example:

skillhub install @user_37b3d0df/duplicate-file-cleaner --dir ~/.cursor/skills/

Claude Code example:

skillhub install @user_37b3d0df/duplicate-file-cleaner --dir ~/.claude/skills/

Codex example (choose either user-level or project-level):

skillhub install @user_37b3d0df/duplicate-file-cleaner --dir ~/.codex/skills/
# Or within project
skillhub install @user_37b3d0df/duplicate-file-cleaner --dir .agents/skills/

After installation, restart or refresh the Agent according to the requirements of the client being used to ensure the Skill is loaded. For more complete CLI installation and priority source instructions, see: SkillHub Installation and Priority Source Configuration.

Typical Usage

This Skill is triggered via natural language. In an Agent with this Skill enabled, you can describe needs using the trigger words listed officially, for example:

  • Disks and Drive Letters: Disk space insufficient, Clean up disk, C drive full, D drive full, Scan C drive, Scan D drive, Full disk scan, Disk slimming
  • Duplicates and Office: Duplicate files, Clean up duplicate files, File deduplication, Hard link deduplication, Office file deduplication, Office files duplicated, Documents duplicated, Spreadsheets duplicated, PPT duplicated, txt duplicated
  • Installation Packages and Software Directories: Installation package cleanup, Installation packages after install, Extracted software, Move software directory
  • Instant Messaging and Directories: WeChat files taking too much space, WeChat deduplication, Clean up WeChat files, msg/file too large, Duplicates in folder

Suggested workflow:

  1. Describe the directory or scenario to be scanned (e.g., Downloads, WeChat file directory, Office documents on a specific drive).
  2. Wait for the scan results; use stop scan if necessary.
  3. View the Preview under the guidance of the GUI or conversation (/api/preview related capabilities): number of affected files, space reclaimable, volume types, and samples.
  4. Confirm and execute hard link deduplication; if rollback is needed, use undo and rely on the logs/undo_*.tsv records.

Specific UI buttons and CLI subcommands are subject to the SKILL.md and bundled programs within the Skill package; this article only summarizes behaviors publicly available on the official page.

Applicable Scenarios and Notes

Suitable for: Windows environments primarily using NTFS, where duplicate copies are concentrated in Office documents, chat attachments, Downloads, and cloud drive sync directories; scenarios where users wish to complete scanning, previewing, and deduplication via conversation within an Agent while preserving original paths.

Limitations and Notes:

  1. Platform and File System: v1.3 rejects non-NTFS batches entirely; there are pre-checks for cross-volume pairing, and cross-volume hard link capabilities are subject to system limitations. The “Cross-volume pairing” in the preview results must be read carefully before confirmation.
  2. Development and Security Directories: Do not expect to clean up .git, node_modules, venv, etc.; the Skill is designed to skip these and perform a secondary rejection during execution.
  3. “Delete” Phrasing: When a user says “delete duplicate files,” the Skill’s actual path is hard link deduplication; undo relies on undo logs. For important data, it is still recommended to back up first or go through the preview completely.
  4. Environment: The GUI and local Web/API (including CSRF validation) usually run on the user’s local machine; in remote or sandboxed Agents, direct access to the local disk may not be possible. Usage requires an environment with the Skill installed and access to the target paths.

Conclusion

Duplicate File Cleaner · Hard Link Deduplication connects “Find duplicates → Risk assessment → Preview confirmation → Hard link merging → Reversibility” into a workflow that can be triggered within an Agent. It is suitable for standardized organization when daily office and chat directories fill up the disk. For installation and details, refer to SkillHub:

  • https://www.skillhub.cn/skills/user_37b3d0df/duplicate-file-cleaner
  • https://api.skillhub.cn/user_b3d06a4a/duplicate-file-cleaner
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye