Detent is a strictly passive, deterministic leverage layer for coding agents that forces every read, write, retrieval, and presentation to run through deterministic machinery, leaving only reasoning to the LLM.

Stars

16

7-day growth

No data

Forks

0

Open issues

0

License

Apache-2.0

Last updated

2026-07-19

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It directly addresses the core problem of stochastic agent behavior by making the vast majority of actions deterministic and verifiable, with measured reductions in model output and hidden LLM-mediated fetches.

Who it is for

  • Developers building AI coding agents
  • Claude Code power users wanting more predictable tool use
  • Researchers in agent reliability and determinism
  • Engineers evaluating deterministic infrastructure for LLM workflows

Use cases

  • Preventing LLMs from re-emitting bytes already on disk (using content-addressed pointers)
  • Refusing LLM-mediated web fetches and enforcing a deterministic substitute
  • Providing a hard audit trail of every deterministic action via an append-only ledger
  • Enabling reproducible agent behavior through pure functions of event and disk state

Strengths

  • Measured dispatch overhead of only ~60 ms per hook invocation
  • 29 moves across three tiers with 20-cell coverage topology and universal law tests (totality, idempotence, monotonicity)
  • Content-addressed store eliminates coordination among concurrent writers
  • Proven in real sessions: 70,663 chars of model output replaced by pointers, 30 LLM-mediated fetches denied

Considerations

  • Currently only supports Claude Code's hook schema
  • Edit pointer expansion requires a workaround because Claude Code validates Edit input before PreToolUse rewrites
  • Does not replace LLM reasoning—it only handles deterministic execution of decided actions

README quick start

Detent

One question: of everything an agent does, how much can be made reliably deterministic?

Detent is a strictly passive, deterministic leverage layer for coding agents. The LLM's irreducible remainder is reasoning — deciding, and emitting specs. Everything else — every read, write, retrieval, verification, and presentation of fact — runs through deterministic machinery instead of the default token transport: pure functions of the event and disk state, no model call anywhere, ever. Generation is stochastic exactly once; the moment output exists it is a content-addressed artifact, and every later use is a deterministic copy, never a re-emission. Denial is never the point — it is only the redirect at the boundary, used exactly where the default path is provably identical to a free deterministic one.

Read LAW.md (the admission test any move must pass). The primitive layer itself — 5 stations, 20 flow cells, complete by construction, every cell SERVED, PARTIAL-with-named-machinery, or VOID-with-reason; silence is not a state — ships as code: detent/cells.py, the punchcard.

What's here

PieceWhat it is
detent/contract.pythe bound: Claude Code's documented hook schema as data, plus the three envelope types (rewrite dict / Deny / Block / advisory str)
detent/dispatch.pythe pivot: one stdin→stdout hook entrypoint; (event, tool) table lookup; picks the envelope by return type, never by content
detent/moves.pythe arms: every move is one composition m = α∘φ∘π — total projections, exact guards, typed envelope actions; 29 moves across three tiers, enforcement (pure), capture (write only to the store, atomically), and display (render-by-address at the screen boundary), each declaring its own station flows; coverage is a quotient, not an enumeration — wildcard rows bound EVERY tool's oversized output and gate the whole →WORLD class, including tools that don't exist yet
detent/store.pythe substrate: content-addressed artifact store — put/get/materialize/slice + an append-only firing ledger; identical bytes coincide, so N concurrent writers need zero coordination
detent/cells.pythe punchcard: the 20-cell coverage topology as data; the move rows are derived from each move's own flow declaration, reconciled against importable reality by tests — coverage drift is a red

Related repositories

Similar projects matched by category, topics, and programming language.

lopopolo
Featured
lopopolo GitHub avatar

harness-engineering

Harness Engineering is a methodology for improving coding agent outputs by carefully crafting the environment around them—providing curated context, tools, and executable constraints that encode an organization’s nonfunctional requirements and cumulative lessons.

AI & Machine LearningAI Agents
2,390
slvDev
Featured
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI & Machine LearningLarge Language Models
1,960
littledivy
Featured
littledivy GitHub avatar

mimic

mimic captures traffic from any iOS or web app and automatically generates a Python client library that lets you call the app's API like a regular library.

AI & Machine Learning
1,482