Hi Witty,
I will add to Jonathan's excellent answer.
AiiDA does not explicitly track or maintain all files in the remote
folder of calculations.
It is the plugin that decides which files are retrieved and
permanently stored by AiiDA in the `retrieved_folder`.
If all the files you need are in the `retrieved_folder` you can
safely delete the remote folder contents.
Note the easiest way to do this is
calculation = load_node(PK)
calculation.outputs.remote_folder._clean()
Note that this will need to connect to the remote computer, so if it
is remote, you need to have internet connection.
Note also that many of the base workchains do this automatically,
unless you specify `clean_workdir = False` in the inputs.
Finally, many plugins will not retrieve all files (such as
`PwCalculation` for example) because not all files are necessary for
reproducibility.
For example they will delete temporary files, but these
might
be necessary for restarts.
This is the case of `PwCalculation` for example: if you clean its
`remote_folder` you can no longer use it for restarts.
Again, all of this is decided by the plugin and so is plugin
dependent so I cannot give a general answer.
Hope that helps,
Sebastiaan