infinri/Writ
127 stars · Last commit 2026-05-22
Claude Code harness for AI coding agents. Hybrid-RAG librarian picks relevant rules in 0.59 ms p95 (BM25 + vector + graph traversal); process keeper blocks writes until plan + tests approved. 276 rules / 30 mandatory across 12 domains, 6 cross-language analyzers. Neo4j + Tantivy + hnswlib + ONNX.
README preview
# Writ A Claude Code harness that gives every coding session two helpers: a fast librarian that picks the rules that fit the current task, and a process keeper that blocks risky writes until you have approved a plan and tests. At the live 276-rule production corpus (post Phase 1-5 public-rulebook expansion), the librarian returns ranked results in **0.590 ms at the 95th percentile**. At the 10,000-rule synthetic scale, it still holds at 0.557 ms while reducing context tokens by **726 times** versus loading the whole rulebook every turn. See [`CHANGELOG.md`](CHANGELOG.md) for the v1.2.0 release notes (proactive context-window management, hook hot-path latency consolidation, friction-log mode canonicalization, PostToolUse banner fix) and the v1.0.0 + v1.0.1 + v1.1.0 history of capabilities shipped. ## Browse the architecture in your browser Four self-contained HTML pages render the whole system. No clone or install required: open any link below and walk the diagrams. A sticky top nav inside each page cross-links to the other three, so you can flip between layers without coming back to the README. - **[Complete overview](https://infinri.github.io/Writ/writ-complete-overview.html)**: seven diagrams (system block, session flowchart, query sequence, pipeline funnel, mode/phase state machine, knowledge graph excerpt, rule-evolution lifecycle) covering the full system end to end. Start here. - **[Architecture layers](https://infinri.github.io/Writ/writ-architecture-flowchart.html)**: eight tabbed layer cards (pipeline, weighting, mandatory-vs-retrieved split, knowledge graph, mode system, phase gates, enforcement layer, evolution model) with plain-English summaries and technical drill-in. - **[Workflow flowchart](https://infinri.github.io/Writ/writ-workflow-flowchart.html)**: long-ways START-to-END SVG process flowchart of one Writ-enforced coding session, with rectangles for steps, diamonds for decisions, and dashed loop-back arrows for the iterate-until-it-passes gates. The description and step detail stay anchored in a sticky left rail. - **[Commands reference](https://infinri.github.io/Writ/writ-commands.html)**: every CLI command, every `writ-session.py` subcommand, and every HTTP endpoint, tabbed by group with live filter. These four pages live at the repo root (`writ-complete-overview.html`, `writ-architecture-flowchart.html`, `writ-workflow-flowchart.html`, `writ-commands.html`) and are served by GitHub Pages from `main`. Clone and open locally for offline browsing, or follow the links above straight from a browser tab. ## Install as a Claude Code plugin