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

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
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="https://unerr.dev/icon-wordmark.svg" alt="unerr" width="320" />
2
+ <a href="https://www.unerr.dev/"><img src="https://unerr.dev/icon-wordmark.svg" alt="unerr — local intelligence layer for AI coding agents" width="320" /></a>
3
3
  </p>
4
4
 
5
5
  <p align="center">
@@ -7,97 +7,172 @@
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.unerr.dev/"><img src="https://img.shields.io/badge/website-unerr.dev-8B5CF6?style=flat-square&logo=icloud&logoColor=white" alt="Website" /></a>
16
+ <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>
17
+ <a href="https://discord.gg/JfZ4pYgb"><img src="https://img.shields.io/badge/community-Discord-5865F2?style=flat-square&logo=discord&logoColor=white" alt="Discord" /></a>
16
18
  <img src="https://img.shields.io/badge/runtime-Node.js_≥20-339933?style=flat-square&logo=node.js&logoColor=white" alt="Node.js" />
17
19
  <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" />
20
+ <img src="https://img.shields.io/badge/local--first-no_cloud-22D3EE?style=flat-square" alt="Local-first" />
19
21
  <img src="https://img.shields.io/badge/license-ELv2-A1A1AA?style=flat-square" alt="License" />
20
22
  </p>
21
23
 
22
24
  <p align="center">
23
- <code>npx @unerr/unerr</code>
25
+ <code>npm install -g @unerr-ai/unerr</code>
24
26
  </p>
25
27
 
26
28
  ---
27
29
 
28
- ## Your agent loops because it's blind
30
+ ## The agent isn't stupid. It's flying blind.
29
31
 
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.
32
+ Watch any AI coding session for ten minutes and you'll see the same loop:
31
33
 
32
- **The agent isn't stupid. It's blind.**
34
+ - It **reads 30 files** to find one function — burning the context window before it writes a line.
35
+ - It **edits something with 40 callers** and never knows it just broke three services.
36
+ - It **re-derives the same conventions** you taught it yesterday, this morning, and an hour ago.
37
+ - It **forgets the entire session** the moment the window closes.
33
38
 
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
39
+ 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
40
 
38
- unerr gives it a graph. Every caller, every dependency, every convention. The agent lands at the right code instead of searching for it.
41
+ ---
42
+
43
+ ## What you actually see
44
+
45
+ Run `unerr` and open the dashboard. Four panes, all live:
46
+
47
+ | Pane | Answers the question | Powered by |
48
+ |---|---|---|
49
+ | **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 |
50
+ | **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 |
51
+ | **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) |
52
+ | **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 |
53
+
54
+ The agent reads from the same store through MCP — every claim on the dashboard is also a tool call it just made.
55
+
56
+ ### See it in action
57
+
58
+ <table align="center">
59
+ <tr>
60
+ <td align="center" width="240">
61
+ <img src="https://unerr.dev/open-cli/screenshots/dashboard.png" alt="unerr dashboard — live overview" width="240" height="150" />
62
+ <br/><sub><strong>Dashboard</strong><br/>Live overview — active sessions, recent tool calls, tokens saved this turn.</sub>
63
+ </td>
64
+ <td align="center" width="240">
65
+ <img src="https://unerr.dev/open-cli/screenshots/token-trace-main.png" alt="unerr token trace — global" width="240" height="150" />
66
+ <br/><sub><strong>Token Trace · global</strong><br/>Aggregate savings across every session, broken down by mechanism (graph, file_read, shell, dedup, format).</sub>
67
+ </td>
68
+ <td align="center" width="240">
69
+ <img src="https://unerr.dev/open-cli/screenshots/token-session.png" alt="unerr token trace — session" width="240" height="150" />
70
+ <br/><sub><strong>Token Trace · session</strong><br/>Single session: per-turn savings, mechanism mix, and the compounding multiplier.</sub>
71
+ </td>
72
+ <td align="center" width="240">
73
+ <img src="https://unerr.dev/open-cli/screenshots/token-turn.png" alt="unerr token trace — turn" width="240" height="150" />
74
+ <br/><sub><strong>Token Trace · turn</strong><br/>Single turn: which tool calls fired, tokens each would have cost without unerr vs what was delivered.</sub>
75
+ </td>
76
+ </tr>
77
+ <tr>
78
+ <td align="center" width="240">
79
+ <img src="https://unerr.dev/open-cli/screenshots/reasoning-quality.png" alt="unerr reasoning quality — global" width="240" height="150" />
80
+ <br/><sub><strong>Reasoning Quality · global</strong><br/>Four-pillar score across cleaner context, fewer wasted turns, fewer breakages, persistent memory.</sub>
81
+ </td>
82
+ <td align="center" width="240">
83
+ <img src="https://unerr.dev/open-cli/screenshots/reasoning-session.png" alt="unerr reasoning quality — session" width="240" height="150" />
84
+ <br/><sub><strong>Reasoning Quality · session</strong><br/>Per-session: which facts and conventions were reinforced, acted on, ignored, or corrected.</sub>
85
+ </td>
86
+ <td align="center" width="240">
87
+ <img src="https://unerr.dev/open-cli/screenshots/code-base-intelligence.png" alt="unerr code intelligence" width="240" height="150" />
88
+ <br/><sub><strong>Code Intelligence</strong><br/>Call graph, fan-in/out chokepoints, cross-module surprise links, and a risk grade per file.</sub>
89
+ </td>
90
+ <td align="center" width="240">
91
+ <img src="https://unerr.dev/open-cli/screenshots/project-memory.png" alt="unerr project memory — facts" width="240" height="150" />
92
+ <br/><sub><strong>Project Memory</strong><br/>Conventions, anti-patterns, decisions — with decay-adjusted confidence and reinforcement counts.</sub>
93
+ </td>
94
+ </tr>
95
+ <tr>
96
+ <td align="center" width="240" colspan="4">
97
+ <img src="https://unerr.dev/open-cli/screenshots/activity.png" alt="unerr activity — timeline + heatmap" width="240" height="150" />
98
+ <br/><sub><strong>Activity</strong><br/>Turn-grouped timeline with a 30-day heatmap — each row is one burst of agent work (intent → tools → outcome).</sub>
99
+ </td>
100
+ </tr>
101
+ </table>
39
102
 
