The goal of buggy is to help users understand and address error messages using LLMs. With the tool enabled, errors raised to the user are accompanied by clickable links to “explain” or “fix” the issue. Explanations are printed to the console while fixes implement changes directly; in both cases, the model is supplied context about the files you’re working in and the functions you’re working with.
You can install the development version of buggy like so:
pak::pak("simonpcouch/buggy")
To enable buggy, call buggy::buggy_enable()
. To always have buggy
enabled every time you start R, you could add buggy::buggy_enable()
to
your .Rprofile
, perhaps with usethis::edit_r_profile()
.
In the following example, I make a mistake when plotting mtcars:

Upon seeing the error, I click the “explain” link and, after wrapping my head around the issue, allow the model to “fix” it. Once the model fixes the code, it runs correctly.
I’d tossed this package idea around with various folks over the last few months before deciding to give it a go: namely, Barret Schloerke and Joshua Yamamoto.