@unerr-ai/unerr 0.0.0-beta.1 → 0.0.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,97 +7,156 @@
7
7
  </p>
8
8
 
9
9
  <p align="center">
10
- Local code intelligence that gives your AI agent a graph of your entire codebase.<br/>
11
- It stops looping, stops re-reading, stops breaking things it can't see.
10
+ A local intelligence layer that sits between your AI agent and your codebase —<br/>
11
+ indexes every call, remembers every decision, and gets sharper the longer you use it.
12
12
  </p>
13
13
 
14
14
  <p align="center">
15
- <a href="#get-started"><img src="https://img.shields.io/badge/install-npx_@unerr/unerr-8B5CF6?style=flat-square&logo=npm" alt="Install" /></a>
15
+ <a href="https://www.npmjs.com/package/@unerr-ai/unerr"><img src="https://img.shields.io/badge/install-npm_i_@unerr--ai/unerr-8B5CF6?style=flat-square&logo=npm" alt="Install" /></a>
16
16
  <img src="https://img.shields.io/badge/runtime-Node.js_≥20-339933?style=flat-square&logo=node.js&logoColor=white" alt="Node.js" />
17
17
  <img src="https://img.shields.io/badge/protocol-MCP-7C3AED?style=flat-square" alt="MCP" />
18
- <img src="https://img.shields.io/badge/tests-1455_passing-34D399?style=flat-square" alt="Tests" />
18
+ <img src="https://img.shields.io/badge/local--first-no_cloud-22D3EE?style=flat-square" alt="Local-first" />
19
19
  <img src="https://img.shields.io/badge/license-ELv2-A1A1AA?style=flat-square" alt="License" />
20
20
  </p>
21
21
 
22
22
  <p align="center">
23
- <code>npx @unerr/unerr</code>
23
+ <code>npm install -g @unerr-ai/unerr</code>
24
24
  </p>
25
25
 
26
26
  ---
27
27
 
28
- ## Your agent loops because it's blind
28
+ ## The agent isn't stupid. It's flying blind.
29
29
 
30
- You've seen it. You ask Claude or Cursor to refactor a function. It reads 30 files to find the call graph. It misses 14 downstream callers. It re-discovers conventions you told it yesterday. It tries a broken approach, fails, tries again — burning tokens while you watch.
30
+ Watch any AI coding session for ten minutes and you'll see the same loop:
31
31
 
32
- **The agent isn't stupid. It's blind.**
32
+ - It **reads 30 files** to find one function — burning the context window before it writes a line.
33
+ - It **edits something with 40 callers** and never knows it just broke three services.
34
+ - It **re-derives the same conventions** you taught it yesterday, this morning, and an hour ago.
35
+ - It **forgets the entire session** the moment the window closes.
33
36
 
34
- - It can't see that `processPayment()` has 40 callers across 3 services
35
- - It doesn't know your team uses `fetch` prefixes, not `get`
36
- - It forgot everything from yesterday's session
37
+ Every one of these is the same root cause: the agent has **no persistent memory of your code, your team's style, or its own past mistakes**. unerr is that memory. One process, fully local, indexed in seconds — and your agent picks it up automatically through MCP.
37
38
 
