dsh-file-dedupe: Deduplicate Files in DSH by Content Hash and Safely Clean Up Duplicates

Introduction

When working on local projects or organizing materials in DeepSeek Harness (DSH), it is common to encounter duplicates on disk that have different file names but identical content: repeated downloads, stacked backups, and missed copies during file transfers all leave such files behind. Manual comparison is slow, and there is a high risk of accidentally deleting versions that are still needed.

The DSH community plugin dsh-file-dedupe (maintained by zizhuang) addresses this scenario: it scans specified local directories, uses SHA-256 content hashes to identify duplicate files that are identical at the byte level, allows you to view the results through a visual panel or conversational tools, and moves redundant copies into a recoverable quarantine area instead of permanently deleting them immediately.

What is this

dsh-file-dedupe is a client-side DSH plugin: it provides a “File Deduplication” entry point in the bottom-left corner of the host (described as a floating button in the README) as well as a configuration section under Settings → File Deduplication. It also registers the Agent tools file_dedupe_scan, file_dedupe_cleanup, and file_dedupe_restore.

Deduplication logic is independent of file names: files with identical content hashes are considered to be in the same duplicate group; files with the same name but different content will not be grouped together.

The current plugin version is 1.0.0 (as listed in the repository’s package.json), licensed under MIT. Community directory page: SkillHub - dsh-file-dedupe; Source code and documentation: GitHub - zizhuang/dsh-file-dedupe.

How it works

The workflow described in the README can be summarized in three steps:

  1. Traverse the target directory and first group files by file size;
  2. Calculate SHA-256 only for candidate files that have the “same size and multiple instances” (using 1 MiB streaming chunks to prevent large files from consuming excessive memory);
  3. Files with identical hashes are placed into the same duplicate group.

Scan results include: the number of duplicate groups, the number of redundant files, the amount of space that can be reclaimed, and a list of files for each group.

Core Features

Visual Panel

After installation and a restart or refresh of DSH, you can open the file deduplication panel from the bottom-left corner of the application; related options are also centralized in Settings → File Deduplication.

Conversational Tools

Agents can directly invoke the following tools (parameter names are based on the README):

  • file_dedupe_scan: Initiates a scan on a directory and returns duplicate groups and reclaimable space;
  • file_dedupe_cleanup: Moves selected redundant copies into the quarantine area;
  • file_dedupe_restore: Restores files from the quarantine area to their original paths.

Safety and Cleanup Strategy

  • Only processes paths that genuinely belong to a duplicate group; at least one file is preserved in every duplicate group.
  • Permanent deletion is not performed via the Agent’s file_dedupe_cleanup (it only moves files to quarantine); permanent deletion is only performed via the panel and requires secondary confirmation.
  • Quarantined files are stored in the directory: $DSH_HOME/dsh-file-dedupe/quarantine/, and a manifest is recorded; restoration attempts to return files to their original paths, but will refuse to overwrite if the target is already occupied.

Installation and Activation

The README recommends installation from GitHub (it has not yet been published to npm, so add dsh-file-dedupe is currently unavailable):

dsh plugin --profile web add github:zizhuang/dsh-file-dedupe

Replace web in the command with the profile name you are actually using (such as desktop, headless, tui, etc.). After installation is complete, restart or refresh DSH to see the file deduplication entry point. Once the plugin is included in the community plugin marketplace, it can also be installed in one click from within the application via Settings → Plugin Marketplace (the README notes this as a future capability).

Configuration

Fields can be overridden in the profile’s cordis.patch.yml as shown in the table below:

Field Default Value Description
minFileSize 1 Ignore files smaller than this number of bytes
maxFiles 100000 Maximum number of files included in a single scan
maxGroups 500 Maximum number of duplicate groups displayed (sorted by reclaimable space)

If scanning a large directory takes too long, you can use minFileSize or maxFiles to narrow the scope first.

Typical Usage

Panel

  1. Open the file deduplication panel from the bottom-left corner (or access it via Settings);
  2. Select the root directory to scan and view duplicate groups and reclaimable space;
  3. Check the redundant copies you want to handle: move them to quarantine, or permanently delete them via the panel after secondary confirmation;
  4. If rollback is needed, restore the corresponding paths from the quarantine area.

Agent Tool Examples

The invocation forms in the README are as follows:

file_dedupe_scan(root="D:\\file store")            → List of duplicate groups + Reclaimable space
file_dedupe_cleanup(scanId="scan-…", paths=[…])    → Move redundant copies to quarantine
file_dedupe_restore(paths=[…])                     → Restore from quarantine

Actual root, scanId, and paths values should be based on the scan results returned.

Applicable Scenarios and Notes

Suitable for: Local libraries, download directories, backup drives, and other scenarios where you need to “find duplicates by content and see how much space can be saved before taking action”; users who want Agents to perform scans and quarantines via DSH conversations.

Important Notes:

  • Deduplication is based on byte-level identity, not “similar files” or “files with the same name”.
  • The plugin reads and writes to the disk with the current DSH process permissions; before installation, please review the source code and the MIT license to ensure the paths and data are acceptable.
  • The README documents that the full workflow (installation, floating button/settings panel, scan → quarantine → restore) has been tested on DSH 0.2.0-rc.2 (Windows Desktop version); other profiles or versions need to be verified independently.

The DSH ecosystem emphasizes “everything is a plugin”; community directories like SkillHub are independent sites and have no official affiliation with DeepSeek or High-Flyer.

Conclusion

dsh-file-dedupe connects “finding true duplicates via SHA-256, calculating reclaimable space, recoverable quarantine, and panel-confirmed permanent deletion” into a reproducible workflow, making it suitable for organizing local disks within the DSH client.

  • Directory Page: https://www.skillhub.cn/plugins/zizhuang/dsh-file-dedupe
  • GitHub: https://github.com/zizhuang/dsh-file-dedupe
羽毛球分组比赛记分
小程序二维码

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

Xiaoye