Access values of the parameters at each draw

Do you need to be running the other program in real-time during sampling? If not, it would be easier to just save your posterior trace as data and load it into your other program after you’re done sampling.

It should be possible to do stuff at each MCMC iteration by writing a custom step function; see here. @ricardoV94 would know more. But I think you might be doing too much work for what you really need at that point.