Use Codex, Claude Code, or another AI agent to create, run, debug, and inspect LTspice circuits.
sim-plugin-ltspice gives agents a structured path for LTspice work: read or
generate .asc schematics and .net/.cir netlists, run LTspice, parse
.log and .raw artifacts, extract .meas values, and turn simulation output
into grounded engineering reports.
LTspice itself is not bundled. This plugin supplies the agent-friendly file-format, run, and result-inspection layer around the LTspice tools you provide.
- Generate or edit simple SPICE netlists for parameter sweeps and quick checks.
- Convert supported
.ascschematics into runnable netlists when the platform supports it. - Launch LTspice batch runs through the
simCLI or a direct LTspice command. - Parse
.logfiles for warnings, errors, and.measoutputs. - Parse
.rawwaveforms for post-processing and KPI extraction. - Debug failed runs using verifiable artifacts instead of guessing from a screenshot or a final answer.
The value is not just starting LTspice. The value is making the full circuit-authoring → run → debug → measurement-extraction loop legible to an AI agent and auditable by an engineer.
uv run sim run --solver ltspice path/to/design.net --jsonUse this when the agent should keep a structured run record and surface stable errors/results through the sim runtime.
Use the bundled Python library when a task already produced .log or .raw
files and the agent needs to extract values without re-running the solver:
python - <<'PY'
from sim_plugin_ltspice.lib import RawRead, parse_log
log = parse_log("design.log")
print(log.measures)
raw = RawRead("design.raw")
print(raw.trace_names())
PYGive Codex, Claude Code, or another coding agent this instruction:
Use sim-plugin-ltspice for LTspice work. Prefer `uv run sim run --solver
ltspice` because it records structured run history from the project
environment. For post-processing, parse produced `.log` and `.raw` artifacts
directly with the bundled `sim_plugin_ltspice.lib` helpers. Put `.meas`
statements in the circuit when scalar KPIs are needed. Report only values that
can be re-extracted from artifacts produced during the run; if a simulation
fails, report the verifiable failure status and logs instead of inventing
results.
The bundled skill entry point is:
src/sim_plugin_ltspice/_skills/ltspice/SKILL.md
For agent projects, install sim-cli-core and the LTspice plugin in the project environment:
uv init # only if this is not already a uv project
uv add sim-cli-core sim-plugin-ltspice
uv run sim plugin sync-skills --target .agents/skills --copy
uv run sim check ltspice
uv run sim plugin doctor ltspice --deepFor Claude Code, sync the bundled skill to .claude/skills instead:
uv run sim plugin sync-skills --target .claude/skills --copyFor a reproducible agent run, pin a commit SHA:
uv add sim-cli-core "git+https://github.com/svd-ai-lab/sim-plugin-ltspice.git@<commit-sha>"uv run sim ... runs sim from this project environment, so it sees this
project's plugins. Without uv, create and activate a venv, then install
sim-cli-core plus this plugin with python -m pip.
- You provide the LTspice installation.
- Native macOS and Windows LTspice workflows are supported where the installed LTspice version exposes the needed command-line behavior.
- Linux/headless workflows usually require a task-provided LTspice/Wine wrapper or a container that already knows how to run LTspice.
.net/.cirnetlists are the most portable inputs for agent-generated circuits..ascschematic support depends on platform capabilities and the bundled parser/flattening path. If schematic flattening fails, the agent should fall back to a clear netlist or route through a host that can convert it.
sim-plugin-ltspice extends sim-cli
with an LTspice driver and bundled LTspice skill. sim-cli provides the common
agent runtime surface (run, driver discovery, plugin management, and
structured run history).
The package also bundles the LTspice file-format and runner library that was
previously developed as sim-ltspice: parsers and helpers for .asc, .net,
.log, .raw, install discovery, and subprocess execution. That bundled
library is what makes LTspice agent-friendly even though LTspice has no vendor
Python API.
The plugin is discovered by sim-cli through Python entry points:
[project.entry-points."sim.drivers"]
ltspice = "sim_plugin_ltspice:LTspiceDriver"
[project.entry-points."sim.skills"]
ltspice = "sim_plugin_ltspice:skills_dir"
[project.entry-points."sim.plugins"]
ltspice = "sim_plugin_ltspice:plugin_info"git clone https://github.com/svd-ai-lab/sim-plugin-ltspice
cd sim-plugin-ltspice
uv sync
uv run pytestFor README-only changes, lightweight validation is enough:
git diff --checkApache-2.0. See LICENSE.