MCP plugin that validates AI agent edits in RAM before they touch disk. When Claude Code, Cursor, or Copilot changes a function signature in one file and breaks 30 others, NREKI catches it in milliseconds - the file is never written. If the error is structural (missing import, forgotten await), NREKI auto-fixes it in RAM. Zero tokens wasted on fix-retry doom loops.
v10.7 - The NREKI Way. Parasitic signals now ride inside outline: a defect radar flags LLM-rush patterns (β οΈ [empty catch, any escape]), a ghost oracle tags unreferenced exports (π» [0 ext refs]), and engrams prefixed ASSERT survive code mutation. Zero added tokens per call - the signals live in surfaces the agent already reads.
# Claude Code
claude mcp add nreki -- npx -y @ruso-0/nreki
# Cursor / any MCP client - add to mcp.json:
{ "mcpServers": { "nreki": { "command": "npx", "args": ["-y", "@ruso-0/nreki"] } } }
# Optional: installs CLAUDE.md instructions + CLI hook firewall
npx @ruso-0/nreki initFirst run indexes the project automatically. Zero config for TS/JS; point a tsconfig.json at your code and NREKI detects the right validation mode.
AI proposes edit -> NREKI intercepts in RAM -> Compiler/LSP validates
| |
| No errors ----------------------> Two-Phase Atomic Commit to disk
| Errors found --> Auto-Heal (TS CodeFix + LSP codeAction, atomic)
| |
| Fixed all? ---> Commit to disk
| Some remain? -> Full rollback. Disk untouched. Errors returned to agent.
Three tools (nreki_navigate, nreki_code, nreki_guard), 23 actions, 4 languages (TS/JS, Go via gopls, Python via pyright). Works with any MCP-compatible agent. Apache 2.0.
- Atomic multi-TextEdit healing. When gopls or pyright proposes a quickfix with coupled edits (import + usage), NREKI applies every TextEdit of the chosen action together with per-file savepoints and bottom-up offset ordering. No more doom-loop retries where only the import lands and the usage stays broken.
- Tolerant Patch mode.
nreki_code action:"edit" mode:"patch"now retries with indent-flexible matching when the exact-indent search fails and the content is unique. The literal-$guarantee is preserved end-to-end (no V8$&/$$substitution surprises). - Cognitive Enforcer. Agents can't
batch_editblindly - every edit in a batch is validated against a per-file passport (outline seen? symbol focused?). The v10.5.7 fix closed a bypass where 2+ edits could smuggle blind mutations through. - TTRD Bounties. Successful strict-type restoration reports the exact CFI (Continuous Friction Index) discount to the agent. Pavlovian reinforcement that actually quantifies what improved.
- Defect radar + ghost oracle. Four inline detectors and a 0-ext-refs tagger run during
outline- free signals, no extra tool call. - Executable engrams. Pin insights to symbols. Engrams prefixed
ASSERTsurvive AST mutation; everything else invalidates on body change so memory can't go stale.
| Language | Validation | Auto-heal |
|---|---|---|
| TypeScript / JavaScript | Full (TS Compiler API) | TS CodeFix API |
| Go | gopls LSP sidecar | codeAction (atomic) |
| Python | pyright LSP sidecar | codeAction (atomic) |
NREKI's tree-sitter parser layer indexes additional languages for foveal compression + symbol retrieval + semantic-edit syntactic validation. These languages do not have LSP sidecars and therefore receive no auto-heal; otherwise their files participate in the retrieval index identically to TypeScript files.
| Language | Extensions | Parser | Foveal | Syntax check | LSP auto-heal | Type Ledger |
|---|---|---|---|---|---|---|
| TypeScript | .ts .tsx .mts .cts | β | β | β | β (tsc) | β |
| JavaScript | .js .jsx .mjs .cjs | β | β | β | β (tsc) | β |
| Python | .py | β | β | β | β (pyright) | β |
| Go | .go | β | β | β | β (gopls) | β |
| CSS | .css | β | β | β | β | β |
| JSON | .json | β | β | β | β | β |
| HTML | .html | β | β | β | β | β |
| Kotlin | .kt .kts | β | β | β | β | β |
| Java | .java | β | β | β | β | β |
| C++ | .cpp .cc .cxx .hpp .hh .hxx .h* | β | β | β | β | β |
| C | .c .h* | β | β | β | β | β |
Kotlin / Java / C++ / C activation in v11.0.x covers Android development (Kotlin app layer + Java legacy + C++ NDK native layer + C NDK code) and the broader JVM / native cross-platform ecosystem.
*
.hheaders are routed at parse time: headers containing C++ markers (template, namespace, class,#ifdef __cplusplus) use the C++ grammar; pure C headers use the C grammar. Default to C grammar for ambiguous cases.
Known limitation (v11.0.x): cross-file import detection for Kotlin / Java / C++ / C is not yet implemented. Repo-map dependency edges for files in these languages are intra-file only until v11.0.x.1.
Android XML manifests and Gradle build files are NOT yet indexed.
AndroidManifest.xml, resource XMLs (res/layout/, res/values/, etc.),
and Gradle build scripts (build.gradle Groovy DSL) coverage is tracked
for v11.0.2 (see issue #4).
WASM checksum verification deferred. Upstream grammar upgrades may not
propagate to vendor wasm/ directory due to skip-if-exists logic in
scripts/download-wasm.js. SHA-256 checksum verification tracked as issue #5.
chunks table lacks language column. Retrieval language-aware scoring requires runtime path extension filtering. Breaking migration tracked as issue #6 (coordinated with v11.0.2 XML activation due to noise risk amplification).
Type Ledger (cross-file architectural dependency mapping) remains TypeScript-specific by design - it relies on TypeScript compiler- derived type information. Multi-language Type Ledger expansion is tracked under the Phase 8 roadmap.
- CHANGELOG.md - full version history (every patch, every release, every test count).
- templates/CLAUDE.md - optimized instructions auto-installed by
npx @ruso-0/nreki init. - Issues / ideas - GitHub Issues on this repo.
Apache 2.0. Zero cloud dependencies. Everything runs locally in the agent's process.