38
- unerr gives it a graph. Every caller, every dependency, every convention. The agent lands at the right code instead of searching for it.
39
+ ---
40
+
41
+ ## What you actually see
42
+
43
+ Run `unerr` and open the dashboard. Four panes, all live:
44
+
45
+ | Pane | Answers the question | Powered by |
46
+ |---|---|---|
47
+ | **Token Optimization** | *How much context did unerr save my agent this session?* — saved vs. delivered, compounding multiplier, breakdown by mechanism (compression, graph hits, skipped re-reads). | Per-turn ledger of every tool call |
48
+ | **Reasoning Quality** | *Did the agent actually use what it remembered?* — 4-pillar score across exploration, planning, execution, persistent memory. | 5-turn outcome window per fact/convention |
49
+ | **Codebase Map + Code Intelligence** | *What's the call graph and where are the blast-radius landmines?* — entities, edges, fan-in/out chokepoints, cross-module surprise links. | CozoDB graph (in-process, <5ms) |
50
+ | **Project Memory + Activity** | *What did we already learn, and what was I doing last time?* — facts the agent recorded, sessions stitched into intents, open blockers. | Append-only fact store + timeline.db |
51
+
52
+ The agent reads from the same store through MCP — every claim on the dashboard is also a tool call it just made.
53
+
54
+ ### See it in action
55
+
56
+ <p align="center">
57
+ <table>
58
+ <tr>
59
+ <td align="center">
60
+ <img src="https://unerr.dev/open-cli/screenshots/code-base-intelligence.png" alt="unerr codebase intelligence" width="130" />
61
+ <br/><sub>Codebase intelligence</sub>
62
+ </td>
63
+ <td align="center">
64
+ <img src="https://unerr.dev/open-cli/screenshots/reasoning-session.png" alt="unerr reasoning session" width="130" />
65
+ <br/><sub>Reasoning session</sub>
66
+ </td>
67
+ <td align="center">
68
+ <img src="https://unerr.dev/open-cli/screenshots/reasoning-quality.png" alt="unerr reasoning quality" width="130" />
69
+ <br/><sub>Reasoning quality</sub>
70
+ </td>
71
+ <td align="center">
72
+ <img src="https://unerr.dev/open-cli/screenshots/token-trace-main.png" alt="unerr token trace — main view" width="130" />
73
+ <br/><sub>Token trace</sub>
74
+ </td>
75
+ <td align="center">
76
+ <img src="https://unerr.dev/open-cli/screenshots/token-session.png" alt="unerr session token tracking" width="130" />
77
+ <br/><sub>Session tracking</sub>
78
+ </td>
79
+ <td align="center">
80
+ <img src="https://unerr.dev/open-cli/screenshots/token-turn.png" alt="unerr per-turn token breakdown" width="130" />
81
+ <br/><sub>Per-turn breakdown</sub>
82
+ </td>
83
+ </tr>
84
+ </table>
85
+ </p>
39
86
 
40
87
  ---
41
88
 
42
- ## What happens when you run it
89
+ ## Quick Start (4 explicit steps)
90
+
91
+ > unerr is **per-repository**. Each project gets its own `.unerr/` directory, graph DB, and config. Run install once per repo.
92
+
93
+ ### 1. Install the CLI globally
43
94
 
44
95
  ```bash
45
- npx @unerr/unerr
96
+ npm install -g @unerr-ai/unerr
97
+ # verify
98
+ unerr --version
46
99
  ```
47
100
 
48
- **5 seconds later**, your agent has:
49
-
50
- | Before unerr | After unerr |
51
- |:---|:---|
52
- | Reads 30 files to understand a call graph | Queries the graph in 5ms |
53
- | Misses downstream callers, breaks things | Sees full blast radius before editing |
54
- | Re-derives conventions every session | Knows your patterns, enforces them |
55
- | Session degrades at 70% context fill | Stays sharp — 93% shell compression, context lasts 3-5x longer |
56
- | Starts from zero tomorrow | Resumes where it left off |
101
+ ### 2. `cd` into the **root of the repository** you want to enhance
57
102
 
103
+ ```bash
104
+ cd /path/to/your-project # must be the repo root (where .git or package.json lives)
58
105
  ```
