Skip to content
Schema

Routing copper

cleanup_traces

Remove zero-length, duplicate and contained traces and merge collinear ones.

Usage

cleanup_traces [passes…]

Angle brackets mark required arguments and square brackets optional ones. Available in the pcb editor. You can issue this yourself, and the AI agent issues the identical command — there is no second, hidden interface.

Arguments

passes
Optional

0 required, 1 optional.

Behaviour

Returns JSON {removed, iterations, breakdown}. Snapshots the whole trace list for undo, so it is one undo step however many traces it touches.

How the agent uses it

  • The agent works in a perceive / act / verify / recover loop: it describes the design, issues cleanup_traces or another command, checks the result, and undoes the change if the check fails.
  • Commands report what they actually did. A refusal is a result, not a silent no-op — which is what lets the agent recover instead of building on a change that never happened.
  • Anything the agent can do here, you can do yourself, and the reverse.

Try cleanup_traces in the editor

Free to start on macOS, Windows and Linux. Bring your existing KiCad and Altium libraries.