11 min readPost 5
Why Obituary uses Go instead of Rust
Our first design plan recommended Rust and we had already created Cargo.toml before switching to Go minutes later. At 13,600 lines and again at 64,000 lines we ran the full rewrite math—here is why the original reason for Rust never materialized, why compile speed and real shell parsing matter more than memory safety for a deletion tool, and what a 13–20 week rewrite actually costs.

On this page
Obituary is a local CLI (obit) and background daemon (obitd) that puts expiry lifespans on files created by AI coding agents and intercepts destructive shell commands like rm -rf. Its very first design document actually recommended Rust. On night one we already had a Cargo.toml and two empty entrypoints on disk before deleting them minutes later and switching to Go.
Over the next twelve days, as the codebase climbed to 13,600 lines and then 64,000 lines, we seriously ran the rewrite math twice more—and stayed on Go both times.
Language debates around CLI tools usually gravitate toward memory safety or binary size. For a tool that automatically moves user files into a graveyard and parses shell commands before they execute, the fatal failures are misidentifying a file and misparsing a shell command; memory corruption sits far down the risk list. Guarding against semantic bugs depends on compile-time mutation testing and a battle-tested shell parser, which shifts the trade-off sharply toward Go.

Night one: the sole reason for Rust never got built
When the project started on 7 November 2026 as a Windows countdown utility, the initial plan recommended Rust for one specific reason: Windows 11's modern Explorer context menu requires a COM DLL loaded directly inside explorer.exe. Go and .NET runtimes do not belong inside Explorer, whereas Rust with windows-rs could keep the CLI, daemon, and DLL in one Cargo workspace.
Minutes after creating the empty Rust skeleton, we questioned that trade-off: paying Rust's build complexity across the entire CLI and daemon just for a future COM DLL made little sense when a thin C++ or Rust shim could handle the DLL later if needed.
Switching to Go yielded a working first prototype in under fifteen minutes (NTFS 128-bit file ID verification, IFileOperation recycling, five commands, 17 tests). Half an hour later the project pivoted to "AI agent first, cross-platform"—because agents routinely run in Linux containers, WSL, and macOS—turning Go's zero-CGO cross-compilation from a perk into a requirement.
As for that Windows 11 COM DLL, we never wrote it. Classic registry context menus worked reliably without injecting code into explorer.exe.
The only argument that put Rust in the original plan never came into play.
At 13,600 lines: four constraints keeping us on Go
Two days later, with 13,600 lines of production Go, 17,000 lines of tests, and 22 review rounds behind us, we ran our first systematic comparison against Rust, C++, and TypeScript. Because agents spawn a fresh hook process on every file edit and shell call, the implementation language had to satisfy four constraints:
1. Single static binary with fast cold start
Every hook invocation spawns a new process. Node's cold-start latency and external runtime requirement disqualified TypeScript immediately.
2. Direct OS API calls with zero CGO
Obituary verifies 128-bit NTFS file IDs, renames targets through open handles, and invokes COM IFileOperation for Recycle Bin fallback. Go handles all of this cleanly through golang.org/x/sys/windows and syscall.SyscallN (internal/winfs/recycle_windows.go calls the COM vtable directly with zero import "C" anywhere in the repo). C++ can do the same, at a much higher cross-platform build and memory-safety tax.
3. The danger is semantic, not memory safety
Preventing accidental deletion means closing check-then-rename races, rejecting symlink swaps, and keeping crash manifests consistent. Rust's borrow checker does not catch those bugs; rigorous tests do. Go's test stack fits directly: TestMain isolates user directories per package, and go test -overlay lets us compile hundreds of targeted mutants to prove every safety check is genuinely enforced.
Behind those 13,600 lines sat 22 rounds of hardened handle and crash-recovery semantics. Rewriting in another language meant proving every edge case all over again.
4. Performance bottlenecks live outside the language
- Hook processes exit in milliseconds before GC barely runs.
- Binaries stay compact: roughly 7 MB for
obit.exeand 6 MB forobitd.exe. - Go startup takes milliseconds; real wall time goes into spawning
gitsubprocesses (tens of milliseconds each) and disk fsyncs.
We also evaluated a classic Go single-writer goroutine over Windows named pipes that same afternoon. Because obitd was still a 5-minute scheduled task rather than a resident daemon, adding IPC permissions, cross-process working-directory propagation, and protocol versioning while keeping file-lock fallback meant maintaining two write paths prematurely. We shelved single-writer until the resident daemon existed.
Turning the audit into a Go toolchain upgrade
Choosing to stay on Go forced an honest question: were we actually taking advantage of Go? Checking the repository exposed clear gaps:
- Already used: zero-CGO syscalls,
_windows.go/_other.gofile splits,go:embedfor Skill assets, strictcontexttimeouts (15 s max forgit, 1 s total lock wait in hooks), the official MCP Go SDK, and-overlaymutation tests. - Missing: 0 fuzz tests, 4 benchmarks, 0
t.Parallel()tests (fullgo test ./...took 172 s), and brokenGOOS=linuxcross-compilation due to Windows-only imports incmd/obit.
On 9–10 November we ran a disciplined "measure first, fuzz next, optimize last" pass without changing any test count, behavior, or mutation catch.
Baseline (Ryzen 9 7845HX, Go 1.26.4)
On a ledger with 1,000 active items and 1,000 graves, obit list took 190 ms, obit stats 163 ms, obit graveyard --json 432 ms, and go test ./... 172 s. Hook latency (median / p95):
| Scenario | In-process | Real obit.exe hook claude |
|---|---|---|
| PostToolUse in consented project | 201 / 294 ms | 306 / 338 ms |
| PostToolUse in unconsented project (proposal) | 97 / 123 ms | 231 / 260 ms |
| Session start (cold / resume) | 103 / 24 ms | 211 / 144 ms |
| Stop hook | 0.5 ms | 127 ms |
| Delete guard PreToolUse | 0.9–1.9 ms | Not separately timed |
Eleven fuzz targets: ~20 million executions, two real bugs
We added fuzz tests to every untrusted parser—.obitrules, grave manifests, durations and --at, host payloads and patches, Codex TOML marker blocks, ordered JSON, and the delete guard—asserting round-trip stability, rejecting out-of-graveyard paths, and preserving bytes outside marker blocks. Roughly 20 million executions caught two genuine bugs:
- In
.obitrules, character ranges like[.-0]spanned ASCII/and silently crossed directory boundaries. - Odd-backslash line continuations in Bash caused false denials in the delete guard.
Targeted optimizations
- Eliminated one redundant
gitcall on consented writes, dropping in-process hook latency from ~180 ms to ~88 ms (and full process time from ~490 ms to ~300 ms). - Batched reaping from one full ledger rewrite and two fsyncs per item to batches of up to 32 items per transaction while preserving per-item checks and manifest crash recovery.
- Replaced package-level test hooks with struct injection so 425 top-level tests and 97 subtests could run with
t.Parallel(), followed by Linux/macOS cross-builds and-racein Linux CI.
Batching paid off immediately:
| 1,000-item batch operation | Before | After |
|---|---|---|
obit reap expired entries | ~100 s | 19.5 s |
| Background purge | 78 s | ~4 s |
| Reaping auto-registered entries | 108.7 s | 14.4 s |
At 64,000 lines: compile speed and real Bash grammar
On 19 November, with the codebase at ~64,000 lines of Go and ~91,000 lines of tests, a second Rust debate surfaced around two frequently underestimated realities: compilation time and shell parsing.
1. Compilation speed decides whether mutation testing survives
By this point Obituary was no longer a tiny script—it bundled a resident daemon, desktop GUI, hooks for 26+ agents, an MCP server, context menus, and deep Win32/POSIX filesystem logic. Crucially, every one of our hundreds of compile-time mutants must patch a file, recompile, and execute its target test.
Compiling and linking a 26 MB dev mutant took 3.1 seconds locally, letting the entire MCP mutation suite finish in roughly 6 minutes on an idle machine and shard cleanly across 8 CI runners. Even with Rust incremental builds, recompiling hundreds of mutants would grind that safety loop to a halt.
2. Parsing deletion commands requires full Bash grammar
It is tempting to think CLI flag parsing does not depend on Bash grammar—after all, -delete is a find flag, not a Bash construct. That misses the layer before find ever runs: shell quoting and expansion rules decide which tokens become live commands and which remain inert text:
| Command text | Executes a deletion? |
|---|---|
echo "rm -rf /" | No—string argument to echo |
grep "rm -rf" log.txt | No—search pattern |
x=$(rm -rf build) | Yes—command substitution runs first |
rm -rf / inside cat <<'EOF' | No—quoted heredoc body is literal |
$(rm -rf /) inside cat <<EOF | Yes—unquoted heredoc expands substitutions |
\rm -rf x, 'rm' -rf x, r''m -rf x | Yes—all resolve to rm |
Our guard works in two layers: first parse real shell grammar to identify executable invocations and arguments, then inspect tool-specific flags for find, xargs, and friends. Go gives us mvdan.cc/sh, the battle-tested parser behind shfmt; Rust alternatives like brush-parser and tree-sitter-bash trailed in semantic precision.

