Critical: RStudio deleted my whole project after becoming unresponsive while using PositAI

I was editing a script while Posit Assistant (Claude via API key) worked on it, and the R process became unresponsive. R was becoming unresponsive frequently due to a Shiny app issue I was diagnosing. It's common for R to become unresponsive and RStudio offering to terminate R when running a Shiny app in quick sucession. While I was editing the file, Posit Assistant added changes to the same file, too. I was pressing cmd+Z and shift+Z to undo/redo some changes, until RStudio threw an error about being unable to save the file. Meanwhile, the R console was waiting for some tests that Posit Assistant requested. I tried to save the file and couldn't, so I stopped the R process, tried to save again, and this being a common occurence (RStudio throwing errors about not saving files) I copied the script then restarted the whole R Session, and when RStudio restarted, a different project was opened. That was the first "uh oh" moment. So I go and check, and voilá, no files in my project, not even a .RProject file, only .Rhistory showing the last commands the AI tried to run, which were:

runApp()
runApp()
runApp()
runApp()
local({
library(arrow); library(sf); library(dplyr)
t0 <- Sys.time()
d <- read_parquet("datos/proyectos_subdere_geo.parquet")
t1 <- Sys.time()
d <- d |> mutate(geometry = st_as_sfc(geometry)) |> st_as_sf()
t2 <- Sys.time()
message("lectura: ", round(t1 - t0, 2), " s; sfc: ", round(t2 - t1, 2), " s")
message("filas: ", nrow(d), "; columnas: ", ncol(d))
message("comuna: ", sum(d$estado_geo == "comuna", na.rm = TRUE))
print(sapply(sf::st_drop_geometry(d), \(x) class(x)[1]))
t3 <- Sys.time()
gj <- geojsonsf::sf_geojson(d)
t4 <- Sys.time()
message("geojson completo: ", round(nchar(gj) / 1e6, 1), " MB en ", round(t4 - t3, 2), " s")
cols <- c("id","nombre","inversion"="APORTE_SUBDERE_INICIAL","año","programa","nombre_comuna","nombre_region","sp_superpuesto")
gj2 <- geojsonsf::sf_geojson(d |> select(any_of(cols)))
message("geojson columnas mínimas: ", round(nchar(gj2) / 1e6, 1), " MB")
message("geometrías vacías/NA: ", sum(st_is_empty(d)))
print(table(st_geometry_type(d)))
})
local({
library(arrow); library(geoarrow); library(sf); library(dplyr)
t0 <- Sys.time()
d <- read_parquet("datos/proyectos_subdere_geo.parquet") |>
mutate(geometry = st_as_sfc(geometry)) |> st_as_sf()
message("lectura + sfc: ", round(difftime(Sys.time(), t0, units = "secs"), 2), " s")
message("filas: ", nrow(d), "; columnas: ", ncol(d))
message("comuna: ", sum(d$estado_geo == "comuna", na.rm = TRUE))
print(sapply(st_drop_geometry(d), \(x) class(x)[1]))
t3 <- Sys.time()
gj <- geojsonsf::sf_geojson(d)
message("geojson completo: ", round(sum(nchar(gj)) / 1e6, 1), " MB en ",
round(difftime(Sys.time(), t3, units = "secs"), 2), " s")
cols <- c("id","nombre","APORTE_SUBDERE_INICIAL","año","programa","nombre_comuna","nombre_region","sp_superpuesto")
gj2 <- geojsonsf::sf_geojson(d |> select(any_of(cols)))
message("geojson columnas mínimas: ", round(sum(nchar(gj2)) / 1e6, 1), " MB")
message("geometrías vacías: ", sum(st_is_empty(d)))
print(table(st_geometry_type(d)))
print(sort(sapply(st_drop_geometry(d), \(x) sum(nchar(as.character(x)), na.rm = TRUE)) / 1e6, decreasing = TRUE)[1:6])
})

Nothing there aims for AI's fault deleting files. This is probable a read/wrote issue with RStudio under dire conditions. I have all backed up on Git, so this made me lose very little work, but it's really concerning that my whole project can just simply disappear after R gets frozen.

More info: I'm on R 4.6.1, and RStudio 2026.10.0+233 "Blue Mistflower" Release (e961c6137d92315437caf5af53959f7110b517f9, 2026-10-14) for macOS
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2026.10.0+233 Chrome/150.0.7871.250 Electron/43.7.7 Safari/537.36, Quarto 1.9.37 (/Applications/quarto/bin/quarto), Posit Assistant 1.9.0

Sorry for the delayed response, and very sorry you encountered this problem! Glad to hear you didn't lose much work.

Our initial research into this hasn't nailed down a potential cause. If you can, could you send me your logs? You can email to me directly (gary@posit.co) or share via a cloud drive, etc.

In RStudio, Help menu > Diagnostics > Show Log Files.

Ideally we'd want the positai.log file, and all the rsession-*.log files. You'll need to skim these and make sure you're not sharing anything sensitive.

Also, was the folder on a cloud drive, e.g. iCloud, Dropbox, OneDrive?