Install CleanMCMod

Three things are needed: Fabric Loader, Fabric API, and the CleanMCMod jar built for your exact Minecraft version.

Requirements

What the game needs
ComponentVersion
Minecraft: Java Edition1.21.8, 1.21.9, 1.21.10, 1.21.11 or 26.1, 26.2, 26.3 - see versions
Java21 on 1.21.x, 25 on 26.x (as the game itself requires)
Fabric Loader0.16.0 or newer (0.20.1 is what CI builds against)
Fabric APIrequired at runtime
Mod Menuoptional adds the Config button

Drop the jar in mods/ next to Fabric API. The jar declares environment: client, so a dedicated server ignores it.

In game

Ways to open CleanMCMod
Entry pointWhat it does
F7Opens the main screen from anywhere; rebindable under Controls
Title screen buttonCleanMCMod… in the top right corner, before a world is loaded
/cleanmcmod scanLists every cache present with its file count and size
/cleanmcmod cleanRuns a clean (or a dry run when that setting is on) and reports the totals
/cleanmcmod screenOpens the same screen as F7

The main screen lists each cache with its size, a Dry run line that says nothing will be deleted while that setting is on, and buttons for Clean now, Rescan, Settings… and Update mods….

Settings

Eight toggles, saved to config/cleanmcmod.json the moment you change them:

config/cleanmcmod.json
SettingEffect
Game logsInclude logs/ in a clean
Crash reportsInclude crash-reports/
Debug dumpsInclude the game's debug dump files
Server resource packsInclude the cached server resource pack
Loader and mod cachesInclude the Fabric remapped-jar cache and Mixin debug output
Asset cacheInclude the deep asset cache; the game re-downloads it from Mojang
Mod-cache auto-detectionFind config/<mod>/…/cache folders and treat them as optional targets
Dry runMeasure and report, delete nothing

Build from source

Every version lives on its own branch; the wrapper is checked in, so no Gradle installation is required.

git clone https://github.com/PiBOH/cleanmcmod
cd cleanmcmod
git switch 26.3            # or 1.21.11, 26.1, 1.21.8 ...

export JAVA_HOME=/path/to/jdk-25   # JDK 25 builds every branch
./gradlew clean build              # jar in build/libs/

The artifact is cleanmcmod-<mod version>+<minecraft version>.jar; that file is what gets uploaded to Modrinth.

Java levels: 1.21.x branches compile and run on Java 21, 26.x branches on Java 25. Gradle and Loom always run on JDK 25.

Optional Mod Menu

If Mod Menu is installed, CleanMCMod appears in its list and its Config button opens the settings screen. Mod Menu is compiled against with compileOnly and declared as suggests, never depends: without it the game boots normally and no Mod Menu class is loaded.