Audit a codebase for energy
You do not have to rewrite anything to get value from Lux. The lift and
audit paths analyze foreign code as-is.
Audit
lux audit path/to/project
Works across 14 languages: C, JavaScript, TypeScript, Ruby, Python, HTML, CSS/SCSS, PHP, Go, SQL, Dart, Rust, YAML, JSON.
The recommendation engine runs a dozen-plus detectors:
| Detector | Catches |
|---|---|
| Nested-loop complexity | O(n²) where O(n) would serve |
| Allocation in loop | per-iteration heap churn |
| String concat in loop | quadratic string building |
| Linear search | scans where a hash/map would serve |
| Loop-invariant recomputation | work hoisted out of the loop |
| Missing early exit | full scans after the answer is found |
| N+1 queries | per-row database round-trips |
| Reallocation growth | unsized buffers growing one push at a time |
| Deep field access in hot loops | repeated pointer-chasing |
| Clone/slice in loops | needless copies per iteration |
Each finding carries a category, severity, and an estimated savings factor — an estimate from the cost model, labeled as such.
Lift
When you do want a conversion, lift translates foreign code to .lux:
lux lift legacy.js # analyze + show the lifted Lux
lux lift legacy.js --convert # write the .lux file
Lifted output is a starting point, not a guarantee — review it like any
generated code. The same analysis is exposed to AI clients through
lux-mcp, so an agent can audit
and lift on your behalf.
Why this is the adoption path
An audit costs nothing and commits you to nothing: the report stands on its own even if you never write a line of Lux. Energy waste you can name is energy waste you can fix — in any language.