40
103
  ---
41
104
 
42
- ## What happens when you run it
105
+ ## Quick Start
106
+
107
+ > unerr is **per-repository**. Each project gets its own `.unerr/` directory, graph DB, and config. Run install once per repo.
108
+
109
+ ### 1. Install the CLI globally
43
110
 
44
111
  ```bash
45
- npx @unerr/unerr
112
+ npm install -g @unerr-ai/unerr
113
+ # verify
114
+ unerr --version
46
115
  ```
47
116
 
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 |
117
+ ### 2. `cd` into the **root of the repository** you want to enhance
57
118
 
119
+ ```bash
120
+ cd /path/to/your-project # must be the repo root (where .git or package.json lives)
58
121
  ```
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)
122
+
123
+ 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.
124
+
125
+ ### 3. Install unerr for your coding agent
126
+
127
+ 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:
128
+
129
+ ```bash
130
+ unerr install claude-code # → .mcp.json + CLAUDE.md + .claude/skills/ + hooks
131
+ unerr install cursor # → .cursor/mcp.json + .cursor/rules/ + hooks
132
+ unerr install antigravity # → .antigravity/mcp_config.json + .agents/rules/ + .agents/skills/
133
+ unerr install windsurf # → ~/.codeium/windsurf/mcp_config.json + .windsurf/rules/ + .windsurf/skills/
134
+ unerr install gemini-cli # → .gemini/settings.json + GEMINI.md + .gemini/skills/
135
+ unerr install github-copilot-cli # → .copilot/mcp-config.json + .github/copilot-instructions.md + .github/skills/
63
136
  ```
64
137
 
65
- ---
138
+ What it does:
139
+
140
+ 1. Writes a project-level MCP config (`{"command": "unerr", "args": ["--mcp"]}`) — never global.
141
+ 2. Drops 11 bundled skills into the agent's skills directory so the agent knows when to call which tool.
142
+ 3. Injects a tool-preference section into the agent's instruction file (CLAUDE.md, .cursor/rules, etc.) — idempotent, removable with `unerr uninstall`.
143
+ 4. Installs hooks where the agent supports them (Claude Code, Cursor, Cline) — these compress shell output and steer the agent back to graph tools.
144
+ 5. Adds `.unerr` to `.gitignore`.
145
+ 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`).
146
+
147
+ > Need a different agent or doing it by hand? `unerr install --show-instructions <agent>` prints copy-pasteable setup.
66
148
 
67
- ## Get Started
149
+ ### 4. Run `unerr` — and **keep it running**
68
150
 
69
151
  ```bash
70
- npx @unerr/unerr
152
+ unerr # first run: indexes the repo, starts the daemon; subsequent: resumes in <1s
71
153
  ```
72
154
 
73
- That's it. Auto-detects your IDE, indexes your codebase (~30s), starts serving intelligence via MCP.
155
+ **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
156
 
75
- ### Add to more agents
157
+ 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
158
 
77
159
  ```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