59
- unerr session (12 min)
60
- Tool calls 47 (all local, <5ms each)
61
- Tokens saved ~120K (93% shell compression + graph-targeted reads)
62
- Turns saved ~8 (approaches that would have failed, prevented)
106
+
107
+ This matters: every file unerr writes — `.mcp.json`, `.claude/`, `.cursor/`, `.unerr/`, `.gitignore` entry — is scoped to the current working directory. Running install from a subdirectory will create a stray, broken setup.
108
+
109
+ ### 3. Install unerr for your coding agent
110
+
111
+ Pick the agent you actually use. Each command writes the MCP config, agent-specific skill files, instruction injection, and (where supported) hooks — all in the current repo:
112
+
113
+ ```bash
114
+ unerr install claude-code # → .mcp.json + CLAUDE.md + .claude/skills/ + hooks
115
+ unerr install cursor # → .cursor/mcp.json + .cursor/rules/ + hooks
116
+ unerr install antigravity # → .antigravity/mcp_config.json + .agents/rules/ + .agents/skills/
117
+ unerr install windsurf # → ~/.codeium/windsurf/mcp_config.json + .windsurf/rules/ + .windsurf/skills/
118
+ unerr install gemini-cli # → .gemini/settings.json + GEMINI.md + .gemini/skills/
119
+ unerr install github-copilot-cli # → .copilot/mcp-config.json + .github/copilot-instructions.md + .github/skills/
63
120
  ```
64
121
 
65
- ---
122
+ What this actually does, in order:
123
+
124
+ 1. Writes a project-level MCP config (`{"command": "unerr", "args": ["--mcp"]}`) — never global.
125
+ 2. Drops 11 bundled skills into the agent's skills directory so the agent knows when to call which tool.
126
+ 3. Injects a tool-preference section into the agent's instruction file (CLAUDE.md, .cursor/rules, etc.) — idempotent, removable with `unerr uninstall`.
127
+ 4. Installs hooks where the agent supports them (Claude Code, Cursor, Cline) — these compress shell output and steer the agent back to graph tools.
128
+ 5. Adds `.unerr` to `.gitignore`.
129
+ 6. For Claude Code, denies built-in `Read`/`Grep`/`Glob` so the agent must use unerr's graph-aware equivalents (opt out with `--no-force-tools`).
130
+
131
+ > Need a different agent or doing it by hand? `unerr install --show-instructions <agent>` prints copy-pasteable setup. 16 agents are supported today (6 fully integrated, 10 in progress).
66
132
 
67
- ## Get Started
133
+ ### 4. Run `unerr` — and **keep it running**
68
134
 
69
135
  ```bash
70
- npx @unerr/unerr
136
+ unerr # first run: indexes the repo, starts the daemon; subsequent: resumes in <1s
71
137
  ```
72
138
 
73
- That's it. Auto-detects your IDE, indexes your codebase (~30s), starts serving intelligence via MCP.
139
+ **This is the part most people skip.** The `unerr --mcp` process your IDE spawns is just a **stdio bridge** — it owns nothing. All the intelligence (graph indexing, file watching, drift detection, fact storage, behavior automation) lives in the long-lived `unerr` daemon.
74
140
 
75
- ### Add to more agents
141
+ If the daemon isn't running, you still get tool responses, but they go stale: file edits won't show up in the graph, no incremental re-index, no live drift overlay, no convention auto-detection from new code. **Leave `unerr` running in a terminal tab or as a background service for the whole work session.** It uses ~80–200 MB and idles at near-zero CPU.
76
142
 
77
143
  ```bash
78
- unerr install claude-code # .mcp.json + .claude/skills/ + PreToolUse hook
79
- unerr install cursor # .cursor/mcp.json + .cursor/rules/
80
- unerr install vscode # .vscode/mcp.json + .github/copilot/
81
- unerr install windsurf # .windsurf/mcp.json + .windsurf/rules/
82
- unerr install zed # .zed/mcp.json
83
- unerr install codex # .codex/mcp.json
84
- unerr install gemini-cli # .gemini/settings.json
85
- unerr install kiro # .kiro/mcp.json
86
- unerr install aider # .aider/mcp.json
87
- unerr install continue # .continue/config.json
144
+ # typical workflow
145
+ unerr & # start daemon in background (or run in a tmux/screen pane)
146
+ # now open Claude Code / Cursor / etc. it auto-connects via MCP
88
147
  ```
89
148
 
90
- Works with any MCP-compatible agent. 15 supported out of the box.
149
+ After this, your agent connects automatically the next time you open the IDE. No config files to edit by hand.
91
150
 
