srcdmp
srcdmp (pronounced "source dump") is a source code snapshot tool. It packs an entire project directory into a single, compact .srcdmp binary file.
Every snapshot filename carries its metadata:
2026-05-23-myproject-0.1.0.srcdmp
Status
srcdmp is under active development. The API and binary format are not yet stable.
The codecs
.srcdmp files use the SDMP codec family, designed specifically for source code text.
| Codec | ID | Status | Description |
|---|---|---|---|
| SDMP-C4 | 0x04 |
Implemented | Huffman-tree compression using empirically-derived frequencies (default) |
| SDMP-7 | 0x07 |
Implemented | Three-tier encoding with a 128-entry ASCII table + extended lookup |
| SDMP-8 | 0x08 |
Implemented | Raw UTF-8 passthrough (no compression) |
| SDMP-C2 | 0x02 |
Planned | Order-2 context model + arithmetic coding |
SDMP-C4 is the default, balancing compression ratio and throughput.
CLI usage
Wrap a directory
Auto-named snapshot
Unpack
Browse
Inspect
Library API
srcdmp is both a CLI tool and a Rust library (behind the cli and fs feature flags, both enabled by default).
[]
= { = "https://codeberg.org/razkar/srcdmp" }
use ;
// Create a snapshot of the current directory.
let dump = from_dir
.codec
.gitignore
.ignore
.build?;
// Write to a date-stamped file using metadata from Cargo.toml.
dump.from_cargo.write_to?;
// Open an existing snapshot and reconstruct the directory tree.
let dump = open?;
dump.unpack_to?;
The library also exposes the individual codecs and raw format primitives via the raw module:
use sdmpc4;
let compressed = encode;
let decompressed = decode?;
File annotations
Individual files can opt in or out using annotations in the first 512 bytes of content:
@srcdmp:ignore - exclude this file from the snapshot
@srcdmp:force - include even if the file appears binary
Binary detection checks for a null byte within the first 8000 bytes; files appearing binary are skipped automatically.
Self-hosting
Every release of srcdmp is archived as a .srcdmp snapshot in dump/.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
Cheers, RazkarStudio.
Copyright © 2026 RazkarStudio. All rights reserved.