Hunch – a Git-native decision graph your AI assistant obeys

huchdave1 pts0 comments

Hunch — your codebase remembers why

the problem<br>dec_site_002<br>why this section leads Engineers trust a symptom they've felt over a feature list. The page opens with the failure mode, not the product.

Every AI session starts from zero.

The model re-reads your code, re-guesses the intent, and happily "fixes" the thing you<br>deliberately did last month — because the reasoning lives in PRs, Slack, and people's heads,<br>not in the repo.

Stateless by design<br>Typical assistant memory is ephemeral RAG over your current code. The horizon is this session — value stays flat.

Intent evaporates<br>The codebase records the final state, never the rejected alternative or the invariant you must never break.

The same mistakes, again<br>Without memory, the agent re-discovers the bug you already fixed — and undoes the workaround that prevents it.

how it works<br>dec_site_003<br>why three numbered steps The pipeline really has three layers — index, learn, ground. The numbers are the architecture, not marketing rhythm.

Memory as a byproduct of normal work.

No documentation chore. The index is deterministic, learning happens on every commit, and<br>grounding reaches your assistant through every door it has.

01 / index<br>Map the code, no LLM<br>Hunch maps how functions, files, and components connect, so it can see the ripple effect of any change. Fast, entirely on your machine.

hunch index

02 / learn<br>Turn events into memory<br>Each commit becomes a structured decision; a failing test becomes a bug with its likely cause; recurring or severe bugs are promoted into constraints — rules the AI must respect.

post-commit → synthesis

03 / ground<br>Feed it back, with citations<br>Your assistant reads it through an MCP server, an auto-maintained CLAUDE.md, and slash commands — every answer cites its source, confidence, and evidence.

MCP + CLAUDE.md + hooks

the reasoning graph<br>A bug spawns a decision. A decision spawns a constraint.

The links are what let an agent answer "why" and "what must not break" with evidence —<br>every node attached to its components, symbols, and commits.

bug_009 · critical<br>Leaked token usable after reset

A stateless JWT couldn't be revoked server-side. Caught by auth.revocation.spec.ts, root cause attributed.

dec_017 · accepted<br>Store sessions in Redis, not JWT-only

Sessions move server-side; the JWT carries only an opaque id. Alternatives rejected, consequences recorded, commit a1b2c3d as evidence.

con_004 · blocking<br>Revocation must be server-side

Never trust JWT expiry alone for logout. Scoped to src/auth/** — checked before any edit in that scope.

what's inside<br>dec_site_004<br>why four groups, not a top-20 list Twenty numbered cards hide the architecture. The groups are the product's real jobs: remember, guard, retrieve, share.

Everything is local, diffable, and yours.

Twenty-one capabilities, four jobs. Unfold what you care about.

memory / — what the graph holds

Records with provenance, safe writes, and a time axis — memory you can audit.

Provenance on everythingsource, confidence, evidence — on every record+<br>Every record shows where it came from and how much to trust it. Auto-captured guesses stay advisory; only what you've confirmed is trusted enough to block.

Git is the syncplain files beside your code, merge-clean+<br>The graph lives in your repo and travels with it — reviewable in PRs, synced by push/pull. Teammates' edits merge cleanly, no conflict markers.

Atomic & durableinterrupted writes can't truncate the index+<br>An interrupted write can never corrupt the graph, and damaged state refuses to overwrite good data. Boring on purpose.

Time-travel memoryquery the graph as of any commit+<br>Ask what the team believed as of any commit or tag. History is closed, never deleted — superseded decisions stay auditable forever.

Private memoryopen-source the code, not the reasoning+<br>Open-source the code without open-sourcing the reasoning. Sensitive decisions live in a separate private repo you control — your local queries see them, public outputs never can.

Decision-groundingdoc≠graph drift, caught deterministically+<br>Docs drift; the graph doesn't. Your assistant is told which decision is current — including what was rejected — before it edits, and prose still describing a superseded decision is caught. CI can gate on it.

Component wiki & specs ledgerstale docs adopted & healed — never rewritten+<br>A wiki rendered from the graph, and every repo doc graded: grounded, stale, or unverified. Stale docs get a wiki-managed copy healed to the current decision — your original is never touched, and the copy retires once you heal it. Staleness is drift-gated, not scheduled.

guards / — what it stops

Deterministic checks over the graph. Advisory by default; blocking only on what you've confirmed.

Regression Guardstop re-adding what a decision retired+<br>Re-adding what a past decision deliberately removed gets flagged before it lands — the AI stops silently undoing intentional design.

Veto — Decision Guardstop re-introducing what you...

decision graph never code memory commit

Related Articles