92
151
  <details>
93
- <summary>Manual MCP config (any agent)</summary>
152
+ <summary>Manual MCP config (any MCP-compatible client)</summary>
94
153
 
95
154
  ```json
96
155
  {
97
156
  "mcpServers": {
98
157
  "unerr": {
99
158
  "command": "npx",
100
- "args": ["@unerr/unerr", "--mcp"]
159
+ "args": ["@unerr-ai/unerr", "--mcp"]
101
160
  }
102
161
  }
103
162
  }
@@ -107,28 +166,38 @@ Works with any MCP-compatible agent. 15 supported out of the box.
107
166
 
108
167
  ---
109
168
 
110
- ## What you get
169
+ ## What changes the moment you connect
111
170
 
112
- ### Instant (first session)
171
+ ### First session — instant value
113
172
 
114
- - **Graph navigation** — `get_callers` · `get_callees` · `get_imports` · `search_code` in <5ms. The agent stops reading 30 files to find one function.
115
- - **Blast radius** before editing, the agent sees every downstream dependency. No more confident wrong changes.
116
- - **Smart file reads** — `file_read({entity: "functionName"})` returns just that function + context. Not 2000 lines.
117
- - **Shell compression** — 10 strategies, 645 command classifiers. Diffs, errors, logs, test results, key-value, tabular — each compressed differently. **93% average compression** across real-world benchmarks (2MB138KB).
118
- - **Full output recovery** — when compression is significant, raw output is saved to disk with a recovery path. The agent can always access the original.
119
- - **Convention awareness** — auto-detected naming, structure, and import patterns injected into agent context.
173
+ - **Graph navigation in <5ms** — `get_entity`, `get_references`, `get_imports`, `search_code`. The agent stops reading 30 files to find one function.
174
+ - **Blast radius before edits** `get_references` returns every caller. No more confident wrong changes that ripple across services.
175
+ - **Targeted file reads** — `file_read({entity: "fnName"})` returns just that function + relevant conventions/facts, not 2000 lines.
176
+ - **Shell compression** — 11 strategies, 645+ command classifiers. Diffs, errors, logs, test runs, YAML — each compressed differently. **93% average compression** across real-world benchmarks (2 MB 138 KB). Raw output is kept on disk; the agent can recover it on demand.
177
+ - **Convention awareness** — naming, structure, import patterns auto-detected and injected into the agent's context.
178
+ - **Tool adoption nudging** — five reinforcement layers (exec nudges, hook interception, instruction injection, skill reminders, default-deny of built-ins on Claude Code) push the agent to use the graph instead of grep.
120
179
 
121
- ### Compounding (session 2+)
180
+ ### Session 2+ — it starts compounding
122
181
 
123
- - **Session persistence** — the agent tomorrow knows what the agent learned today. No more starting from zero.
124
- - **Convention enforcement** — patterns detected in session 1 are enforced in session 5. No manual `.cursorrules` maintenance.
125
- - **Anti-pattern rules** — when you revert bad code, unerr learns. That mistake never happens again.
126
- - **Durability scoring** — code that keeps getting rewritten gets flagged before the agent touches it.
127
- - **Loop prevention** — circuit breaker fires after repeated failed attempts.
182
+ - **Session persistence** — what the agent learned today is available tomorrow. No more starting from zero.
183
+ - **Fact memory** — `record_fact` persists conventions, decisions, and anti-patterns; `recall_facts` retrieves them with decay-adjusted confidence. Facts also auto-detect from coding sessions.
184
+ - **Episodic narratives** — when you reopen a file, the agent sees what was modified there, when, and why.
185
+ - **Loop prevention** — a circuit breaker fires after repeated failed attempts on the same entity, surfacing the failure mode instead of letting the agent thrash.
186
+ - **Memory-effectiveness scoring** — every fact and convention opens a 5-turn observation window and resolves to a verdict (reinforced / acted_on / caught / ignored / corrected). The Reasoning Quality pane shows the **load-bearing rate** — not just how much the agent remembered, but how much of it actually mattered.
128
187
 
129
- ### Shell compression benchmarks
188
+ ### Daemon mode — automated behaviors
189
+
190
+ When `unerr` is running long-lived, these activate in the background:
191
+
192
+ - **Architecture guard** — flags structural violations before they ship.
193
+ - **Cascade guard** — warns when an edit has wide blast radius.
194
+ - **Convention drift** — detects when new code diverges from established patterns.
195
+ - **Auto-doc** — generates docs for undocumented entities.
196
+ - **Change narrative** — tracks the story behind multi-step refactors.
197
+ - **Loop breaker** — intervenes when the agent is stuck retrying.
198
+ - **Session continuity** — preserves state across restarts.
130
199
 
131
- Every shell command the agent runs is classified (645 command patterns + content heuristics) and compressed with the best-fit strategy:
200
+ ### Shell compression benchmarks
132
201
 
133
202
  | Strategy | What it compresses | Avg compression |
134
203
  |----------|-------------------|:-:|
@@ -141,86 +210,109 @@ Every shell command the agent runs is classified (645 command patterns + content
141
210
  | **error_diagnostic** | `tsc`, `eslint`, `rustc`, `shellcheck` | **72%** |
142
211
  | **key_value** | `env`, `kubectl describe`, `systemctl status` | **48%** |
143
212
  | **tree_paths** | `find`, `tree`, `ls -R` | **42%** |
213
+ | **yaml** | YAML configs, `kubectl get -o yaml`, Helm output | adaptive |
144
214
  | **omni** | Fallback for unrecognized output | adaptive |
145
215
 
146
- **Overall: 93% compression** (2MB138KB across 40 real-world test cases). Low-confidence classifications use smart fallback — tries both the best-guess strategy and generic compression, picks whichever saves more tokens.
216
+ **Overall: 93% compression** (2 MB 138 KB across 40 real-world test cases).
147
217
 
148
218
  ### Language support
149
219
 
150
- | Language | Entity Extraction | Edge Extraction | Tree-sitter AST | SCIP |
151
- |----------|:-:|:-:|:-:|:-:|
152
- | TypeScript | ✓ | ✓ | ✓ | ✓ |
153
- | JavaScript | | ✓ | ✓ | ✓ |
154
- | Python | ✓ | ✓ | ✓ | ✓ |
155
- | Go | | | | |
156
- | Java | | | | |
157
- | Rust | ✓ | ✓ | ✓ | ✓ |
158
- | C# | | | ||
159
- | C / C++ | ✓ | ✓ | ✓ | — |
160
- | Ruby | ✓ | ✓ | ✓ | — |
161
- | PHP | ✓ | ✓ | ✓ | — |
162
- | Kotlin | ✓ | ✓ | ✓ | — |
163
- | Swift | ✓ | ✓ | ✓ | — |
164
-
165
- All 13 languages get full regex-based entity extraction (functions, classes, interfaces, methods with `parent_class` detection) and tree-sitter AST extraction when WASM grammars are available. SCIP integration provides compiler-verified call graphs for TypeScript, Python, Go, Java, and Rust.
220
+ | Language | Tier | Entities | Edges | Tree-sitter | SCIP |
221
+ |----------|:---:|:-:|:-:|:-:|:-:|
222
+ | TypeScript / JavaScript / Python / Go / Java / Kotlin / Scala / Rust / Ruby / C / C++ / C# | 1 | ✓ | ✓ | ✓ | ✓ |
223
+ | PHP / Swift / Lua / Dart / Elixir / Zig | 2 | ✓ | ✓ | ✓ | — |
224
+
225
+ **Tier 1** (12 languages): full tree-sitter AST + dedicated extraction + SCIP compiler-verified call graphs where the toolchain is on PATH.
226
+ **Tier 2** (6 languages): tree-sitter AST + generic extraction. Regex fallback for the rest.
227
+
228
+ **Tier 3 (search-discoverable):** Markdown, IaC (`.tf`, `.yaml`, `.toml`), schemas (`.proto`, `.graphql`, `.prisma`), SQL, shell, templates, build files, CI configs indexed for `search_code` only, no entity extraction.
166
229
 
167
230
  ---
168
231
 
169
232
  ## How it works
170
233
 
171
234
  ```
