- I was loving Claude Code... until I tried it with #rstats. Constant errors, wouldn't use the tidyverse even when asked, "optimized" functions were slower. Frustrated, I started a session just to teach R to Claude and summarize what it learned into a CLAUDE.md file gist.github.com/sj-io/3828d6...
- I gave it only pages from official tidyverse docs, vingettes, blog posts, style guide, and excerpts from R for Data Science and Advanced R. I asked it to not only summarize the files but also make sure it knew *when* to use tidyverse over base R.
- I placed this into a project I was trying to debug and the results were 1000x better, truly night and day. I'm no longer having to teach it R while trying to work. It can make modern functions in one attempt, benchmark code, add parallelization.
- The file is long, but large chunks can probably be removed depending on your use. I needed help with package development, so I fed it a bunch of rlang pages. Also added things I'm less familiar with, like vctrs and s7, so maybe it can help me improve in the future. (& lmk if you see something wrong)
- I saw others suggesting this idea but I hadn't seen anyone share a CLAUDE.md or similar file. This might also be fixed if you use the API and MCP, but I'm already paying for Claude Code. also there's no ggplot, lubridate in the file but you can always ask Claude to update the file with new docs.Aug 21, 2025 10:18