Skip to main content

Taming Digital Chaos: My Journey Creating Gorgon, A Digital Organizer That Actually Works

·1750 words·9 mins·
Author
Brian Ritchie
Table of Contents

Two Thursdays ago, at approximately ‘ungodly hour’ in the AM, I found myself staring into the digital abyss of my Downloads folder. 1,728 files, over 200GB strong and growing like some digital fungus, completely immune to my occasional half-hearted attempts at organization. It was during this late-night confrontation with my own digital hoarding tendencies that I realized something had to change.

This wasn’t just about tidiness. This was about reclaiming mental bandwidth.

The Real Cost of Digital Clutter
#

We don’t talk enough about the cognitive tax of digital disorganization. Every time I needed to find a specific document, my brain would burn precious glucose trying to remember: Did I save that contract as “Contract_Final” or “Agreement_v2_FINAL_actually_final”? Is it in Downloads, Documents, or that random folder I created during a fleeting moment of organizational ambition?

The mental cost of this chaos accumulates silently but relentlessly. I began to suspect that my digital disorganization was actually making me worse at thinking clearly about everything else. “The art of being wise is the art of knowing what to overlook.” ~ William James, but when your digital life forces you to overlook everything because finding anything is impossible, wisdom becomes elusive.

Standard Organization Tools Fell Short
#

I’ve tried them all:

  • The “sort everything manually when I have time” approach (spoiler: that time never comes)
  • The “create an elaborate folder hierarchy” method (ain’t nobody got time for that)
  • Various apps promising one-click organization (they always seem to create more problems than they solve)

The fundamental issue? These solutions don’t scale with the exponential growth of our digital footprints, and they don’t adapt to the diverse types of content we accumulate. Most importantly, they don’t learn from our implicit organizational patterns.

Introducing 👾 Gorgon
#

Advanced Rules
#

Having worked alot with data, ‘organization’ oddly was my forte, except when it came to my own files apparently - but I of course realized that organization shouldn’t purely be about destinations (folders) but also account for patterns and relationships.

Insert the conceptual advanced rules system of Gorgon.

It’s built on three core principles:

  • Files contain their own organizational metadata — either explicitly in their names and types, or implicitly in their content
  • Organization should be automatic but transparent — you should be able to understand why a file went where it did
  • Rules should be composable and priority-based — allowing complex behaviors to emerge from simple building blocks

Here’s an example of the advanced rules system that still makes me smile with a touch of nerdy pride:

# Date-based organization for invoices with automatic folder structure
- regex_pattern: "invoice_(?<year>\\d{4})-(?<month>\\d{2})-(?<client>[A-Za-z]+)\\.pdf"
  destination: "Finance/Clients/${client}/${year}/${month}"
  priority: 50
  rename_pattern: "${client}_invoice_${year}${month}.pdf"
  
# Content-aware classification
- content_patterns: 
    - "CONFIDENTIAL"
    - "NOT FOR DISTRIBUTION"
  destination: "Private/Confidential"
  priority: 100 # Higher priority to ensure sensitive documents are handled first
  
# Smart handling of screenshots with date extraction
- pattern: "Screenshot*"
  destination: "Screenshots/${datetime|format=%Y/%m}"
  rename_pattern: "screenshot_${datetime|format=%Y%m%d_%H%M%S}.${ext}"
  priority: 20

This isn’t just about moving files to folders anymore. This is about understanding what files are and what they mean to me. The system can extract dates from filenames, categorize based on content, and even rename files according to consistent patterns.

Content Awareness: The Digital Sniffer Dog
#

While pattern-matching on filenames is powerful, some of my most treasured files don’t have easily identifiable names. That’s where content awareness comes in:

// Check content patterns
if len(rule.ContentPatterns) > 0 {
    if fileInfo.ContentSample == nil {
        return false
    }

    for _, pattern := range rule.ContentPatterns {
        if !bytes.Contains(fileInfo.ContentSample, []byte(pattern)) {
            return false
        }
    }
}

This seemingly simple snippet lets Gorgon peek inside files to understand what they are. In practice, this means I can have rules like:

# Find research papers about machine learning
- content_patterns: 
    - "neural network"
    - "deep learning"
  destination: "Research/AI"
  priority: 25

# Identify personal documents
- content_patterns:
    - "SOCIAL SECURITY"
    - "CONFIDENTIAL"
  destination: "Personal/Important"
  priority: 100

This has helped me rediscover forgotten documents and research papers that would have remained buried in digital obscurity, their filenames giving no hint of the treasures within.

The Joy of Watching It Work
#

There’s something oddly satisfying about watching Gorgon process a chaotic Downloads folder. Files begin to flow to their appropriate destinations like a well-choreographed dance. Bills nest themselves in year/month hierarchies, screenshots organize by date, and confidential documents sequester themselves away from casual browsing.

I added a little progress bar because, let’s face it, we all love watching progress bars. It’s like watching order emerge from chaos in real-time, a small digital version of the universe organizing itself according to elegant laws.

That first time I ran it against my test folder and saw tonnes of files find their proper homes in miliseconds—I felt like I’d hacked reality itself. A disorganized digital space that had mentally weighed on me for years, suddenly transformed in seconds.