172
- AI Agent (Claude Code / Cursor / VS Code / Windsurf / any MCP client)
235
+ AI Agent (Claude Code / Cursor / Windsurf / any MCP client)
173
236
 
174
- ├── MCP tools ──→ unerr ──→ CozoDB graph (in-process, <5ms)
175
-
176
- ├── Convention engine (auto-detects patterns)
177
- ├── Session ledger (cross-session memory)
178
- ├── Token budgeter (prevents context rot)
179
- └── Compression engine (10 strategies, 645 classifiers)
237
+ ├── stdio MCP ──→ unerr --mcp (bridge, per IDE session)
238
+
239
+ └── UDS ──→ unerr (long-lived daemon, owns everything)
240
+
241
+ ├── CozoDB graph (in-process, <5ms)
242
+ ├── Fact store (cross-session memory)
243
+ │ ├── Timeline + ledger (every tool call)
244
+ │ ├── File watcher (incremental reindex)
245
+ │ ├── Convention engine
246
+ │ ├── Compression engine (11 strategies, 645+ classifiers)
247
+ │ └── Behavior modules (cascade-guard, loop-breaker, auto-doc…)
180
248
 
181
- └── CLI hooks ──→ Output compression ──→ Graph-aware prioritization
249
+ └── Dashboard ──→ http://localhost:<port> (SSE-streamed live)
182
250
  ```
183
251
 
184
- One process. Fully local. No API keys. No network calls. No cloud.
252
+ Two processes, one local DB. Zero network calls. No API keys. No cloud. Your code never leaves the machine.
185
253
 
186
254
  ---
187
255
 
188
- ## MCP Tools (17)
256
+ ## MCP Tools (20)
257
+
258
+ ### Graph Intelligence (8)
259
+
260
+ | Tool | What the agent gets |
261
+ |------|-----|
262
+ | `get_entity` | Any code entity — signature, body, callers, callees, risk |
263
+ | `get_file` | All entities in a file with risk summary |
264
+ | `get_references` | Callers (blast radius) or callees (dependencies) |
265
+ | `get_imports` | Import graph for a file |
266
+ | `search_code` | Graph-ranked full-text search across all entities |
267
+ | `get_conventions` | Detected naming/structure/import patterns + adherence rates |
268
+ | `get_critical_nodes` | High fan-in/fan-out chokepoints |
269
+ | `get_cross_boundary_links` | Unexpected cross-module dependencies, scored by surprise |
270
+
271
+ ### Structural Analysis (3)
272
+
273
+ | Tool | What the agent gets |
274
+ |------|-----|
275
+ | `get_project_stats` | Entity counts, risk distribution, health grade |
276
+ | `file_connections` | Imports + co-change correlations for a file |
277
+ | `get_test_coverage` | Direct + transitive tests for any entity |
278
+
279
+ ### File Protocol (2)
189
280
 
190
281
  | Tool | What the agent gets |
191
282
  |------|-----|
192
- | `get_function` | Function body + callers + blast radius + applicable conventions |
193
- | `get_class` | Class with inheritance, methods, and dependents |
194
- | `get_file` | All entities, imports, exports, risk summary |
195
- | `get_callers` | Every caller with file location and risk level |
196
- | `get_callees` | All downstream dependencies |
197
- | `get_imports` | Import/dependency graph |
198
- | `search_code` | Graph-ranked full-text search |
199
- | `get_rules` | Active rules for a path |
200
- | `check_rules` | Evaluate rules returns violations |
201
- | `get_conventions` | Naming, structure, import conventions |
202
- | `get_god_nodes` | High fan-in chokepoints |
203
- | `get_surprising_connections` | Unexpected cross-module dependencies |
204
- | `file_read` | Entity-targeted reads (not full file dumps) |
205
- | `file_outline` | File structure without content |
206
-
207
- Every response includes `_meta` (latency, risk level, drift status) and contextual warnings.
283
+ | `file_read` | Context-aware read auto-injects conventions and facts |
284
+ | `file_outline` | File structure (entities, exports) without reading the body |
285
+
286
+ ### Persistent Memory (2)
287
+
288
+ | Tool | What the agent gets |
289
+ |------|-----|
290
+ | `record_fact` | Persist a convention, decision, or anti-pattern |
291
+ | `recall_facts` | Retrieve facts with hierarchical scope + decay-adjusted confidence |
292
+
293
+ ### Session Narrative Markers (4)
294
+
295
+ Inline markers the agent emits as it works. Persisted to the shadow ledger and `.unerr/timeline.db` powers turn titles, cross-session intent stitching, the resume strip, and loop/blocker miners.
296
+
297
+ | Tool | What it does |
298
+ |------|-----|
299
+ | `mark_intent` | One-sentence task start (≤80 chars). Becomes the turn title |
300
+ | `mark_decision` | Records a chosen approach + up to 5 alternatives (≤140 chars) |
301
+ | `mark_blocker` | Flags an unresolved obstacle. Carries into the next session's resume strip |
302
+ | `mark_resolution` | Resolves a prior blocker by `marker_id` |
303
+
304
+ Every response includes `_meta` (latency, risk level, drift status) and inline `ur|<tag>` signals for high-priority guidance (drift, blast-radius warnings, circuit-breaker halts).
208
305
 
209
306
  ---
210
307
 
211
308
  <details>
212
- <summary><strong>Commands</strong></summary>
309
+ <summary><strong>CLI commands</strong></summary>
213
310
 
214
311
  ```bash
