,___, (O,O) ( ) -"-"-Adaptive governance for Claude Code
Hedwig learns your preferences and calibrates Claude Code. It decides which edits need your eyes and which can go through on their own.
online logistic regression·embedding-ranked retrieval·self-correcting·local SQLite, zero cloud
# make an edit, then check what Hedwig did: $ /hedwig-status
Trust a kind of edit and it starts flowing through. Revert one and the next like it stops for review. Autonomy moves both ways.
,___, (O,O) ( ) -"-"- Hedwig · trust runtime Auto-applied 10 77% Surfaced 2 for your review Blocked 1 agent asked to revise 10 of 13 edits auto-applied all-time. Why it surfaced these: · core/migrations.py: data-model change · api/routes.py: interface change, multi-file blast radius
learned classifier drift · scorer ACTIVE · ▼ avg review time -12.55 ▼ blast radius -8.60 ▲ change pattern risk +8.22 ▲ new file +5.07 ▼ security sensitive -3.31 ▼ prior denials -3.31 ▲ toward auto-apply ▼ toward check-in no weight hand-tuned
3 self-corrections auto-applied, then walked back • db/models.py reverted after auto-apply • core/cache.py failed verification • api/routes.py reverted after auto-apply each one tightened the next decision on that file.
Powered by your trace data and behavior in this repo.
Diff size, blast radius, security sensitivity, change pattern. Deterministic, the model can't talk its way to a low score.
Familiar low-risk edits go through silently. Anything riskier surfaces with a plain reason.
A reverted edit or a failed verification is a training signal.
Hedwig learns the line from what you actually revert, and holds a security floor it won't cross no matter what it learns. It calibrates per repo, not per developer.
Undo something Hedwig auto-applied and it takes the hint. That revert becomes a negative signal the scorer carries forward, so the next edit like it stops for review.
When Hedwig holds an edit, it sends the agent a plain-English reason and asks it to narrow the scope. The agent self-corrects same-turn. No human needed, and the floor it held stays held regardless of what the agent argues.
A lightweight logistic-regression scorer updates one decision at a time and takes over from the built-in heuristics after ten real calls.
Run /hedwig-scan once and Hedwig flags security-sensitive files that don't have obvious names. Nothing changes until you confirm.
Decisions, self-corrections, classifier weights, your rules. All of it lives in a local file, not a context window. It survives restarts, carries across sessions, and is shared across agents. Every Claude Code session on the same repo reads the same governance state. A regret recorded by one agent tightens the next.
Rule retrieval runs on-device. Pattern inference runs in the Claude Code session you're already in.
Token overhead is near-zero. Rules surface only when relevant: a few lines, capped. A fresh repo costs nothing until you've built up history.