160
+ # typical workflow
161
+ unerr & # start daemon in background (or run in a tmux/screen pane)
162
+ # now open Claude Code / Cursor / etc. it auto-connects via MCP
88
163
  ```
89
164
 
90
- Works with any MCP-compatible agent. 15 supported out of the box.
165
+ After this, your agent connects automatically the next time you open the IDE. No config files to edit by hand.
91
166
 
92
167
  <details>
93
- <summary>Manual MCP config (any agent)</summary>
168
+ <summary>Manual MCP config (any MCP-compatible client)</summary>
94
169
 
95
170
  ```json
96
171
  {
97
172
  "mcpServers": {
98
173
  "unerr": {
99
174
  "command": "npx",
100
- "args": ["@unerr/unerr", "--mcp"]
175
+ "args": ["@unerr-ai/unerr", "--mcp"]
101
176
  }
102
177
  }
103
178
  }
@@ -107,28 +182,38 @@ Works with any MCP-compatible agent. 15 supported out of the box.
107
182
 
108
183
  ---
109
184
 
110
- ## What you get
185
+ ## What changes the moment you connect
111
186
 
112
- ### Instant (first session)
187
+ ### First session — instant value
113
188
 
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.
189
+ - **Graph navigation in <5ms** — `get_entity`, `get_references`, `get_imports`, `search_code`. The agent stops reading 30 files to find one function.
190
+ - **Blast radius before edits** `get_references` returns every caller. No more confident wrong changes that ripple across services.
191
+ - **Targeted file reads** — `file_read({entity: "fnName"})` returns just that function + relevant conventions/facts, not 2000 lines.
192
+ - **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.
193
+ - **Convention awareness** — naming, structure, import patterns auto-detected and injected into the agent's context.
194
+ - **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
195
 
121
- ### Compounding (session 2+)
196
+ ### Session 2+ — it starts compounding
122
197
 
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.
198
+ - **Session persistence** — what the agent learned today is available tomorrow. No more starting from zero.
199
+ - **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.
200
+ - **Episodic narratives** — when you reopen a file, the agent sees what was modified there, when, and why.
201
+ - **Loop prevention** — a circuit breaker fires after repeated failed attempts on the same entity, surfacing the failure mode instead of letting the agent thrash.
202
+ - **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
203
 
129
- ### Shell compression benchmarks
204
+ ### Daemon mode — automated behaviors
205
+
206
+ When `unerr` is running long-lived, these activate in the background:
130
207
 
131
- Every shell command the agent runs is classified (645 command patterns + content heuristics) and compressed with the best-fit strategy:
208
+ - **Architecture guard** flags structural violations before they ship.
209
+ - **Cascade guard** — warns when an edit has wide blast radius.
210
+ - **Convention drift** — detects when new code diverges from established patterns.
211
+ - **Auto-doc** — generates docs for undocumented entities.
212
+ - **Change narrative** — tracks the story behind multi-step refactors.
213
+ - **Loop breaker** — intervenes when the agent is stuck retrying.
214
+ - **Session continuity** — preserves state across restarts.
215
+
216
+ ### Shell compression benchmarks
132
217
 
133
218
  | Strategy | What it compresses | Avg compression |
134
219
  |----------|-------------------|:-:|
