Several people have commented that save-export-clean saves only the current layer. If there are multiple layers and we're saving to a format other than XCF, we should flatten. Preferably without pestering the user with dialogs, because if we're saving to jpg, of course we want to flatten, duh!