Frédéric, this is a good question, and I'm glad to hear you're still working on the runMCMCbtadjust package.
Nice investigation into runMCMC. Yes, the chain number is passed to the core MCMC run method (mcmc$run) on each chain. This is a very recent change to the MCMC system. Accompanything this change, all MCMC samplers were also given the ability (although not the requirement) to execute their own "before_chain" and "after_chain" methods, prior to, and immediately following each MCMC chain. Not all - in fact very few - MCMC samplers make use of these methods. And furthermore, the number of MCMC iterations, and the chain number, and the burnin interval are all passed along as arguments to each before_chain method, in case the samplers could make use of this information (thus providing some description of the overarching MCMC run). At present, I believe the only place this "chain number" information is used, is in the before_chain methods of the HMC samplers provided in the nimbleHMC package. In those, if (and only if) chain==1, the other contextual information (niter, and nburnin) are used to dynamically set the HMC warmup period, which is thereafter used for all MCMC chains. So, in a modest paragraph, that's the reason the chain number is passed to mcmc$run, and where it goes from there.
Keep in touch with any other questions, cheers,
Daniel