File Sorter for Openclaw

An intelligent command-line utility for automated file categorization based on customizable rules such as type, size, and date.

utopiabenben
v1.0.0
Mar 7, 2026
0
983
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install file-sorter

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install file-sorter using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is File Sorter?

File Sorter is a robust utility designed to eliminate digital clutter by automatically arranging files into a structured directory hierarchy. By leveraging Openclaw Skills, this tool provides a developer-friendly way to manage large volumes of data, such as bloated downloads folders, photo archives, or document libraries.

The tool is built with a safety-first mindset, offering a preview mode to visualize changes before they occur and an undo function to revert operations. It supports flexible operations including moving, copying, or symlinking files based on sophisticated metadata analysis.

File Sorter Use Cases

  • Automatically organizing a messy Downloads folder into categorized subfolders like documents, images, and installers.
  • Archiving photography collections into a chronological folder structure based on creation or modification dates.
  • Identifying and isolating large files across a filesystem to assist in disk space management.
  • Sorting source code files and assets by extension for better project structure.

How File Sorter Works

  1. The agent scans the specified source directory to index all available files.
  2. It evaluates each file against defined rules such as file extension, size thresholds, or timestamp metadata.
  3. A preview report is generated, showing the intended destination for each file to ensure accuracy.
  4. Upon confirmation, the skill executes the filesystem operations (move, copy, or link) as specified.
  5. Transaction logs are maintained to allow for a complete rollback of the last organization session.

File Sorter Setup

To utilize this skill within your Openclaw Skills environment, you can trigger organization directly via the CLI. For persistent settings, create a .file-sorter.json configuration file in your project root:

{
  "output_dir": "~/Sorted",
  "action": "move",
  "categories": {
    "documents": [".pdf", ".doc"],
    "images": [".jpg", ".png"]
  },
  "size_rules": {
    "small": [0, 1048576],
    "medium": [1048576, 104857600],
    "large": [104857600, null]
  },
  "backup_original": true
}

Run the basic organization command:

file-sorter organize ~/Downloads --by-type --output ~/Sorted

File Sorter Data Schema & Taxonomy

File Sorter generates a predictable directory taxonomy based on the active sorting rule. The following table describes the organizational output:

Rule Type Folder Logic Metadata Used
--by-type extension-based groups file suffix (e.g., .pdf, .jpg)
--by-size small/medium/large labels file size in bytes
--by-date YYYY/MM/DD structure creation or modification time

Additionally, a hidden log file is maintained in the output directory to map original paths to new locations for recovery purposes.

File Sorter Advanced Features

  • Preview mode (--preview) for risk-free dry-runs of complex organization tasks.
  • Support for multiple filesystem actions: move, copy, or create symbolic links.
  • Transactional undo capability to restore files to their original locations.
  • Customizable size thresholds and file extension categories via JSON configuration.
  • Rule prioritization logic that resolves conflicts when multiple sorting criteria are present.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*