If you don’t mind using cmdstan, it manages this kind of situation better from my experience. Even if R session is aborted after completing a big model, you can still extract the posterior from csv files. I usually specify csv names and the saving folder manually, then extract posteriors using the following code. You can extract parameters of interest according to the task (e.g., loo or posterior predictive simulation) and RAM limitation. This is also faster to load draws comparing the default method when model is big, details can be found here Summary method slow for large models
extract_fit <- function(fit) {
cmdstanfiles <- list()
for (f in fit$output_files()) {
cmdstanfiles[[f]] <- data.table::fread(cmd = paste0("grep -v '^#' --color=never ", f))
}
draws_fit <- cmdstanfiles %>%
bind_rows() %>%
dplyr::select(-starts_with(c("parameters of interest"))) %>%
as_tibble()
return(draws_fit)
}