- Rust 98.6%
- Shell 1.4%
| benches | v2 | |
| bins | v2 | |
| eval | v2 | |
| src | change text on readout at the end | |
| tests | ~34% on _this_ dir... what about some bigger shit... | |
| .gitignore | ~34% on _this_ dir... what about some bigger shit... | |
| Cargo.lock | v2 | |
| Cargo.toml | v2 | |
| README.md | ~34% on _this_ dir... what about some bigger shit... | |
| rust-toolchain.toml | v2 | |
| typos.toml | v2 | |
transmog
Shrink code before sending it to an LLM; restore the real names after.
Renames identifiers to tx_0, tx_1, ... and strips whitespace/comments. A
ledger maps them back — even after the model edits the code.
use
transmog compress a.rs # -> a.rs.min + a.rs.min.map.txt
transmog compress ./src -e rs # -> ./.transmog/<tree> + ./transmog-out.md
transmog compress ./src -e rs --include-map # each .transmog file embeds its ledger
transmog compress --bundle ./src -e rs # -> transmog-out.md only
transmog --quiet compress ./src -e rs # no table/summary, just the files
transmog restore a.rs.min restored.rs --map a.rs.min.map.txt
transmog restore a.rs.min restored.rs # self-contained --include-map file
transmog restore --bundle transmog-out.md --out-dir ./out
transmog-out.md is the LLM prompt: a preamble explaining the minification, one
<!-- transmog:src path lang --> + ```lang section per file, and the
name->token mapping at the end. Dir mode also writes a ./.transmog/ tree
(layout + file names preserved); --bundle emits only the md. Stdout prints a
per-file table + net token savings (suppressed by --quiet).
Flags: -d/--dir, -e/--extension (repeatable, *.rs ok), -l/--level 1-3,
--naming tx|short, --skip-short N, --include-map, --bundle,
-o/--out, --no-recursive, --quiet.
worth it?
cargo run --bin should_use_transmog -- ./my-crate
USE/SKIP verdict + breakeven (savings vs the obfuscation preamble cost).
languages
Rust is full-feature (AST rename via syn); others minify lexically behind
features: cargo build --features all (lang-c, lang-python, ...).
evaluate
cargo run --bin eval --release
cargo run --bin compression_results
tests
cargo test --all-features
Toy. Rust round-trips byte-for-byte; other languages minify only.