From: Your AI Provider
Subject: Important changes to your plan
Hi there 👋
Starting next month, pricing for your plan
is changing.
The model your team relies on retires in
90 days. Its replacement is smarter, faster,
and 4× the price.
Your context window will also be reduced.
Thanks for building with us!
Relax.
That email hasn’t arrived.
Yet.
Spoiler: this one has a happy ending.
I fixed it myself. Over a weekend. In Rust.
Because when developers spot an industry-wide problem, we don’t file an issue.
We open a new repo.
Code Got Cheap
Two years ago a feature cost a week.
Now it costs a prompt.
400 lines in eleven seconds.
Tests included.
Comments better than yours.
Beautiful.
Now ask the question nobody wants to sit with:
Is code cheap… or is someone paying for it to look cheap?
We’ve seen this movie.
Cheap rides. Cheap cloud credits. Generous free tiers.
Everything is cheap during the land grab.
Then the land is grabbed.
And the invoice remembers your name.
The Lock-In Nobody Is Talking About
We spend weeks worrying about database lock-in.
Cloud lock-in. Framework lock-in.
Nobody is talking about this one:
Who wrote the code? → The model
Who understands the code? → The model
Who can safely change it? → The model
Who sets the model's price? → Not you
That’s not a tool.
That’s a landlord.
Your code is in your repo.
Under your license.
On your servers.
But the understanding of it lives in someone else’s data center, billed per token.
You own the house.
They own the only key that still fits the locks.
“Nobody Will Need to Read Code Anymore”
Maybe.
I’m not betting against AI. I use it every single day.
I’m betting against dependency.
I don’t need a human to understand my code.
I need something I control to understand it.
A teammate.
A new hire.
Me at 3 AM.
Or a small model running on my own laptop — offline, free forever, impossible to deprecate.
And here’s the part nobody says out loud:
Code that’s hard for a human is hard for a small model too.
A 5,000-line file doesn’t fit in a small context window.
A function that needs 40 files of context loses a small model by file 30.
Only the most expensive frontier model can hold that mess in its head.
Messy code is a subscription you never signed up for.
So I Built a Dead Man’s Switch
During the Cold War the Soviets built a system nicknamed Dead Hand — designed to keep working after the people in charge were gone.
I wanted the same guarantee for code:
If the frontier model disappeared tomorrow, could something I control still own this?
Deadhand is a CLI that scans a JavaScript/TypeScript repo and answers that question with numbers.
Can it be followed? → Cognitive Load
Can it be skimmed? → Readability
How tangled is it? → Entanglement
How much must load first? → Context Depth
What breaks if it changes? → Blast Radius
Does it match its peers? → Pattern Drift
Did anyone come back to it? → Orphaned Code
│
▼
MAINTAINABILITY 0–100
That fourth one, Context Depth? That's literally your context window.
Three rules I refused to break:
- No LLM inside. It runs offline, on your machine, free, forever. Anything else would make me a hypocrite.
- Deterministic. Same code, same score. Safe to fail a PR on.
- Receipts. Every number points to a file and a line.
Written in Rust.
It scans VS Code — 3.4 million lines — in under a second.
Under the Hood: No Vibes, Just ASTs
No regex. No “count the lines and guess.”
Deadhand reads your code the way a compiler does.
your repo
│
▼
discover ── respects .gitignore
│
▼
parse ───── oxc, all cores, one AST per file
│ AST → facts → freed
▼
resolve ─── imports + tsconfig paths
│
▼
graph ───── import graph + Tarjan for cycles
│
▼
git ─────── one `git log --numstat` call
│
▼
score ───── 7 metrics → 0–100, with receipts
Every file becomes an AST via oxc, parsed on every core, boiled down to facts, then freed.
Imports become a graph, Tarjan’s algorithm catches every cycle, and complexity is scored the SonarSource way.
Every threshold and the math behind it: in the repo.
I Pointed It at a Library Everyone Thinks They Understand
zod. 83,000 lines. One of the most loved TypeScript libraries alive.
$ deadhand scan
╭──────────────────────────────────────────────╮
│ DEADHAND AUDIT │
│ │
│ Readability 42 / 100 ! │
│ Cognitive Load 41 / 100 ! │
│ Entanglement 82 / 100 │
│ Context Depth 74 / 100 │
│ Blast Radius 45 / 100 ! │
│ Pattern Drift 65 / 100 │
│ Orphaned Code n/a │
│ │
│ MAINTAINABILITY 58 / 100 ! │
╰──────────────────────────────────────────────╯
134 functions over the complexity limit.
46 nested four or more levels deep.
2 circular dependency loops.
Scanned in 0.05 seconds. No API key. No tokens. No invoice.
zod is brilliant. Its maintainers understand every line.
But imagine inheriting this codebase with no maintainer and no frontier model.
Just you, a coffee, and a small model on your laptop.
That’s the real test.
Not “is this code good?”
“Could you take it with you?”
Try It Before the Invoice Does
Install (macOS / Linux):
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/KrishnanKamatchi/deadhand/releases/latest/download/deadhand-installer.sh | sh
Install (Windows PowerShell):
powershell -ExecutionPolicy Bypass -c "irm https://github.com/KrishnanKamatchi/deadhand/releases/latest/download/deadhand-installer.ps1 | iex"
Then, inside your repo:
-
deadhand scangives you the report. -
deadhand mapdraws an offline HTML map of your codebase. -
deadhand diff main --fail-on-drop 5fails PRs that make code harder to own.
cd your-repo
deadhand scan
deadhand map
deadhand diff main --fail-on-drop 5
👉 github.com/KrishnanKamatchi/deadhand
The Receipt Nobody Prints
─────────────── RECEIPT ────────────────
Feature generated ............ $0.04
Tests generated .............. $0.01
Shipped ...................... ✓
Understanding of the code .... RENTED
Renewal ...................... monthly
Who holds the keys ........... them
Price next year .............. ¯\_(ツ)_/¯
────────────────────────────────────────
Code is cheap.
Owning it never was.
Write code that something you control can understand —
your team, your future self, a model on your own machine.
Because one day the free trial ends.
And when it does, you want to be the one holding the keys.
Not the one reading the email.
The email at the top is fictional. Your AI provider is lovely. For now.
No LLM was used to score any code in this post. Several were used to build the tool, which is exactly why it exists.
zod was scanned from public source; scores describe how hard code is for a newcomer to change, not how good it is.

Top comments (0)