What is the version of xEdit you are using?
SSEEdit 4.0.3h (Hotfix 1) (74B3720F)
Describe the bug
When "Clean Masters" removes all masters (due to it being a archive loader plugin or only having things like new keywords), xEdit re-adds Skyrim.esm as a master.
To reproduce
Steps to reproduce the behavior:
- Copy some Keyword records from Skyrim.esm as New Records into a new plugin
- Save the plugin, then use "Add Masters" to add Skyrim.esm as a master and save.
- Relaunch xEdit, then run Clean Masters.
- Save and relaunch xEdit.
- The Messages tab will show Skyrim.esm being added as a master, and the new records will now show as overrides or injected records for Skyrim.esm.
Also included test plugin. Using it, you would start at step 3
CleanMastersTest.zip
Expected behavior
xEdit leaves the plugin with no masters, or failing that, properly adds the master in a way that updates internal formIDs.
Screenshots

Additional context
Confirmed that the same issue happens with Fallout 4 if the plugin is set to have a File version of <1.0. Have not tested with other games, but is likely the same.
When the File version is 1.0, Fallout4.esm is not removed because 00000000 (File Header) is treated as a reference to Fallout4.esm (and shows as a could not be resolved error if the plugin has no masters).
What is the version of xEdit you are using?
SSEEdit 4.0.3h (Hotfix 1) (74B3720F)
Describe the bug
When "Clean Masters" removes all masters (due to it being a archive loader plugin or only having things like new keywords), xEdit re-adds Skyrim.esm as a master.
To reproduce
Steps to reproduce the behavior:
Also included test plugin. Using it, you would start at step 3
CleanMastersTest.zip
Expected behavior
xEdit leaves the plugin with no masters, or failing that, properly adds the master in a way that updates internal formIDs.
Screenshots

Additional context
Confirmed that the same issue happens with Fallout 4 if the plugin is set to have a File version of <1.0. Have not tested with other games, but is likely the same.
When the File version is 1.0, Fallout4.esm is not removed because 00000000 (File Header) is treated as a reference to Fallout4.esm (and shows as a could not be resolved error if the plugin has no masters).