215
- unerr # Start MCP proxy (auto-started by IDE via MCP config)
216
- unerr status # Graph stats, health grade, active rules
217
- unerr stats # Session and weekly efficiency metrics
218
- unerr install <agent> # Add unerr to a specific AI coding agent
219
- unerr init # Initialize unerr in a new project
220
- unerr timeline # What happened across sessions
221
- unerr rewind # Restore to a previous working state
222
- unerr learn # Teach unerr a convention or correction
223
- unerr debug # Diagnostic dump
312
+ unerr # Start the long-lived daemon (or resume; auto-spawned by IDE if missing)
313
+ unerr --mcp # Stdio bridge what your IDE invokes via .mcp.json
314
+ unerr install <agent> # Install MCP config + skills + instructions for one agent
315
+ unerr uninstall # Remove unerr integration from agents in this repo
224
316
  ```
225
317
 
226
318
  </details>
@@ -230,26 +322,29 @@ unerr debug # Diagnostic dump
230
322
 
231
323
  ```
232
324
  src/
233
- entrypoints/ CLI entry + state machine
234
- intelligence/ CozoDB graph, AST, conventions, rules, search
235
- proxy/ MCP server, compression, session stats, token tracking
236
- tracking/ Prompt ledger, drift detection, git attribution
237
- commands/ CLI commands
238
- tools/ MCP tool implementations
239
- behaviors/ Agent behavior modules (cascade guard, loop breaker)
240
- config/ Agent registry, MCP config writer
241
- schemas/ Zod schemas
242
- utils/ Logging, detection, git helpers
325
+ entrypoints/ CLI entry + boot state machine
326
+ proxy/ MCP server (daemon), stdio↔UDS bridge, session stats, shell compression
327
+ intelligence/ CozoDB graph, AST extraction, conventions, rules, search, semantic
328
+ tracking/ Prompt ledger, drift detection, git attribution
329
+ behaviors/ Cascade guard, loop breaker, auto-doc, change narrative…
330
+ commands/ CLI commands (install, status, stats, timeline, learn, debug, …)
331
+ tools/ MCP tool implementations (intelligence + coding)
332
+ hooks/ Claude Code hook system integration
333
+ skills/ 11 bundled skill definitions
334
+ server/ + ui/ HTTP API + React (Vite) dashboard
335
+ config/ Agent registry (16 agents), MCP config writer, instruction injector
336
+ schemas/ Zod schemas
243
337
  ```
244
338
 
245
- **Design principles:**
246
- - Zero network calls — fully local, no API keys
247
- - stdout is sacred — MCP JSON-RPC only, everything else to stderr
248
- - <5ms query responses — CozoDB runs in-process (Rust via NAPI)
249
- - 30s time-to-value — shallow index first, deep enrichment in background
250
- - Enhancement, not dependency — agent falls back gracefully if unerr is unavailable
339
+ **Design principles**
251
340
 
252
- **Tech stack:** TypeScript (ESM) · CozoDB (Rust/NAPI) · web-tree-sitter (WASM) · MCP SDK · Ink (React CLI) · tsup · Vitest
341
+ - Zero network calls fully local, no API keys.
342
+ - stdout is sacred — MCP JSON-RPC only; everything else to stderr.
343
+ - <5 ms query responses — CozoDB runs in-process (Rust via NAPI).
344
+ - First useful output <5 s — shallow index first, deep enrichment in background.
345
+ - Graceful degradation — the agent still works if unerr is down, you just lose the intelligence layer.
346
+
347
+ **Tech stack** TypeScript (ESM) · CozoDB (Rust/NAPI) · web-tree-sitter (WASM) · MCP SDK · Ink (React CLI) · React + Vite (dashboard) · tsup · Vitest
253
348
 
254
349
  </details>
255
350
 
@@ -260,13 +355,11 @@ src/
260
355
  pnpm install
261
356
  pnpm run build # tsup → dist/ (ESM, node20)
262
357
  pnpm run dev # tsx watch
263
- pnpm run test:run # full suite (1455 tests)
358
+ pnpm run test:run # full suite
264
359
  pnpm run lint # biome check
265
360
  pnpm run typecheck # tsc --noEmit
266
- ```
267
361
 
