Practical Guides · knowledge base from X

Jev engineering on Claude Code loops: from $765 to $3/month of overhead

Three concrete builds on Claude Code hooks — a PreToolUse safety gate (~100 ms), a goal-based Stop hook, a triage cron that wakes Claude only for bugs — plus the economics: 600 decisions/night × 30 nights ≈ $765 on Fable 5.1 vs ~$3 (or ~$1.08 in one call) on Jev. Seven rules, community examples (compaction 1M→86K tokens), and where to sell audits/hook packs.

✍️ Mr. Buzzoni · @polydao
🔗 Read the original on X · X Article · published 26 Sep 2026
📊 233 likes · 714 bookmarks · 752k views
Summary and adaptation in English; content and results belong to the author.

Part of the manual Jev and models that decide — the complete manual

Claimed result

  • Problem: an overnight Claude loop asks ~600 micro-questions/night (is the command safe? next file? tests ok? goal met?). On Fable 5.1 a yes/no on ~4,000 tokens of state ≈ 4¢ and seconds → you spend more deciding than building.
  • Jev (TypeSafe, Sept 15, 2026): typed decisions only, ~100 ms, input $0.042/MTok, output free. Producer's eval: 193.6× faster and 444.6× cheaper vs the average of GPT-6 Astra / Fable 5.1 (declared upper range).
  • Table math (200 turns/night × 3 decisions × 30 nights, ~4k tokens of state + 50 out): decision overhead ≈ $765/month on Fable vs ≈ $3 on Jev; with 3 questions in one call ≈ $1.08/month. Fable cache at ¼ price ≈ $225 — still ~75× Jev.
  • Safety gate: a heavy night of 300 bash × ~500 tokens = 150k tokens → $0.0063 on Jev.
  • Community: session compaction ~1M → 86K tokens in ~1 s (test by Alex Volkov / tamara); computer use $0.0002/decision vs $0.032 Opus; browser flights ZRH–LON 7.1 s / $0.0039; 1,018 papers in 24 topics $0.08 @ 256 ms median; 500 emails 3.5¢.

Proof: medium. List prices and the author's arithmetic are reproducible; the 193×/444× eval and part of the community examples come from the producer or third parties. It's not an official before/after Claude bill from a client.

The key idea

Claude builds, Jev decides. Every start/stop/gate in the loop becomes a 0.1 s typed call. "Jev engineering" = moving judgment calls out of the LLM into the hooks Claude Code already exposes. The cheapest Claude turn is the one that never starts.

Step-by-step playbook

1. Model context

Jev by Diogo Almeida (InstructGPT co-author); TypeSafe seed of $40M (DCVC). Key feature: calibration via RLCD — if it says 0.9 it's right ~9/10 times. Chat models "sound confident"; a calibrated number is actionable at 3 a.m.

2. Where the decisions hide

The Claude Code team's loop guide: what starts a run, what stops it, checks on the work. All three are decisions; by default Claude makes them. Jev takes the right-hand column; Claude keeps code/plans/explanations.

3. Build 1 — A 100 ms safety gate on every Bash

PreToolUse hook: JSON on stdin → allow / deny / ask. Jev classifies before execution.

Three safety constraints: 1. Hard rules in code before Jev (Jev trusts the text in the state; a command can fool the classifier). 2. Anything external → always a human, whatever the confidence. 3. The other option is never auto-approved.

LangChain: AutoModeMiddleware (langchain-typesafe) gates tool calls.

4. Build 2 — A Stop hook that knows when it's really done

An agent evaluating itself tends to praise itself. Stop hook: if it answers block + reason, Claude continues. Code = exact checks; Jev = what tests can't see.

checks.sh prints evidence: tests, grep for TODOs in changed files, README diff, lighthouse… Jev only sees the stdout. The richer the evidence, the better it judges. Cost: fractions of a cent per check.

5. Build 3 — Wake Claude only if there's work

/loop 15m: triage new issues burns a Claude turn even when there's nothing. Put Jev in a cron in front: Claude starts only on items that require code. 30 issues < 0.1¢ on Jev. Questions/spam labeled; features wait for you; reproducible bugs → Claude. Build 1's gate stays inside every session.

6. The math (operational summary)

Approach Decision overhead / month (article scenario)
Fable 5.1, 600 separate calls ~$765
Fable with cache reads at ¼ ~$225
Jev, separate calls ~$3
Jev, 3 questions / 1 call (state once) ~$1.08

Claude's build cost remains: you only remove the overhead. On a Max plan it shows up as recovered usage limits, not just dollars.

7. Seven rules of Jev engineering

  1. Meaning lives in the instructions; the question ID doesn't go to the model (is_safe on its own says nothing).
  2. One judgment per question ("destructive and outside the repo" = two questions; combine in code).
  3. Checkable situations ("deletes data or rewrites git history"), not moods ("very risky") or bare numeric levels.
  4. Every Choice has an exit (other) for honest uncertainty.
  5. Everything in one call: 13 questions on one doc → 12.2× cheaper and 10× faster vs 13 calls (TypeSafe test).
  6. Math, dates, hard rules in code; pass the result to Jev.
  7. Pin jev-1.13.0 (not jev-latest); one week in shadow mode (Jev labels, the old path decides), then switch on the aligned confidence bands.

8. Where the money is

  1. Loop audits for Claude Code teams: read transcripts, list judgment calls, move them to Jev, deliver a before/after bill (the §6 table on their numbers = the pitch).
  2. Hook pack retainer: gate + stop + triage cron, threshold tuning from the logs.
  3. Your own loops: more real work per Claude plan.

Tools and costs

Piece Link / note
Jev TypeSafe typesafe.ai — $0.042/MTok in, out free
API docs docs.typesafe.ai/api
Claude Code hooks docs.claude.com …/hooks
langchain-typesafe AutoModeMiddleware tool gate
Community examples compaction, jev-ultrafast Browser Use, jev-trader, 1kpapers

Limitations

  • The cost table is a typed scenario, not an invoice.
  • The 193×/444× eval = the producer's upper range; comparing against LLMs "that reason at length" inflates the gap.
  • The Claude Code hooks API may change; pin versions.
  • Jev doesn't write code: without a build LLM the loop produces nothing.
← More guides in “Jev and the models that decide”