CAI— keep the agent's mental model honest.
CAI detects drift between agent instructions and the repository they describe, then pushes the same context engine into CI, MCP and a desktop workbench. The deterministic core stays independent from the optional AI layer so verification remains reproducible.
- TypeScript
- Node.js
- Commander
- tree-sitter
- MCP
- Vitest
- Tauri / Rust
- GitHub Actions

cai health output. The terminal is the primary product surface, not a marketing mockup.Stack
How it evolved
Process reconstruction — based on the repository timeline and current architecture. Exact motivations are condensed where the commits show the change but not a written design rationale.
The first useful question was simple: do CLAUDE.md, AGENTS.md, Cursor and Copilot instructions still match the files, scripts and dependencies that actually exist?
Fix impact preview, drift-fix hit rate and configurable scoring turned warnings into an engineering loop: what will change, what improved, and which drift matters on hot paths?
MCP context delivery and push-based injection let agents request headings, summaries or full context rather than loading one giant instruction document on every turn.
CI annotations, type/build adapters and baseline comparisons made “task complete” contingent on repository evidence rather than an agent saying it looks done.
The workbench initially expanded into more tabs, then Health was folded into Overview and six tabs became five. The design improved by deleting navigation and making the core questions visible sooner.
Re-rendering on every filesystem timestamp caused flicker, focus loss and repeated animations. Updates were changed to react to an actual drift signature, while telemetry surfaced “what your AI reads” and hot files.
Interface rationale

Core engineering decisions
Where it is going
The project started as “lint the instructions.” It is moving toward a broader context-control plane: plan what context should exist, measure what agents consume, evaluate whether it improves work, and learn candidate rules without silently mutating the repository.