VisionSqueezer
CLI

Batch & JSON

Squeeze whole directory trees and emit structured output for pipelines.

Batch mode

Point Squeezer at a directory instead of a single file:

Terminal
vision-squeezer ./assets --recursive --output-dir ./assets-optimized --model gemini
  • --recursive walks every subdirectory.
  • --output-dir mirrors the source tree into the destination, preserving folder structure.

JSON output

--json emits a structured record instead of the human-readable savings table. In single-file mode it's one record; in batch mode it's an aggregate.

Terminal
vision-squeezer image.png --model claude --json
{
  "model": "claude",
  "original_tokens": 5344,
  "optimized_tokens": 4194,
  "tokens_saved": 1150,
  "bytes_before": 512000,
  "bytes_after": 365000,
  "size_reduction_pct": 28.6,
  "quality": 75
}

Dry run

Combine --json --dry-run to estimate impact across a tree without writing files or updating the stats database:

Terminal
vision-squeezer ./screenshots --recursive --json --dry-run --model gpt4o

This is the recommended way to gate a CI pipeline on projected token savings.

Persistent analytics

Every real (non-dry-run) optimization is recorded in a local SQLite database at ~/.vision-squeezer/stats.db.

Terminal
vision-squeezer stats
FieldDescription
timestampWhen the optimization ran
modelTarget model
original_tokens / optimized_tokensToken counts before/after
bytes_before / bytes_afterFile size before/after
modestandard, ocr, or auto

In Claude Code, the /vision-stats skill reads this database directly with zero MCP overhead.