The way to update charge density in SCF loop

I have found out that many third party programs use/interface with Siesta such that they update the charge density at every iteration of SCF loop. For instance, DMFTwDFT and TransSIESTA insert extra loop of computations inside the SCF loop. How do they do it? Is there a standard way/interface to do it? Which file should I look at in order to make my own extension that updates charge density at every SCF loop iteration?