Does anyone know of a way of preventing the loss of Apple Diagnostics when performing a clean install of either OS X 10.9 or 10.10? Or restoring it once the installation is complete? I tend to install using a USB recovery stick created by DiskMaker X.

I did read some guidance online somewhere once, but I can't for the life of me relocate it.