My experience using Claude Code for robotics from the advice of r/robotics
Hey r/robotics community,
A couple weeks back, I asked about how you all were managing AI development in robotics and I got a bunch of great responses. To summarize:
My problems
- ROS 1 and ROS 2 commands/syntax, Gazebo versions, are consistently confused by Claude Code
- Claude doesn't really understand the asynchronous messaging structure or any runtime-specific errors/bugs I may run into due to its code
- The changes Claude Code makes during my development often lead my code in the wrong direction, making debugging take even longer
Your solutions
- Many of you mentioned building custom tooling and skills really helps Claude orient itself
- Supplying your own context and description of the repository and standardizing it across claude sessions using an `ARCHITECTURE.md` / `CLAUDE.md` also really helps
- Minimal working examples are also very helpful. Having somewhere Claude can turn to and say, "this is a simple example of how things are supposed to work" helps the agent orient itself
I implemented four changes into my setup:
- Custom MCP tools and skills
- Supplying context from my own repository
- Supplying minimal working examples I made myself and found off the internet
- Supplying documentation relevant to my software stack. For me, that was ROS 2 Jazzy, Gazebo Harmonic, PX4, and Nav2
After making these changes, I've seen a pretty sizeable increase in my development speed using AI in robotics.
Previously, I was trying to fill my context window with the code I've already written, but that seemed to not be enough context for Claude to actually understand the software architecture or data pipeline in my codebase. With the changes I've mentioned above, I actually noticed that I can let Claude develop new nodes and software. There's significantly less problems when integrating Claude's code and existing code from what I've seen so far.
One thing that was always an annoyance for me was Claude's lack of understanding of what was ROS 1 and what was ROS 2. I ended up creating a RAG database that can input relevant documentation for whatever Claude was working on and that's worked incredibly well. With this in pairing with some custom tool calls I've made, my setup no longer has any confusion on what's ROS 2 and what commands I have access to running ROS 2 Jazzy and Gazebo Harmonic in particular.
Thanks for all of your help! I thought I'd leave this post here for those who may also run into something similar trying to use Claude Code for robotics. I'm considering even doing some custom evals for this setup on robotics-specific coding problems because of how much more consistent this setup seems to be. If anyone's already done something similar to this, would love to hear about it in the comments. Cheers!