@@ -141,86 +226,109 @@ Every shell command the agent runs is classified (645 command patterns + content
141
226
  | **error_diagnostic** | `tsc`, `eslint`, `rustc`, `shellcheck` | **72%** |
142
227
  | **key_value** | `env`, `kubectl describe`, `systemctl status` | **48%** |
143
228
  | **tree_paths** | `find`, `tree`, `ls -R` | **42%** |
229
+ | **yaml** | YAML configs, `kubectl get -o yaml`, Helm output | adaptive |
144
230
  | **omni** | Fallback for unrecognized output | adaptive |
145
231
 
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.
232
+ **Overall: 93% compression** (2 MB 138 KB across 40 real-world test cases).
147
233
 
148
234
  ### Language support
149
235
 
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.
236
+ | Language | Tier | Entities | Edges | Tree-sitter | SCIP |
237
+ |----------|:---:|:-:|:-:|:-:|:-:|
238
+ | TypeScript / JavaScript / Python / Go / Java / Kotlin / Scala / Rust / Ruby / C / C++ / C# | 1 | ✓ | ✓ | ✓ | ✓ |
239
+ | PHP / Swift / Lua / Dart / Elixir / Zig | 2 | ✓ | ✓ | ✓ | — |
240
+
241
+ **Tier 1** (12 languages): full tree-sitter AST + dedicated extraction + SCIP compiler-verified call graphs where the toolchain is on PATH.
242
+ **Tier 2** (6 languages): tree-sitter AST + generic extraction. Regex fallback for the rest.
243
+
244
+ **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
245
 
167
246
  ---
168
247
 
169
248
  ## How it works
170
249
 
171
250
  ```
172
- AI Agent (Claude Code / Cursor / VS Code / Windsurf / any MCP client)
251
+ AI Agent (Claude Code / Cursor / Windsurf / any MCP client)
173
252
 
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)
253
+ ├── stdio MCP ──→ unerr --mcp (bridge, per IDE session)
254
+
255
+ └── UDS ──→ unerr (long-lived daemon, owns everything)
256
+
257
+ ├── CozoDB graph (in-process, <5ms)
258
+ ├── Fact store (cross-session memory)
259
+ │ ├── Timeline + ledger (every tool call)
260
+ │ ├── File watcher (incremental reindex)
261
+ │ ├── Convention engine
262
+ │ ├── Compression engine (11 strategies, 645+ classifiers)
263
+ │ └── Behavior modules (cascade-guard, loop-breaker, auto-doc…)
180
264
 
181
- └── CLI hooks ──→ Output compression ──→ Graph-aware prioritization
265
+ └── Dashboard ──→ http://localhost:<port> (SSE-streamed live)
182
266
  ```
183
267
 
184
- One process. Fully local. No API keys. No network calls. No cloud.
268
+ Two processes, one local DB. Zero network calls. No API keys. No cloud. Your code never leaves the machine.
185
269
 
186
270
  ---
187
271
 
188
- ## MCP Tools (17)
272
+ ## MCP Tools (20)
273
+
274
+ ### Graph Intelligence (8)
189
275
 
190
276
  | Tool | What the agent gets |
191
277
  |------|-----|
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.
278
+ | `get_entity` | Any code entity signature, body, callers, callees, risk |
279
+ | `get_file` | All entities in a file with risk summary |
280
+ | `get_references` | Callers (blast radius) or callees (dependencies) |
281
+ | `get_imports` | Import graph for a file |
282
+ | `search_code` | Graph-ranked full-text search across all entities |
283
+ | `get_conventions` | Detected naming/structure/import patterns + adherence rates |
284
+ | `get_critical_nodes` | High fan-in/fan-out chokepoints |
285
+ | `get_cross_boundary_links` | Unexpected cross-module dependencies, scored by surprise |
286
+
287
+ ### Structural Analysis (3)
288
+
289
+ | Tool | What the agent gets |
290
+ |------|-----|
291
+ | `get_project_stats` | Entity counts, risk distribution, health grade |
292
+ | `file_connections` | Imports + co-change correlations for a file |
293
+ | `get_test_coverage` | Direct + transitive tests for any entity |
294
+
295
+ ### File Protocol (2)
296
+
297
+ | Tool | What the agent gets |
298
+ |------|-----|
299
+ | `file_read` | Context-aware read — auto-injects conventions and facts |
300
+ | `file_outline` | File structure (entities, exports) without reading the body |
301
+
302
+ ### Persistent Memory (2)
303
+
304
+ | Tool | What the agent gets |
305
+ |------|-----|
306
+ | `record_fact` | Persist a convention, decision, or anti-pattern |
307
+ | `recall_facts` | Retrieve facts with hierarchical scope + decay-adjusted confidence |
308
+
309
+ ### Session Narrative — Markers (4)
310
+
311
+ 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.
312
+
313
+ | Tool | What it does |
314
+ |------|-----|
315
+ | `mark_intent` | One-sentence task start (≤80 chars). Becomes the turn title |
316
+ | `mark_decision` | Records a chosen approach + up to 5 alternatives (≤140 chars) |
317
+ | `mark_blocker` | Flags an unresolved obstacle. Carries into the next session's resume strip |
318
+ | `mark_resolution` | Resolves a prior blocker by `marker_id` |
319
+
320
+ 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
321
 
209
322
  ---
210
323
 
211
324
  <details>
212
- <summary><strong>Commands</strong></summary>
325
+ <summary><strong>CLI commands</strong></summary>
213
326
 
214
327
  ```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
328
+ unerr # Start the long-lived daemon (or resume; auto-spawned by IDE if missing)
329
+ unerr --mcp # Stdio bridge what your IDE invokes via .mcp.json
330
+ unerr install <agent> # Install MCP config + skills + instructions for one agent
331
+ unerr uninstall # Remove unerr integration from agents in this repo
224
332
  ```
225
333
 
226
334
  </details>
@@ -230,26 +338,29 @@ unerr debug # Diagnostic dump
230
338
 
231
339
  ```
232
340
  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
341
+ entrypoints/ CLI entry + boot state machine
342
+ proxy/ MCP server (daemon), stdio↔UDS bridge, session stats, shell compression
343
+ intelligence/ CozoDB graph, AST extraction, conventions, rules, search, semantic
344
+ tracking/ Prompt ledger, drift detection, git attribution
345
+ behaviors/ Cascade guard, loop breaker, auto-doc, change narrative…
346
+ commands/ CLI commands (install, status, stats, timeline, learn, debug, …)
347
+ tools/ MCP tool implementations (intelligence + coding)
348
+ hooks/ Claude Code hook system integration
349
+ skills/ 11 bundled skill definitions
350
+ server/ + ui/ HTTP API + React (Vite) dashboard
351
+ config/ Agent registry (16 agents), MCP config writer, instruction injector
352
+ schemas/ Zod schemas
243
353
  ```
244
354
 
245
- **Design principles:**
246
- - Zero network calls — fully local, no API keys
247
- - stdout is sacredMCP JSON-RPC only, everything else to stderr
248
- - <5ms query responsesCozoDB runs in-process (Rust via NAPI)
249
- - 30s time-to-valueshallow index first, deep enrichment in background
250
- - Enhancement, not dependencyagent falls back gracefully if unerr is unavailable
355
+ **Design principles**
356
+
357
+ - Zero network callsfully local, no API keys.
358
+ - stdout is sacredMCP JSON-RPC only; everything else to stderr.
359
+ - <5 ms query responses CozoDB runs in-process (Rust via NAPI).
360
+ - First useful output <5 s shallow index first, deep enrichment in background.
361
+ - Graceful degradation — the agent still works if unerr is down, you just lose the intelligence layer.
251
362
 
252
- **Tech stack:** TypeScript (ESM) · CozoDB (Rust/NAPI) · web-tree-sitter (WASM) · MCP SDK · Ink (React CLI) · tsup · Vitest
363
+ **Tech stack** TypeScript (ESM) · CozoDB (Rust/NAPI) · web-tree-sitter (WASM) · MCP SDK · Ink (React CLI) · React + Vite (dashboard) · tsup · Vitest
253
364
 
254
365
  </details>
255
366
 
@@ -260,13 +371,11 @@ src/
260
371
  pnpm install
261
372
  pnpm run build # tsup → dist/ (ESM, node20)
262
373
  pnpm run dev # tsx watch
263
- pnpm run test:run # full suite (1455 tests)
374
+ pnpm run test:run # full suite
264
375
  pnpm run lint # biome check
265
376
  pnpm run typecheck # tsc --noEmit
266
- ```
267
377
 
268
- ```bash
269
- pnpm link --global # make `unerr` available globally
378
+ pnpm link --global # make local `unerr` available globally
270
379
  ```
271
380
 
272
381
  </details>
@@ -274,15 +383,15 @@ pnpm link --global # make `unerr` available globally
274
383
  <details>
275
384
  <summary><strong>Contributing</strong></summary>
276
385
 
277
- Contributions welcome. Please open an issue first.
386
+ Contributions welcome please open an issue first.
278
387
 
279
388
  **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)
389
+ - `pnpm run typecheck && pnpm run lint && pnpm run test:run`
390
+ - All output to stderr — never stdout (MCP JSON-RPC channel)
282
391
  - All CozoDB interactions are async — always `await`
283
392
  - Use `.js` extensions in imports (NodeNext resolution)
284
393
 
285
- See [CLAUDE.md](./CLAUDE.md) for detailed conventions.
394
+ See [CLAUDE.md](./CLAUDE.md) for full conventions.
286
395
 
287
396
  </details>
288
397
 
@@ -295,7 +404,7 @@ See [CLAUDE.md](./CLAUDE.md) for detailed conventions.
295
404
  ---
296
405
 
297
406
  <p align="center">
298
- <code>npx @unerr/unerr</code>
407
+ <code>npm install -g @unerr-ai/unerr</code>
299
408
  <br /><br />
300
- <sub>One command. No cloud. No account. Free.</sub>
409
+ <a href="https://www.unerr.dev/"><sub>unerr.dev</sub></a> · <a href="https://www.npmjs.com/package/@unerr-ai/unerr"><sub>npm registry</sub></a> · <a href="https://discord.gg/2BjRftz8kG"><sub>Discord community</sub></a> · <sub>Fully local. No account. No cloud. Free.</sub>
301
410
  </p>