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

My AI agent kept saying the job was done. So I made it prove it.

I am using Claude Code to generate parts and export them as STEP files for SolidWorks — actual B-rep solids, not STL meshes.

Most of the time, it works surprisingly well. The problem is the failures that look like successes.

I was building a 94 × 65 × 26 mm enclosure with 2.5 mm walls. The script ran cleanly, printed `[OK]`, and the STL preview looked exactly like a hollow enclosure.

It wasn't hollow.

The part contained about 158,048 mm³ of material. Based on the dimensions, it should have been around 33,370 mm³.

`IsValid()` still returned `True`.

OpenCASCADE had silently failed to shell the part and handed back what was basically the original solid brick.

That made me stop trusting “the script ran” as evidence that the CAD was actually right. So I built a Claude Code skill that adds verification before export.

It checks things like:

* **Expected volume** derived from the dimensions in the design, not from the generated geometry. In the enclosure case, the result was off by about 4.7×, so you don't need a tight tolerance to catch the failure.

* **Bounding box** against the dimensions the part is supposed to occupy.

* **Point classification** at coordinates that should contain material or empty space. This caught another case where a port was cut into the wrong wall. Validity, solid count, and overall volume all still looked reasonable because the cut itself was the right size — just in the wrong place.

* **Known OpenCASCADE failure modes**, with repro cases checked against the current CadQuery/OCP version instead of assuming old behavior still applies.

The workflow is basically:

describe the part in plain English → Claude writes the CadQuery → it asks when important dimensions are missing instead of making them up → checks the resulting geometry → exports STEP only after the checks pass.

I also tested a separate malformed STEP where the reported solid volume was physically larger than its own bounding box could contain. SolidWorks opened it without an error dialog or Import Diagnostics complaint. So “SolidWorks opened it” isn't much of a verification strategy either. One thing I wanted to avoid was fake verification where the script measures its own result and then asserts that the result matches what it just measured.

The expected values here are derived from the design constraints you gave it.

Otherwise you're just letting the model grade its own homework.

reddit.com
u/panda0_o_0 — 13 days ago