gcodecheck — Free Open-Source G-Code Validator CLI for AI Agents
gcodecheck — PrusaSlicer's pre-flight check for AI Agents: Know if a print will fail before the printer starts — bad layers, cold extrusion, out-of-bounds moves and first-layer trouble as machine-readable JSON, using 159x fewer tokens. Offline, fast, and free.
Install in one minute — see the install commands below. Source and README: github.com/creatorops-studio/gcodecheck. 100% local — no network calls at all in the free build.
A pre-flight check, not a slicer: slice in PrusaSlicer or Cura, then check the G-code before printing. Geometry verification is Kerf's job — gcodecheck checks process state as a CI gate.
One command, one verdict
check reads a G-code file and returns pass, pass-with-warnings, or fail — with each problem named, located by line, and explained. Exit code 1 on any error, so it drops straight into CI.
# 1. Check a file (human-readable verdict)
gcodecheck check print.gcode
# 2. Machine-readable verdict for CI / agents
gcodecheck check print.gcode --json
# 3. Check against a different printer
gcodecheck check print.gcode --profile prusa-mk3s
# 4. Measure it on the sample cube
gcodecheck benchmark examples/sample.gcode
gcodecheck check on the sample cube (examples/sample.gcode, 1927 lines, 50 layers):
examples/sample.gcode — profile ender-3 (1927 lines, 61535 bytes, 1866 moves, 50 layers, 842.4 mm extruded)
verdict: PASS (0 error(s), 0 warning(s), 0 info)
On a bad first layer (tests/fixtures/bad-first-layer.gcode):
verdict: PASS-WITH-WARNINGS (0 error(s), 3 warning(s), 0 info)
[WARN ] first-layer-too-high end of file — first layer is 0.350 mm high (over 0.32 mm for a 0.4 mm nozzle) — poor bed adhesion
[WARN ] first-layer-too-fast end of file — first layer prints at up to 50 mm/s (over the 40 mm/s adhesion limit)
[WARN ] fan-on-first-layer end of file — part-cooling fan is on during the first layer
The checks that catch a failed print
Layer-height sanity, cold extrusion, nozzle and bed temperature out of range, missing temp commands, out-of-bounds moves, first-layer height/speed/fan adhesion flags, travel without retraction, excessive retraction, extrusion-rate anomalies, Z jumps, and vase-mode detection.
Install in one minute
Install straight from GitHub with a Rust toolchain (cargo) — the crate is not on crates.io yet:
cargo install --git https://github.com/creatorops-studio/gcodecheck
Prefer a ready-made binary? Download the Release v0.1.0 binary for Linux x86_64 (904,136 B) from github.com/creatorops-studio/gcodecheck/releases/tag/v0.1.0.
Measured numbers, not marketing
Measured 5 December 2026 on Linux x86_64, release build, with gcodecheck benchmark. Timings are 3 runs of checking the sample cube (examples/sample.gcode, 1927 lines, 50 layers); the range is shown. Tokens ≈ characters / 4 (standard approximation); the verdict JSON is the real output of check --json on the same file, so the comparison is reproducible.
| What was measured | Result |
|---|---|
| Token cost for one check — verdict JSON | 97 tokens vs 15,384 tokens (whole file) — 159.4× saving |
| Check the sample cube (1,927 lines / 50 layers) | 0.37–0.71 ms |
| Peak RSS | ~2.8 MB |
| Binary size (release, stripped) | 904,136 B (0.86 MiB) |
Honest note: the ratio grows with file size — the verdict JSON stays around ~100 tokens while the file grows. Against kerf verify there is no token saving to claim (its verdict is also short, ~50 tokens by the ranking doc's estimate) — the edge over Kerf is different checks, not a shorter verdict.
Built for AI agents first
MCP server with three tools (check_gcode, list_profiles, get_profile). Add this to your MCP config — no slicer, no printer, no cloud:
{
"mcpServers": {
"gcodecheck": {
"command": "gcodecheck",
"args": ["mcp"]
}
}
}
A 1927-line sample cube that used to cost an agent 15,384 tokens to read now costs 97 tokens of verdict JSON (159× saving, measured — see the repo README for the full benchmark). Honest note: the ratio grows with file size, and against kerf verify there is no token saving to claim — the edge is different checks, not a shorter verdict.
Built with: Rust, a single static binary, and an MCP server — clap + serde + serde_json.
Free, offline, MIT
Single static binary, no cloud, no account. Free core is 80% of a real print gate; Pro (coming later, $10–29/month) adds material rule packs, farm dashboards, CI integration and a Cloud API.
Frequently asked questions
Is gcodecheck really free?
Yes — MIT licensed, free core forever. Pro is a separate paid tier for rule packs/dashboards/API features.
Does it work offline?
Yes. 100% local; no network calls at all in the free build.
Does it verify geometry?
No — Kerf already does geometry verification, free, with Lean 4 formal verification. gcodecheck checks process state (temperatures, first layer, travel/retraction, layer heights) as a CI gate.
Does it replace my slicer?
No — it is a pre-flight check, not a slicer. Slice in PrusaSlicer or Cura, then check the G-code before printing.
Which printers does it support?
Three built-in profiles (ender-3, prusa-mk3s, voron-2.4-350) plus custom profiles from a JSON file.
How do I use it with Claude Code?
Add the MCP server block from the repo README to your MCP config; the agent gets check_gcode, list_profiles, get_profile.
How do I install it?
Run cargo install --git https://github.com/creatorops-studio/gcodecheck (needs a Rust toolchain), or download the Release v0.1.0 binary for Linux x86_64 (904,136 B) from the v0.1.0 release. The crate is not on crates.io yet.
Know if a print will fail — before the printer starts.
Free, offline, MIT licensed — get the source on GitHub. A pre-flight check, not a slicer — geometry verification is Kerf's job.