About this mod
Warhorse has fixed the issue, this tool is here for reference only.
- Requirements
- Permissions and credits
- Changelogs
- Donations
Special thanks to everyone on KCD2 discord who assisted me in investigating the issue.❤️
Click to Donate
Click for FAQ in the comments
Made with python.
Thank you to 7H3LaughingMan for creating a more convenient and very nice context menu tool. You are a legend.
Click here for my Github repo if you want to verify the source code
Click here for 7H3LaughingMan's Repo
NEW AUTOCLEANER VERSION OUT!!

Whats the new Autocleaner version? simple to use program that stays in your system tray and automatically cleans your saves as you play. No more manually cleaning saves, this cleans it automatically for you!
2 versions:.exe Tool Installer.ps1 powershell
(old exe with virus warning file can be found in optional files, Use executable version with wine if you are using Linux)
INSTRUCTIONS:
DO NOT CLICK CONTINUE GAME USE LOAD INSTEAD!!!
Tray Version instructions:
Before you use this, download and install .NET 8.0 Click Here
1. Download the .exe and Open the file
2. Saves will be automatically cleaned as long as the tool is open, you can see on system tray

3.

3.5 (If you are using Tool for the first time) Run clean all saves now, to fully clean all saves before playing and keep the tool open while you play in the future to make sure every save file is cleaned.
4. Close the program by clicking exit or searching ModlistCleanerTray in task manager.
5. If it did not work, or you get error, check ModlistCleanerTray.log and see what happened, you can also send it to comments if you want troubleshooting help.
Rightclick Version instructions:
Note: this version can be uninstalled from your pc at anytime in programs and apps.
1. Install the tool (a command window will pop up and vanish)
1.5 PLEASE CONFIRM THE SAVE NUMBER YOU WANT TO LOAD IN GAME BEFORE CLEANING (ie. the save at the very top in game is autosave270.whs, but you did not read like a idiot and cleaned save268.whs instead). Don't complain in the comments if you did not read this.
2. Right-click on the save file in question and select the "Clean Modlist" option. If you don't see this option you are using the new context menu and will have to hold shift when right-clicking.
Powershell and Executable version instructions:
(in Optional Files)
For powershell you need to run this in admin powershell and rightclick -> properties -> unblock on the script before you run otherwise you will see window open and close:
set-executionpolicy remotesigned

1. Put the broken save (the save with 400 <usedmods> entries NOT the save with 0 data) into [TARGET SAVE]. (saves located in %USERPROFILE%\Saved Games\kingdomcome2\saves\)
1.5 PLEASE CONFIRM THE SAVE NUMBER YOU WANT TO LOAD IN GAME BEFORE CLEANING (ie. the save at the very top in game is autosave270.whs, but you did not read like a idiot and cleaned save268.whs instead). Don't complain in the comments if you did not read this.
2. Choose where the Fixed save goes by clicking browse. (Output will automatically be named the same as the Target save, but can be changed manually)
3. Click 'Run Tool'
Note:
The crash on save issue is caused by the <UserMods> having over 400 entries.
IT DOES NOT MEAN IT CRASHES WHEN YOU'RE USING 400 MODS, IT REFERS TO THE <USEDMODS> XML SECTION IN YOUR SAVE FILE.
The saving system in KCD does not replace these entries if you update a mod, causing the save file eventually to corrupt and cause a heap corruption crash upon saving again.
On loading/saving, there is a chance the entire <UsedMods> gets duplicated, this can also contribute to the save eventually reaching 400 entries and crashing.
This tool sort of fixes this issue by Clearing <UserMods> entirely from save while maintaining the binary structure so you can load it. However until warhorse fixes the bugs that cause your save to be piled with <UserMods> duplicate entries, you will have to occasionally run this tool a few times. You can check your own save with a plaintext editor.