Pricing the full rewrite: 13 to 20 weeks for zero new features
To keep the decision grounded, we scoped a full Rust port across the four largest Go subsystems (leaving the React UI and website untouched):
| Subsystem | Production code | Tests |
|---|---|---|
core (ledger, graveyard, bury, resurrect, purge, sweep—highest risk) | 15,000 lines | 21,000 lines |
integrate (obit init, safe edits to third-party agent configs) | 12,000 lines | 15,000 lines |
cli (30+ subcommands) | 8,000 lines | 15,000 lines |
hook (multi-agent protocol adapters) | 5,000 lines | 9,000 lines |
The migration broke into six phases:
| Phase | Scope | Estimate |
|---|---|---|
| 0. Kill-gates | Four technical gates; any failure halts the port | 1–2 weeks |
| 1. Foundation | Cargo workspace, test isolation, 3-OS CI, cargo-mutants, Go-vs-Rust differential harness | 1–2 weeks |
| 2. Core | core and winfs reading existing ledgers/graves directly; all 21k test lines & mutation kill rates matched | 3–4 weeks |
| 3. Guard & hooks | Bash/PowerShell parsing, multi-agent adapters, real command-corpus differential checks | 2–3 weeks |
| 4. Outer surface | obit init, byte-matched output for 30+ commands, daemon, tray, context menus, Wails → Tauri | 3–4 weeks |
| 5. Packaging | Identical archive names and checksums.txt, new code signing | 1 week |
| 6. Shadow rollout | Shadow-run Go vs Rust delete guard, beta 2.0, then cutover | 2–4 weeks |
Even with parallel execution, the port came to 13–20 weeks (6–12 months for one engineer full-time); a second independent estimate landed at 14–21 weeks. Phase 0's hardest gate was running hundreds of thousands of real session commands plus the master table through both guards, requiring 100% agreement on the master table and 99.99% on real corpus traffic—failing that meant writing a custom Rust Bash parser, adding another one to two months.
The benefit column was brief: smaller binaries, lower memory, no GC, stricter state types—and zero user-facing features. Performance offered no excuse either: the resident Go daemon idles at roughly 0.03 CPU cores and hooks start in milliseconds.
Phase 0 never started.
What would make us revisit the math
Porting Obituary does not mean rewriting 64,000 lines of Go—it means re-proving 91,000 lines of tests, 20 million fuzz inputs, 654 compile-time mutants, and dozens of review-hardened edge cases in another language.
Our exit criteria remain unchanged: we would reconsider Rust only if Obituary needed to embed directly inside a Rust host as a library, or hit an unavoidable capability available only in Rust. Even if a single latency- or memory-sensitive subcomponent ever demanded it, isolating that component as a small standalone Rust helper beats throwing away a verified Go core.