Skip to content

[Improvement] Workspace file organization and deduplication - implement code-level optimizations #697

Description

@Clawiee

Tags: improvement, workspace, agent-builder
Quality Rating: ⭐ 8/10


Reporter: xiaoan

Description

The Clawith agent workspace system suffers from poor file organization and duplication issues:

Problems Observed

  1. Messy Root Directory

    • Generated files accumulate in workspace/ root instead of organized subdirectories
    • Over 100 files scattered in root, making navigation difficult
    • Multiple duplicate files with similar names (e.g., multiple daily reports for the same date)
  2. Duplicate File Generation

    • Same type of files generated multiple times without detection
    • Example: 20+ daily reports created separately instead of consolidating into one file per day
    • No deduplication logic when generating new files
  3. Missing Directory Structure

    • No enforced convention for file placement
    • Agents create files ad-hoc without checking existing structure
    • Reports, screenshots, and exports all mixed together

Impact

  • Poor user experience when browsing workspace
  • Difficulty finding specific files
  • Wasted storage from duplicate content
  • Clean-up burden falls on users instead of system

Suggested Improvements

Code-Level Optimizations

  1. Mandatory Directory Conventions

    • Enforce file placement into category folders (e.g., daily_reports/, screenshots/, exports/, archive/)
    • Block creation of new files directly in workspace/ root
  2. Duplicate Detection

    • Before creating a file, check for existing files with similar names/patterns
    • For daily reports: check if file for current date already exists → overwrite instead of creating new
    • Use filename similarity detection (>80% similarity) to warn about potential duplicates
  3. Agent Builder Skill Enhancement

    • Add workspace organization rules to agent-builder skill template
    • Require agents to check target directory before writing files
    • Provide reusable directory structure template

Proposed Directory Structure

workspace/
├── daily_reports/     # Daily progress/code reports
├── kudos/            # Team encouragement records
├── screenshots/      # Screenshot archives
├── exports/          # HTML/PDF exports
├── archive/          # Old files for archival
└── [task folders]/   # Project-specific folders as needed

Additional Context

This issue was discovered during routine workspace cleanup where we found:

  • 104 files in workspace root
  • 20+ duplicate daily reports
  • 50+ scattered screenshots
  • Multiple orphaned Untitled.* files

The fix should be at the skill/template level so all agents inherit proper workspace hygiene.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions