Reference
crab dehydrate
Replace hydrated files with pointer blobs, freeing disk space.
Synopsis
crab dehydrate [OPTIONS] [GLOBS]...Description
crab dehydrate is the inverse of crab hydrate. It replaces fully
materialized files with their lightweight pointer stubs, freeing disk space
while keeping the file tracked in git. The original content remains safely
stored in the remote object store and can be re-hydrated at any time.
Dehydration is safe: it only replaces files that are already committed and clean. Files with uncommitted modifications are skipped to prevent data loss.
For conceptual background on dehydration, see Dehydrating Files.
Arguments
| Argument | Required | Description |
|---|---|---|
GLOBS | No | Positional glob patterns to dehydrate (e.g. *.safetensors) |
Options
| Option | Default | Description |
|---|---|---|
--all | false | Dehydrate all tracked hydrated files |
--json | false | Emit a single JSON envelope with the result |
--jsonl | false | Stream JSONL output (one event per line) |
Examples
Dehydrate specific file types
crab dehydrate '*.safetensors'Dehydrate everything
crab dehydrate --allDehydrate files in a directory
crab dehydrate 'models/*'Output
Dehydrating 5 files...
models/weights.bin 1.2 GB → 128 B ✓
models/embeddings.bin 800 MB → 128 B ✓
data/eval.safetensors 300 MB → 128 B ✓
data/dirty.bin skipped (modified)
Dehydrated 3 files, freed 2.3 GB in 0.4s
Skipped: 1 file (dirty)JSON Output
Supports --json and --jsonl.
--jsonruns to completion and emits a single result envelope.--jsonlstreams per-file progress followed by a terminalresultevent.
crab dehydrate --all --json
{
"schema": "dehydrate",
"version": "1.0",
"timestamp": "2026-04-24T18:32:17.900Z",
"data": {
"files_dehydrated": 3,
"bytes_freed": 2336462028,
"files_skipped": 1,
"duration_ms": 400
}
}crab dehydrate --all --jsonl
{"schema":"dehydrate.event","version":"1.0","timestamp":"2026-04-24T18:32:17.500Z","type":"file_done","data":{"path":"models/weights.bin","bytes":1288490188,"duration_ms":120,"status":"ok"}}
{"schema":"dehydrate.event","version":"1.0","timestamp":"2026-04-24T18:32:17.700Z","type":"file_done","data":{"path":"data/dirty.bin","bytes":0,"duration_ms":0,"status":"skipped"}}
{"schema":"dehydrate.event","version":"1.0","timestamp":"2026-04-24T18:32:17.900Z","type":"result","data":{"files_dehydrated":3,"bytes_freed":2336462028,"files_skipped":1,"duration_ms":400}}See Structured Output for envelope details, event types, and error handling.
Related Commands
crab hydrate— materialize pointer files into full content.crab status— see which files are hydrated vs. pointers.crab du— see disk usage breakdown.