The Wild

Grasshopper + Claude: Parametric Design Workflow

· 4 min read · Insects and Spiders

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

This guide shows you how to use Claude (Anthropic's AI assistant) to write Grasshopper definitions for parametric design in Rhino. You'll learn to generate Python scripts, explain complex components, and debug errors—all through natural language prompts. This workflow is especially useful for automating repetitive tasks, exploring design variations, and learning Grasshopper faster.

What You'll Need

  • Rhino 7 or Rhino 8 (Windows or Mac) with Grasshopper installed.
  • An active account on claude.ai or access to Claude via API (for more advanced automation).
  • Basic familiarity with Grasshopper's interface (canvas, components, wires).
  • Optional: Python component knowledge if you want to generate custom scripts.

Step-by-Step

  1. Open Grasshopper in Rhino. Type Grasshopper in the Rhino command line and press Enter. The Grasshopper window will appear as a separate panel.
  2. Start a new definition. In the Grasshopper menu, go to File > New to create a blank canvas.
  3. Open Claude in a browser or app. Go to claude.ai and log in. Keep the chat window open alongside Rhino/Grasshopper.
  4. Describe your design goal. Write a clear prompt, e.g., "Create a Grasshopper definition that generates a parametric tower with twisting floors, using a curve attractor for height variation." Include specifics: number of floors, twist angle, base shape, and any constraints.
  5. Ask for a definition or script. You can request two things:
    • Text explanation of the components to use and how to wire them.
    • Python script for a custom component (if you prefer code).
    For example: "Write a Python script for a Grasshopper component that takes a list of points and returns their Delaunay triangulation."
  6. Copy the response. If Claude gives you a Python script, copy it. If it gives a component list, note the names and order.
  7. Build the definition manually. Drag the mentioned components onto the Grasshopper canvas and connect them as described. For Python scripts, double-click the canvas, type Python, and select the Python Script component. Paste the code into the script editor.
  8. Test and iterate. Adjust input sliders or geometry to see if the definition behaves as expected. If it fails, use the next step.
  9. Debug with Claude. Copy the error message from Grasshopper (red components) and paste it into Claude. Ask: "Why is this error happening and how do I fix it?" Claude can often spot missing inputs, type mismatches, or logic errors.
  10. Refine the design. Use Claude to tweak parameters, add features (e.g., perforation patterns, structural grids), or optimize for fabrication.

Common Mistakes

  • Vague prompts. Saying "make a building" yields generic advice. Be specific about dimensions, number of elements, and relationships.
  • Ignoring Grasshopper's data types. Claude may suggest using a point list where Grasshopper expects a curve. Always verify component inputs.
  • Copying Python code without checking dependencies. Some scripts require specific libraries (e.g., RhinoScriptSyntax) that must be imported correctly.
  • Not testing incrementally. Building a huge definition at once makes debugging harder. Test each cluster of components.
  • Assuming Claude knows your exact component versions. Grasshopper components change between versions; use generic terms like "Divide Curve" rather than relying on exact names.

Tips

  • Break down complex tasks. Instead of asking for a full building, ask for a floor generator, then a facade pattern, then combine them.
  • Use images. In Claude, you can upload a sketch or reference image and ask for a matching definition.
  • Name your inputs/outputs. When asking for Python code, specify variable names and expected data types (e.g., "input: curve, output: surface").
  • Learn from the explanations. Claude often explains why it chose certain components—use that to improve your own Grasshopper skills.
  • Save your prompts. If you find a prompt that works well, reuse it for similar projects.

Troubleshooting

If your definition doesn't work as expected:

  • Check for red components. Red indicates errors. Hover over the component to see the error message. Copy it and paste into Claude.
  • Verify data flow. Use Preview (the black dot) to see what data is flowing. If a component outputs null, the input may be wrong.
  • Simplify. Remove half the components and test again. If it works, add back pieces until the error reappears.
  • Ask Claude for alternative approaches. If a method isn't working, say "That didn't work; suggest a different way."
  • Check for missing references. Some components need Rhino document objects (curves, surfaces) to be referenced correctly. Make sure you've selected them in Rhino.

Frequently Asked Questions

Can Claude write a full Grasshopper definition automatically?

No, Claude cannot directly create .gh files. It can provide textual instructions or Python scripts that you manually assemble.

Do I need to know Python to use Claude for Grasshopper?

No, but it helps. Claude can explain component-based workflows without any code. For Python scripts, basic syntax knowledge is useful for debugging.

Is Claude better than Grasshopper's own tutorials?

Claude is interactive and can adapt to your specific problem, which tutorials cannot. However, tutorials offer structured learning.

Can I use Claude to reverse-engineer an existing Grasshopper definition?

You can describe the definition's behavior to Claude and ask for a simpler version or an explanation of what it does.

Does Claude work with Rhino 6?

Yes, Grasshopper definitions are mostly compatible, but some newer components may not exist. Mention your Rhino version in the prompt.

How do I get the best results from Claude?

Be extremely specific. Include exact numbers, desired outputs, and any constraints. The more context, the better the answer.