268
- ```bash
269
- pnpm link --global # make `unerr` available globally
362
+ pnpm link --global # make local `unerr` available globally
270
363
  ```
271
364
 
272
365
  </details>
@@ -274,15 +367,15 @@ pnpm link --global # make `unerr` available globally
274
367
  <details>
275
368
  <summary><strong>Contributing</strong></summary>
276
369
 
277
- Contributions welcome. Please open an issue first.
370
+ Contributions welcome please open an issue first.
278
371
 
279
372
  **Before submitting a PR:**
280
- - Run `pnpm run typecheck && pnpm run lint && pnpm run test:run`
281
- - All output goes to stderr — never stdout (MCP JSON-RPC channel)
373
+ - `pnpm run typecheck && pnpm run lint && pnpm run test:run`
374
+ - All output to stderr — never stdout (MCP JSON-RPC channel)
282
375
  - All CozoDB interactions are async — always `await`
283
376
  - Use `.js` extensions in imports (NodeNext resolution)
284
377
 
285
- See [CLAUDE.md](./CLAUDE.md) for detailed conventions.
378
+ See [CLAUDE.md](./CLAUDE.md) for full conventions.
286
379
 
287
380
  </details>
288
381
 
@@ -295,7 +388,7 @@ See [CLAUDE.md](./CLAUDE.md) for detailed conventions.
295
388
  ---
296
389
 
297
390
  <p align="center">
298
- <code>npx @unerr/unerr</code>
391
+ <code>npm install -g @unerr-ai/unerr</code>
299
392
  <br /><br />
300
- <sub>One command. No cloud. No account. Free.</sub>
393
+ <a href="https://www.npmjs.com/package/@unerr-ai/unerr"><sub>npm registry</sub></a> · <sub>Fully local. No account. No cloud. Free.</sub>
301
394
  </p>