Safety Net: Undo Transactions (“Phew”)
#

From the very beginning of designing the app, I wanted file ops to have an equally powerful safety mechanism. Having experienced data loss from other tools in the past, I was determined to build undo functionality directly into the core architecture—not as an afterthought.

Before writing a single line of code that would move files, I designed the transaction system. My thinking was clear: any tool with the power to reorganize thousands of files must also have the capability to reverse those changes with perfect fidelity. Power without reversibility isn’t real power—it’s just another form of chaos.

This guiding principle resulted in what has become my favorite feature: the transaction-based undo system. Every single organization operation gets recorded with meticulous detail:

// Transaction represents a group of file operations that can be undone
type Transaction struct {
    ID          string    `json:"transaction_id"`
    Timestamp   time.Time `json:"timestamp"`
    Entries     []Entry   `json:"entries"`
    Description string    `json:"description,omitempty"`
}

// Entry represents a single file operation in a transaction
type Entry struct {
    OriginalPath string    `json:"original_path"`
    CurrentPath  string    `json:"current_path"`
    Timestamp    time.Time `json:"timestamp"`
    Renamed      bool      `json:"renamed,omitempty"`
}

With a simple command, you can reverse any organization session, down to specific transactionIDs in an auto-rotated and configurable log file:

gorgon undo

This seemingly simple feature transformed how I interact with Gorgon. Instead of tiptoeing around organization out of fear of losing something important, I can be bold. Organize everything, knowing I can always step back if needed. It’s like having an organizational superpower with an emergency exit.

The implementation was tricky—especially handling cases where files might have been moved multiple times or renamed—but the peace of mind it provides has been worth every line of code.

Parallel Processing: Because Time Is Still Finite
#

Another favorite feature emerged when I tested Gorgon against my entire screenshot and photo collection—over ’too many thousand’files. The first run took too long, which felt like watching paint dry (if the paint also occasionally asked for your attention to handle conflicts).

The solution? Go’s concurrency primitives came to the rescue:

// Start workers
for i := 0; i < workers; i++ {
    wg.Add(1)
    go worker(tasks, results, &wg)
}

// Send tasks to workers
for src, destSubdir := range files {
    filename := filepath.Base(src)
    fullDest := filepath.Join(baseDest, destSubdir, filename)

    tasks <- WorkerTask{
        Source:      src,
        Destination: fullDest,
    }
}

This worker pool pattern transformed the processing time from minutes to just under a second on my machine. There’s something deeply satisfying about watching all your CPU cores light up to 100% while your computer furiously organizes thousands of files in parallel.

It reminds me that we often accept unnecessary slowness in our tools. When you’re trying to organize your digital life, waiting half an hour for a batch process feels like a punishment. Making it fast enough to run in the background while you grab a cup of coffee changes the entire experience.

Plugins - Experimental Feature WIP
#

While the core of Gorgon satisfies my organizational needs, I’ve started experimenting with a plugin system to extend its capabilities.

Overly commented example below:

// FileMatcher defines a plugin interface for custom file matching logic
type FileMatcher interface {
    GorgonPlugin
    
    // MatchesFile determines if this plugin should process the given file
    MatchesFile(filePath string, info os.FileInfo) bool
    
    // DestinationForFile returns the destination subdirectory for a matched file
    DestinationForFile(filePath string, info os.FileInfo) string
}

This opens up endless possibilities. Imagine plugins that could:

  • Analyze images to sort screenshots by subject matter
  • Process audio files to organize music by genre, and audio quality
  • Extract metadata from academic papers and past markdown notes to build a KB

The plugin system is still experimental, but it represents what excites me most about this project: the potential to evolve from simple file organization into intelligent digital curation.

Why This Matters Beyond Organization
#

Building Gorgon’s advanced rules system has taught me something about how we relate to our digital lives. We often accept digital friction as inevitable—the searching, the forgetting, the clutter. We adapt ourselves to our tools rather than demanding our tools adapt to us.

But it doesn’t have to be this way.

The rules-based approach isn’t just about tidying up; it’s about creating a system that encodes your organizational intent. It’s about teaching your computer to understand how you think about your information, rather than you adapting to rigid folder hierarchies.

I sometimes wonder what other areas of our digital lives are ripe for this kind of rethinking. Where else are we accepting unnecessary friction? Where else could we create systems that work with our cognitive patterns rather than against them?

Where This Goes From Here
#

Gorgon remains a personal project, something I built to scratch my own organizational itch. While it’s designed with open-source principles in mind, I haven’t yet taken the step of making it publicly available. It’s still my digital workshop, a place where I experiment with ideas about organization and automation.

If you’re facing similar challenges and are curious about my solution, feel free to reach out. I’m considering opening it up more widely if there’s genuine interest. After all, the best software grows from real needs shared by real people.

For now, I’ll be enjoying a Downloads folder that, for the first time in a while, will contain only downloads from today - everything else has found its rightful place through the magic of patterns, rules, and a bit of coding persistence.

As Borges wrote in “The Library of Babel”, “The universe (which others call the Library) is composed of an indefinite, perhaps infinite number of hexagonal galleries…” My digital universe finally has its galleries properly labeled, and the mental space that has freed up feels nothing short of revolutionary.