Hook-time
block · warn · allowPre-check rules fire before edits, patches, or shell calls. Post-check rules warn after. Claude Code, Codex, and Gemini are normalized into the same fact vocabulary.
A RETE rules engine that enforces project conventions from disk — outside the LLM context window. Rules fire the same in token nine hundred thousand as they do in token eight hundred. Now with trajectory predicates that watch the long run of a session, and a confidence gate that demands the build, the tests, and the known-bug catch all be green before a commit lands.
A rule is a small refusal the project keeps making, even after it has forgotten the conversation in which it was first imagined.
Pre-check rules fire before edits, patches, or shell calls. Post-check rules warn after. Claude Code, Codex, and Gemini are normalized into the same fact vocabulary.
Sandboxed project providers derive new LHS facts from normalized
events. Multi-file tools expose a batch files view
before per-file evaluation; MCP tools test and manage providers.
Whole-tree scan against every rule tagged
audit: true. Per-rule hit counts with file
and line locations. Trend snapshots track debt over time.
A markdown file re-injected at every SessionStart and user interaction. Project guidance fades; this does not.
One consolidated report compares CLAUDE.md, auto-memory, ADR decisions, and rule-to-code bindings against what the project currently enforces or defines. Evidence for triage, not proof.
Rust, Python, and TypeScript structure becomes a durable graph. MCP clients can query relations, inspect generation and drift, and rebuild server-rooted graph and binding state without shell access.
Project-defined taggers stamp executed tool calls;
journey_* aggregators (occurrence, count,
since-last) over bounded windows let rules match temporal
patterns — auth churn over a session, recent SQL in the
last five calls, build staleness — without any in-memory
accumulation. Recomputed from disk every hook fire.
Declarative toolchain definitions feed one generic parser:
Cargo ships as a built-in, while project definitions can
extend or override it. Matched command outcomes become
neutral signal_pass facts;
gate rules block or warn a git commit by
confidence band. Three grounded signals say "this is
real," not three syntactic checks.
Install from source, run init in your project,
and the hooks are wired. Rules fire from disk on every tool
call — no daemon, no socket, no shared state. Every invocation
is a fresh process that reads, evaluates, and exits.
Works with Claude Code, OpenAI Codex, and Gemini CLI. Exposes MCP tools to any MCP-capable client.
# install cargo install --path crates/phronesis-mcp phr-mcp install # user-scope MCP # wire into a project cd ~/Git/my-project phr-mcp init --packs rust # default platform + Rust rules # use phr-mcp audit # sweep existing debt phr-mcp trend # debt over time phr-mcp drift # uncovered guidance across all sources phr-mcp drift --source wiki # narrow to ADR decisions phr-mcp graph status --json # inspect structural freshness phr-mcp decision new my-slug # scaffold an ADR page
A long-form essay on the engine, the RETE algorithm, and the design intent behind moving guidance out of conversation context. With diagrams.
A visual reference of every default rule — LLM-behavior nudges, Rust enforcement, Rhai script hygiene — with rationale and worked examples from the field.
Use the loop-programming guide for setup, journey rules, grounded closure, graph recovery, and recurring agent workflows. Use the HTML changelog for compatibility notes and the exact release history.
The explainer contains the architecture, host integration, RETE mechanics, durable context, graph, trajectory, and confidence design in one web-native narrative. No Markdown hop is required from the documentation site.