r/cadquery

Claude Code kept giving me CAD that looked finished. I stopped trusting “done.”
▲ 4 r/cadquery+1 crossposts

Claude Code kept giving me CAD that looked finished. I stopped trusting “done.”

I am using Claude Code to generate CadQuery parts and export STEP files for SolidWorks.

Honestly, it works better than I expected.

I can describe a bracket or enclosure in plain English, answer a few missing dimension questions, and get a real B-rep solid out the other side.

Then I hit a failure that changed how I use it. I was building a 94 × 65 × 26 mm enclosure with 2.5 mm walls.

The script ran cleanly.

It printed `[OK]`.

The STL preview looked like a perfectly normal hollow enclosure.

`IsValid()` returned `True`.

Except the enclosure wasn't hollow.

It contained about 158,048 mm³ of material. From the dimensions, the walls should have been around 33,370 mm³.

OpenCASCADE had silently failed to shell the part and effectively returned the original solid block. Claude had no obvious reason to think anything was wrong.

So I built a Claude Code skill that adds verification to the modeling workflow before export.

It checks:

* volume against a range derived from the dimensions I asked for

* bounding box against the intended envelope

* solid count and B-rep validity

* specific coordinates that should be material or empty space

That last one caught a different bug where a port was cut into the wrong wall. The model was still valid, still one body, and had basically the right volume. The feature was just in the wrong place.

The workflow now is roughly:

plain-English part description → Claude writes CadQuery → asks about missing dimensions instead of inventing them → builds the part → checks the resulting geometry → exports STEP

One thing I was pretty strict about: the expected values can't just be measured from the generated part and fed back into the assertions.

The 33,370 mm³ expectation, for example, is calculated from the requested enclosure dimensions.

Measuring your own answer and asserting that it equals itself would be verification theatre.

I also tried a separate malformed STEP in SolidWorks. It reported more volume than its own bounding box could physically contain, and SolidWorks still opened it without an error dialog or Import Diagnostics finding.

So I've stopped treating "Claude says done," "the script ran," or even "CAD opened it" as sufficient evidence that the result is right.

Repo if anyone wants to poke at it:

https://github.com/0oKevino0/claude-cad

Free/open source, MIT, single maintainer, very early.

I'd especially like to hear from people using Claude Code for things where a plausible-looking result can hide a bad underlying state. What are you using as your hard check before you trust the output?

u/panda0_o_0 — 13 days ago