# auto-sort

> A content-aware file organizer that identifies, sorts, and de-duplicates files with a transactional undo ledger.

auto-sort is a free AI agent skill on Agensi by snepssen, in Workflow Automation. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [snepssen](https://www.agensi.io/creators/snepssen)
- Category: [Workflow Automation](https://www.agensi.io/skills/workflow-automation)
- Version: 1.2
- Last updated: 2026-11-22
- Security: scan passed (2026-11-22); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/auto-sort
- Tags: automation, python, productivity, file-management, cli

## About this skill

Managing a cluttered Downloads folder or a disorganized backup drive usually involves manual drag-and-drop or fragile shell scripts based on file extensions. This skill gives your agent [auto-sort](https://github.com/snepssen/auto-sort), an open-source tool that organizes files based on their actual contents, headers, and metadata.

The skill itself is just instructions. When a task needs the tool, your agent fetches the pinned v0.9.1 release from GitHub, checks it against a fixed commit hash or SHA-256, and runs it locally.

### What it does
- **Content identification** reads file signatures, EXIF data, and PDF text to determine file type regardless of extension.
- **Rule-based sorting** moves files into a structured hierarchy defined by a customizable configuration file.
- **Safety-first execution** records every move in a SQLite ledger, avoids overwriting files, and verifies content hashes.
- **Duplicate detection** identifies byte-identical copies and offers to move spares to the system Trash.
- **One-command undo** restores files to their original locations after verifying they have not been modified.

### How it works
1. **Fetch.** The agent downloads the pinned release into a temporary folder and verifies it.
2. **Scanning.** It runs `scan` to list folder contents, or `explain` for a deep dive into one file's metadata and origin.
3. **Configuration.** `init` writes a starter rules file; `propose` suggests rules fitted to the folder.
4. **Dry run.** Every sort starts with a `--dry-run` preview of the planned moves.
5. **Execution.** The plan is applied with `--apply` only after you approve it, and can be undone with `undo last`.

### Frameworks & tools
auto-sort is built with Python 3.8+ using only the standard library. It uses tesseract for OCR, ffprobe for media metadata, and exiftool for RAW camera formats when they are installed.

### Why this beats prompting it yourself
Prompting an LLM to organize files often results in generic scripts that fail on varied file types or risk data loss via overwrites. This skill provides a transactional ledger and content-aware identification that generic code generation lacks.

### Use cases
- Clean up a bloated Downloads folder into sorted categories.
- Consolidate old backups while clearing exact duplicates.
- File scanned letters, statements and bills by what the documents say they are.
- Recover from a sorting mistake with the built-in undo.

### Known limitations
Needs a one-time download from GitHub when first used in a session. Moves files only after a preview you approve; it is not a backup tool. Without the optional programs, scanned pages and unusual camera or media formats are identified by file type only, and the tool says so. Duplicate detection ignores files under 4 KB. The skill does not set up auto-sort's background service; use the project's own installer for that.

## Requires

- Python 3.8+
- Git
- curl
- Optional: tesseract (OCR, not needed on macOS)
- Optional: ffprobe
- Optional: exiftool

Runs on macOS, Linux and Windows. The skill fetches the open-source auto-sort v0.9.1 release from GitHub only when a task needs it, verifies it, and runs it locally.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the auto-sort skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does Auto Sort differ from a standard file-sorting script?

Unlike standard scripts that rely on file extensions, Auto Sort performs deep content analysis using EXIF data, PDF text, and file headers to accurately categorize files even if they are misnamed or missing extensions.

### What safety measures are in place to prevent accidental data loss?

The skill includes a 'Dry Run' mode to preview all changes before execution and a transactional SQLite ledger that allows you to undo any sorting operation with a single command.

### What are the technical requirements for running this skill?

Python 3.8 or newer, plus git (or curl and tar) for the one-time fetch of the pinned release. tesseract, ffprobe and exiftool are optional and only improve identification. It runs on macOS, Linux and Windows with any agent that can run shell commands.

### Can I customize the rules for how my files are organized?

Yes, the 'propose' command allows the agent to analyze your directory and suggest a custom configuration file, which you can then refine to match your specific organizational preferences.

### How does the duplicate detection feature work?

The skill identifies byte-identical copies using content hashes and provides a safe option to move duplicates to the system Trash rather than deleting them permanently.

### What is in the package?

Instructions only: a SKILL.md that tells your agent how to fetch the open-source auto-sort v0.9.0 release from GitHub, verify it against a fixed commit hash or SHA-256, and use it safely (preview first, apply only with your approval, undo available). Nothing is bundled, and your rules and the move ledger stay on your machine.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
