@unerr-ai/unerr 0.0.0-beta.9 → 0.0.1

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,14 +7,19 @@
7
7
  </p>
8
8
 
9
9
  <p align="center">
10
- The intelligence layer between your AI agent and your codebase.<br/>
11
- It sees every dependency, remembers every session, and gets smarter the longer you use it.
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="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>
15
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>
18
+ <a href="https://x.com/unerr_ai"><img src="https://img.shields.io/badge/follow-@unerr__ai-000000?style=flat-square&logo=x&logoColor=white" alt="X / Twitter" /></a>
19
+ <a href="https://www.linkedin.com/company/unerr"><img src="https://img.shields.io/badge/linkedin-unerr-0A66C2?style=flat-square&logo=linkedin&logoColor=white" alt="LinkedIn" /></a>
16
20
  <img src="https://img.shields.io/badge/runtime-Node.js_≥20-339933?style=flat-square&logo=node.js&logoColor=white" alt="Node.js" />
17
21
  <img src="https://img.shields.io/badge/protocol-MCP-7C3AED?style=flat-square" alt="MCP" />
22
+ <img src="https://img.shields.io/badge/local--first-no_cloud-22D3EE?style=flat-square" alt="Local-first" />
18
23
  <img src="https://img.shields.io/badge/license-ELv2-A1A1AA?style=flat-square" alt="License" />
19
24
  </p>
20
25
 
@@ -24,144 +29,145 @@
24
29
 
25
30
  ---
26
31
 
27
- ## Your agent loops because it's blind
32
+ ## The agent isn't stupid. It's flying blind.
28
33
 
29
- 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.
34
+ Watch any AI coding session for ten minutes and you'll see the same loop:
30
35
 
31
- **The agent isn't stupid. It's blind.**
36
+ - It **reads 30 files** to find one function — burning the context window before it writes a line.
37
+ - It **edits something with 40 callers** and never knows it just broke three services.
38
+ - It **re-derives the same conventions** you taught it yesterday, this morning, and an hour ago.
39
+ - It **forgets the entire session** the moment the window closes.
32
40
 
33
- - It can't see that `processPayment()` has 40 callers across 3 services
34
- - It doesn't know your team uses `fetch` prefixes, not `get`
35
- - It forgot everything from yesterday's session
36
-
37
- unerr gives it an intelligence layer that compounds. Every caller, every convention, every session — accumulated, not re-derived. The agent stops searching and starts knowing.
41
+ 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.
38
42
 
39
43
  ---
40
44
 
41
- ## What happens when you run it
45
+ ## What you actually see
46
+
47
+ Run `unerr` and open the dashboard. Four panes, all live:
42
48
 
43
- **5 seconds later**, your agent has:
49
+ | Pane | Answers the question | Powered by |
50
+ |---|---|---|
51
+ | **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 |
52
+ | **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 |
53
+ | **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) |
54
+ | **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 |
44
55
 
45
- | Before unerr | After unerr |
46
- |:---|:---|
47
- | Reads 30 files to understand a call graph | Queries the graph in 5ms |
48
- | Misses downstream callers, breaks things | Sees full blast radius before editing |
49
- | Re-derives conventions every session | Knows your patterns, enforces them |
50
- | Session degrades at 70% context fill | Stays sharp — 93% shell compression, context lasts 3–5x longer |
51
- | Starts from zero tomorrow | Resumes where it left off |
56
+ The agent reads from the same store through MCP — every claim on the dashboard is also a tool call it just made.
52
57
 
53
58
  ### See it in action
54
59
 
55
- <p align="center">
56
- <table>
57
- <tr>
58
- <td align="center">
59
- <img src="https://unerr.dev/open-cli/screenshots/code-base-intelligence.png" alt="unerr codebase intelligence" width="130" />
60
- <br/><sub>Codebase intelligence</sub>
61
- </td>
62
- <td align="center">
63
- <img src="https://unerr.dev/open-cli/screenshots/reasoning-session.png" alt="unerr reasoning session" width="130" />
64
- <br/><sub>Reasoning session</sub>
65
- </td>
66
- <td align="center">
67
- <img src="https://unerr.dev/open-cli/screenshots/reasoning-quality.png" alt="unerr reasoning quality" width="130" />
68
- <br/><sub>Reasoning quality</sub>
69
- </td>
70
- <td align="center">
71
- <img src="https://unerr.dev/open-cli/screenshots/token-trace-main.png" alt="unerr token trace main view" width="130" />
72
- <br/><sub>Token trace</sub>
73
- </td>
74
- <td align="center">
75
- <img src="https://unerr.dev/open-cli/screenshots/token-session.png" alt="unerr session token tracking" width="130" />
76
- <br/><sub>Session tracking</sub>
77
- </td>
78
- <td align="center">
79
- <img src="https://unerr.dev/open-cli/screenshots/token-turn.png" alt="unerr per-turn token breakdown" width="130" />
80
- <br/><sub>Per-turn breakdown</sub>
81
- </td>
82
- </tr>
83
- </table>
84
- </p>
60
+ <table align="center">
61
+ <tr>
62
+ <td align="center" width="240">
63
+ <img src="https://unerr.dev/open-cli/screenshots/dashboard.png" alt="unerr dashboard — live overview" width="240" height="150" />
64
+ <br/><sub><strong>Dashboard</strong><br/>Live overview active sessions, recent tool calls, tokens saved this turn.</sub>
65
+ </td>
66
+ <td align="center" width="240">
67
+ <img src="https://unerr.dev/open-cli/screenshots/token-trace-main.png" alt="unerr token trace — global" width="240" height="150" />
68
+ <br/><sub><strong>Token Trace · global</strong><br/>Aggregate savings across every session, broken down by mechanism (graph, file_read, shell, dedup, format).</sub>
69
+ </td>
70
+ <td align="center" width="240">
71
+ <img src="https://unerr.dev/open-cli/screenshots/token-session.png" alt="unerr token trace — session" width="240" height="150" />
72
+ <br/><sub><strong>Token Trace · session</strong><br/>Single session: per-turn savings, mechanism mix, and the compounding multiplier.</sub>
73
+ </td>
74
+ <td align="center" width="240">
75
+ <img src="https://unerr.dev/open-cli/screenshots/token-turn.png" alt="unerr token trace — turn" width="240" height="150" />
76
+ <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>
77
+ </td>
78
+ </tr>
79
+ <tr>
80
+ <td align="center" width="240">
81
+ <img src="https://unerr.dev/open-cli/screenshots/reasoning-quality.png" alt="unerr reasoning quality — global" width="240" height="150" />
82
+ <br/><sub><strong>Reasoning Quality · global</strong><br/>Four-pillar score across cleaner context, fewer wasted turns, fewer breakages, persistent memory.</sub>
83
+ </td>
84
+ <td align="center" width="240">
85
+ <img src="https://unerr.dev/open-cli/screenshots/reasoning-session.png" alt="unerr reasoning quality — session" width="240" height="150" />
86
+ <br/><sub><strong>Reasoning Quality · session</strong><br/>Per-session: which facts and conventions were reinforced, acted on, ignored, or corrected.</sub>
87
+ </td>
88
+ <td align="center" width="240">
89
+ <img src="https://unerr.dev/open-cli/screenshots/code-base-intelligence.png" alt="unerr code intelligence" width="240" height="150" />
90
+ <br/><sub><strong>Code Intelligence</strong><br/>Call graph, fan-in/out chokepoints, cross-module surprise links, and a risk grade per file.</sub>
91
+ </td>
92
+ <td align="center" width="240">
93
+ <img src="https://unerr.dev/open-cli/screenshots/project-memory.png" alt="unerr project memory — facts" width="240" height="150" />
94
+ <br/><sub><strong>Project Memory</strong><br/>Conventions, anti-patterns, decisions — with decay-adjusted confidence and reinforcement counts.</sub>
95
+ </td>
96
+ </tr>
97
+ <tr>
98
+ <td align="center" width="240" colspan="4">
99
+ <img src="https://unerr.dev/open-cli/screenshots/activity.png" alt="unerr activity — timeline + heatmap" width="240" height="150" />
100
+ <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>
101
+ </td>
102
+ </tr>
103
+ </table>
85
104
 
86
105
  ---
87
106
 
88
107
  ## Quick Start
89
108
 
90
- ### Install from npm
109
+ > unerr is **per-repository**. Each project gets its own `.unerr/` directory, graph DB, and config. Run install once per repo.
110
+
111
+ ### 1. Install the CLI globally
91
112
 
92
113
  ```bash
93
- # 1. Install globally
94
114
  npm install -g @unerr-ai/unerr
95
-
96
- # 2. Add to your AI agent (in your project directory)
97
- unerr install claude-code # or: cursor, vscode, windsurf, codex, etc.
98
-
99
- # 3. Run (indexes your codebase, starts MCP server)
100
- unerr
115
+ # verify
116
+ unerr --version
101
117
  ```
102
118
 
103
- <!--
104
- ### Install from source
119
+ ### 2. `cd` into the **root of the repository** you want to enhance
105
120
 
106
121
  ```bash
107
- # 1. Clone and build
108
- git clone https://github.com/unerr-cli.git
109
- cd unerr-cli
110
- pnpm install
111
- pnpm run build
122
+ cd /path/to/your-project # must be the repo root (where .git or package.json lives)
123
+ ```
112
124
 
113
- # 2. Link globally (makes `unerr` command available)
114
- pnpm link --global
125
+ 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.
115
126
 
116
- # 3. Add to your AI agent (in your project directory)
117
- cd /path/to/your/project
118
- unerr install claude-code # or: cursor, vscode, windsurf, codex, etc.
127
+ ### 3. Install unerr for your coding agent
119
128
 
120
- # 4. Run
121
- unerr
122
- ```
123
- -->
129
+ 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:
124
130
 
125
- After install, your AI agent automatically connects to unerr via MCP. No config files to edit manually.
131
+ ```bash
132
+ unerr install claude-code # → .mcp.json + CLAUDE.md + .claude/skills/ + hooks
133
+ unerr install cursor # → .cursor/mcp.json + .cursor/rules/ + hooks
134
+ unerr install antigravity # → .antigravity/mcp_config.json + .agents/rules/ + .agents/skills/
135
+ unerr install windsurf # → ~/.codeium/windsurf/mcp_config.json + .windsurf/rules/ + .windsurf/skills/
136
+ unerr install gemini-cli # → .gemini/settings.json + GEMINI.md + .gemini/skills/
137
+ unerr install github-copilot-cli # → .copilot/mcp-config.json + .github/copilot-instructions.md + .github/skills/
138
+ ```
126
139
 
127
- ---
140
+ What it does:
128
141
 
129
- ## Supported Agents
142
+ 1. Writes a project-level MCP config (`{"command": "unerr", "args": ["--mcp"]}`) — never global.
143
+ 2. Drops 11 bundled skills into the agent's skills directory so the agent knows when to call which tool.
144
+ 3. Injects a tool-preference section into the agent's instruction file (CLAUDE.md, .cursor/rules, etc.) — idempotent, removable with `unerr uninstall`.
145
+ 4. Installs hooks where the agent supports them (Claude Code, Cursor, Cline) — these compress shell output and steer the agent back to graph tools.
146
+ 5. Adds `.unerr` to `.gitignore`.
147
+ 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
148
 
131
- ### Integrated
149
+ > Need a different agent or doing it by hand? `unerr install --show-instructions <agent>` prints copy-pasteable setup.
132
150
 
133
- Fully tested with MCP config, instruction injection, skills, and hooks.
151
+ ### 4. Run `unerr` and **keep it running**
134
152
 
135
153
  ```bash
136
- unerr install claude-code # .mcp.json + CLAUDE.md + .claude/skills/ + hooks
137
- unerr install cursor # .cursor/mcp.json + .cursor/rules/ + hooks
138
- unerr install antigravity # .antigravity/mcp_config.json + .agents/rules/ + .agents/skills/
139
- unerr install windsurf # ~/.codeium/windsurf/mcp_config.json + .windsurf/rules/ + .windsurf/skills/
140
- unerr install gemini-cli # .gemini/settings.json + GEMINI.md + .gemini/skills/
141
- unerr install github-copilot-cli # .copilot/mcp-config.json + .github/copilot-instructions.md + .github/skills/
154
+ unerr # first run: indexes the repo, starts the daemon; subsequent: resumes in <1s
142
155
  ```
143
156
 
144
- ### Work in Progress
157
+ **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.
145
158
 
146
- MCP config and basic integration work. Instruction injection, skills, and hooks support varies contributions welcome.
159
+ 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.
147
160
 
148
161
  ```bash
149
- unerr install vscode # .vscode/mcp.json + .github/copilot-instructions.md
150
- unerr install zed # .zed/mcp.json
151
- unerr install cline # .cline/mcp.json + .clinerules
152
- unerr install kiro # .kiro/mcp.json
153
- unerr install codex # .codex/mcp.json + AGENTS.md
154
- unerr install aider # .aider/mcp.json
155
- unerr install opencode # .opencode/mcp.json
156
- unerr install trae # .trae/mcp.json
157
- unerr install augment # .augment/mcp.json
158
- unerr install continue # .continue/config.json
162
+ # typical workflow
163
+ unerr & # start daemon in background (or run in a tmux/screen pane)
164
+ # now open Claude Code / Cursor / etc. it auto-connects via MCP
159
165
  ```
160
166
 
161
- 16 agents supported (6 integrated, 10 in progress). Works with any MCP-compatible client.
167
+ After this, your agent connects automatically the next time you open the IDE. No config files to edit by hand.
162
168
 
163
169
  <details>
164
- <summary>Manual MCP config (any agent)</summary>
170
+ <summary>Manual MCP config (any MCP-compatible client)</summary>
165
171
 
166
172
  ```json
167
173
  {
@@ -178,45 +184,39 @@ unerr install continue # .continue/config.json
178
184
 
179
185
  ---
180
186
 
181
- ## What you get
187
+ ## What changes the moment you connect
182
188
 
183
- ### Instant (first session)
189
+ ### First session — instant value
184
190
 
185
- - **Graph navigation** — `get_entity` · `get_references` · `get_imports` · `search_code` in <5ms. The agent stops reading 30 files to find one function.
186
- - **Blast radius** before editing, the agent sees every downstream caller via `get_references`. No more confident wrong changes.
187
- - **Smart file reads** — `file_read({entity: "functionName"})` returns just that function + context. Not 2000 lines.
188
- - **Shell compression** — 11 strategies, 645+ command classifiers. Diffs, errors, logs, test results, YAML, key-value, tabular — each compressed differently. **93% average compression** across real-world benchmarks (2MB138KB).
189
- - **Full output recovery** — when compression is significant, raw output is saved to disk with a recovery path. The agent can always access the original.
190
- - **Convention awareness** — auto-detected naming, structure, and import patterns injected into agent context.
191
- - **Semantic search** — `semantic_search` finds conceptually similar code even with different naming. `find_similar` discovers related entities by embedding distance.
192
- - **Business context** — `get_business_context` explains why code exists — purpose, feature area, taxonomy.
193
- - **Tool adoption nudging** — 5-layer reinforcement system ensures agents consistently use unerr MCP tools over built-in alternatives. Exec nudges, hook interception, instruction-level enforcement, and skill reminders — all automatic, zero config.
191
+ - **Graph navigation in <5ms** — `get_entity`, `get_references`, `get_imports`, `search_code`. The agent stops reading 30 files to find one function.
192
+ - **Blast radius before edits** `get_references` returns every caller. No more confident wrong changes that ripple across services.
193
+ - **Targeted file reads** — `file_read({entity: "fnName"})` returns just that function + relevant conventions/facts, not 2000 lines.
194
+ - **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.
195
+ - **Convention awareness** — naming, structure, import patterns auto-detected and injected into the agent's context.
196
+ - **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.
194
197
 
195
- ### Compounding (session 2+)
198
+ ### Session 2+ — it starts compounding
196
199
 
197
- - **Session persistence** — the agent tomorrow knows what the agent learned today. No more starting from zero.
198
- - **Fact memory** — `record_fact` persists conventions, decisions, and anti-patterns across sessions. `recall_facts` retrieves them with decay-adjusted confidence.
199
- - **Convention enforcement** — patterns detected in session 1 are enforced in session 5. No manual `.cursorrules` maintenance.
200
- - **Anti-pattern rules** — when you revert bad code, unerr learns. That mistake never happens again.
201
- - **Shadow ledger** — `unerr_mark_working` snapshots known-good state. `unerr_revert_to_working_state` rolls back when things break. `unerr_get_timeline` shows what changed across sessions.
202
- - **Loop prevention** — circuit breaker fires after repeated failed attempts.
200
+ - **Session persistence** — what the agent learned today is available tomorrow. No more starting from zero.
201
+ - **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.
202
+ - **Episodic narratives** — when you reopen a file, the agent sees what was modified there, when, and why.
203
+ - **Loop prevention** — a circuit breaker fires after repeated failed attempts on the same entity, surfacing the failure mode instead of letting the agent thrash.
204
+ - **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.
203
205
 
204
- ### Agent behaviors (long-lived mode)
206
+ ### Daemon mode automated behaviors
205
207
 
206
- When running `unerr` as a daemon, these automated behaviors activate:
208
+ When `unerr` is running long-lived, these activate in the background:
207
209
 
208
- - **Architecture guard** — flags structural violations before they ship
209
- - **Cascade guard** — warns when a change has wide blast radius
210
- - **Convention drift** — detects when new code diverges from established patterns
211
- - **Auto-doc** — generates documentation for undocumented entities
212
- - **Change narrative** — tracks the story behind multi-step refactors
213
- - **Loop breaker** — intervenes when the agent is stuck in a retry loop
214
- - **Session continuity** — preserves context across restarts
210
+ - **Architecture guard** — flags structural violations before they ship.
211
+ - **Cascade guard** — warns when an edit has wide blast radius.
212
+ - **Convention drift** — detects when new code diverges from established patterns.
213
+ - **Auto-doc** — generates docs for undocumented entities.
214
+ - **Change narrative** — tracks the story behind multi-step refactors.
215
+ - **Loop breaker** — intervenes when the agent is stuck retrying.
216
+ - **Session continuity** — preserves state across restarts.
215
217
 
216
218
  ### Shell compression benchmarks
217
219
 
218
- Every shell command the agent runs is classified (645+ command patterns + content heuristics) and compressed with the best-fit strategy:
219
-
220
220
  | Strategy | What it compresses | Avg compression |
221
221
  |----------|-------------------|:-:|
222
222
  | **diff** | `git diff`, patch output | **99%** |
@@ -231,136 +231,106 @@ Every shell command the agent runs is classified (645+ command patterns + conten
231
231
  | **yaml** | YAML configs, `kubectl get -o yaml`, Helm output | adaptive |
232
232
  | **omni** | Fallback for unrecognized output | adaptive |
233
233
 
234
- **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.
234
+ **Overall: 93% compression** (2 MB 138 KB across 40 real-world test cases).
235
235
 
236
236
  ### Language support
237
237
 
238
- | Language | Tier | Entity Extraction | Edge Extraction | Tree-sitter AST | SCIP |
238
+ | Language | Tier | Entities | Edges | Tree-sitter | SCIP |
239
239
  |----------|:---:|:-:|:-:|:-:|:-:|
240
- | TypeScript | 1 | ✓ | ✓ | ✓ | ✓ |
241
- | JavaScript | 1 | ✓ | ✓ | ✓ | |
242
- | Python | 1 | ✓ | ✓ | ✓ | ✓ |
243
- | Go | 1 | | | | |
244
- | Java | 1 | | | | |
245
- | Kotlin | 1 | ✓ | ✓ | ✓ | ✓ |
246
- | Scala | 1 | | | | |
247
- | Rust | 1 | ✓ | ✓ | ✓ | ✓ |
248
- | Ruby | 1 | ✓ | ✓ | ✓ | ✓ |
249
- | C | 1 | ✓ | ✓ | ✓ | ✓ |
250
- | C++ | 1 | ✓ | ✓ | ✓ | ✓ |
251
- | C# | 1 | ✓ | ✓ | ✓ | ✓ |
252
- | PHP | 2 | ✓ | ✓ | ✓ | — |
253
- | Swift | 2 | ✓ | ✓ | ✓ | — |
254
- | Lua | 2 | ✓ | ✓ | ✓ | — |
255
- | Dart | 2 | ✓ | ✓ | ✓ | — |
256
- | Elixir | 2 | ✓ | ✓ | ✓ | — |
257
- | Zig | 2 | ✓ | ✓ | ✓ | — |
258
-
259
- **Tier 1** (13 languages): Full tree-sitter AST + dedicated extraction plugins + SCIP compiler-verified call graphs where available.
260
- **Tier 2** (5 languages): Tree-sitter AST + generic extraction. Regex fallback for unsupported languages.
261
-
262
- #### Tier 3: Discoverable (Search Only)
263
-
264
- Tier 3 files are indexed for search discoverability — agents can find them via `search_code` using filename tokens and format-specific content extraction (headings, resource names, model definitions, etc.). No code entity extraction.
265
-
266
- | Category | Extensions |
267
- |----------|------------|
268
- | Documentation | `.md`, `.mdx`, `.txt`, `.rst`, `.adoc`, `.org`, `.tex` |
269
- | Declarative / IaC | `.tf`, `.tfvars`, `.hcl`, `.yaml`, `.yml`, `.toml`, `.json`, `.xml` |
270
- | Schemas / IDL | `.proto`, `.graphql`, `.gql`, `.prisma`, `.avsc`, `.thrift`, `.smithy` |
271
- | SQL | `.sql` |
272
- | Shell | `.sh`, `.bash`, `.zsh` |
273
- | Web / Templates | `.html`, `.css`, `.scss`, `.sass`, `.less`, `.vue`, `.svelte`, `.astro`, `.j2`, `.tmpl`, `.hbs`, `.ejs`, `.pug` |
274
- | Build / Make | `.cmake`, `.bazel`, `.bzl`, `.mk`, `Makefile`, `Dockerfile`, `Jenkinsfile` |
275
- | Config | `.ini`, `.cfg`, `.conf`, `.properties`, `.csv`, `.tsv`, `.editorconfig` |
276
- | CI/CD | `.github/workflows/*.yml`, `.gitlab-ci.yml` |
240
+ | TypeScript / JavaScript / Python / Go / Java / Kotlin / Scala / Rust / Ruby / C / C++ / C# | 1 | ✓ | ✓ | ✓ | ✓ |
241
+ | PHP / Swift / Lua / Dart / Elixir / Zig | 2 | ✓ | ✓ | ✓ | |
242
+
243
+ **Tier 1** (12 languages): full tree-sitter AST + dedicated extraction + SCIP compiler-verified call graphs where the toolchain is on PATH.
244
+ **Tier 2** (6 languages): tree-sitter AST + generic extraction. Regex fallback for the rest.
245
+
246
+ **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.
277
247
 
278
248
  ---
279
249
 
280
250
  ## How it works
281
251
 
282
252
  ```
283
- AI Agent (Claude Code / Cursor / VS Code / Windsurf / any MCP client)
284
-
285
- ├── MCP tools ──→ unerr ──→ CozoDB graph (in-process, <5ms)
286
- │ │
287
- │ ├── Convention engine (auto-detects patterns)
288
- │ ├── Fact store (cross-session memory)
289
- │ ├── Shadow ledger (mark-working / revert / timeline)
290
- │ ├── Token budgeter (prevents context rot)
291
- │ └── Compression engine (11 strategies, 645+ classifiers)
253
+ AI Agent (Claude Code / Cursor / Windsurf / any MCP client)
292
254
 
293
- ├── CLI hooks ──→ Output compression ──→ Graph-aware prioritization
255
+ ├── stdio MCP ──→ unerr --mcp (bridge, per IDE session)
256
+ │ │
257
+ │ └── UDS ──→ unerr (long-lived daemon, owns everything)
258
+ │ │
259
+ │ ├── CozoDB graph (in-process, <5ms)
260
+ │ ├── Fact store (cross-session memory)
261
+ │ ├── Timeline + ledger (every tool call)
262
+ │ ├── File watcher (incremental reindex)
263
+ │ ├── Convention engine
264
+ │ ├── Compression engine (11 strategies, 645+ classifiers)
265
+ │ └── Behavior modules (cascade-guard, loop-breaker, auto-doc…)
294
266
 
295
- └── Tool nudging ──→ 5-layer adoption reinforcement (hooks, exec, instructions)
267
+ └── Dashboard ──→ http://localhost:<port> (SSE-streamed live)
296
268
  ```
297
269
 
298
- One process. Fully local. No API keys. No network calls. No cloud.
270
+ Two processes, one local DB. Zero network calls. No API keys. No cloud. Your code never leaves the machine.
299
271
 
300
272
  ---
301
273
 
302
274
  ## MCP Tools (20)
303
275
 
304
- ### Graph Intelligence (15)
276
+ ### Graph Intelligence (8)
305
277
 
306
278
  | Tool | What the agent gets |
307
279
  |------|-----|
308
- | `get_entity` | Any code entity (function, class, type) — signature, body, callers, callees, risk level |
309
- | `get_file` | All entities defined in a file with risk summary |
310
- | `get_references` | All callers (blast radius) or callees (dependencies) of an entity |
311
- | `get_imports` | Import/dependency graph for a file |
312
- | `search_code` | Graph-ranked full-text search across all indexed entities |
313
- | `get_rules` | Active rules for a path optionally validates code against them |
314
- | `get_conventions` | Detected naming, structure, import conventions with adherence rates |
315
- | `get_business_context` | Why code exists — purpose, taxonomy, feature area |
316
- | `get_critical_nodes` | High fan-in/fan-out chokepoints (structural bottlenecks) |
317
- | `get_cross_boundary_links` | Unexpected cross-module dependencies scored by surprise |
318
- | `semantic_search` | Vector-based conceptual search (finds similar code with different names) |
319
- | `find_similar` | Entities similar to a given entity by embedding distance |
320
- | `get_project_stats` | Project-wide entity counts, risk distribution, health grade |
321
- | `file_connections` | Connected files — imports, co-change correlations, structure |
322
- | `get_test_coverage` | Direct and transitive test coverage for any entity |
280
+ | `get_entity` | Any code entity — signature, body, callers, callees, risk |
281
+ | `get_file` | All entities in a file with risk summary |
282
+ | `get_references` | Callers (blast radius) or callees (dependencies) |
283
+ | `get_imports` | Import graph for a file |
284
+ | `search_code` | Graph-ranked full-text search across all entities |
285
+ | `get_conventions` | Detected naming/structure/import patterns + adherence rates |
286
+ | `get_critical_nodes` | High fan-in/fan-out chokepoints |
287
+ | `get_cross_boundary_links` | Unexpected cross-module dependencies, scored by surprise |
323
288
 
324
- ### File Protocol (2)
289
+ ### Structural Analysis (3)
325
290
 
326
291
  | Tool | What the agent gets |
327
292
  |------|-----|
328
- | `file_read` | Context-aware file reading auto-injects conventions and facts |
329
- | `file_outline` | File structure (functions, classes, exports) without reading content |
293
+ | `get_project_stats` | Entity counts, risk distribution, health grade |
294
+ | `file_connections` | Imports + co-change correlations for a file |
295
+ | `get_test_coverage` | Direct + transitive tests for any entity |
330
296
 
331
- ### Persistent Intelligence (2)
297
+ ### File Protocol (2)
332
298
 
333
299
  | Tool | What the agent gets |
334
300
  |------|-----|
335
- | `record_fact` | Persist a convention, decision, or anti-pattern to the fact store |
336
- | `recall_facts` | Retrieve stored facts with decay-adjusted confidence scoring |
301
+ | `file_read` | Context-aware read auto-injects conventions and facts |
302
+ | `file_outline` | File structure (entities, exports) without reading the body |
337
303
 
338
- ### Shadow Ledger (3)
304
+ ### Persistent Memory (2)
339
305
 
340
306
  | Tool | What the agent gets |
341
307
  |------|-----|
342
- | `unerr_mark_working` | Snapshot current known-good state before risky changes |
343
- | `unerr_revert_to_working_state` | Roll back to last working snapshot |
344
- | `unerr_get_timeline` | View modification timeline across sessions |
308
+ | `record_fact` | Persist a convention, decision, or anti-pattern |
309
+ | `recall_facts` | Retrieve facts with hierarchical scope + decay-adjusted confidence |
310
+
311
+ ### Session Narrative — Markers (4)
345
312
 
346
- Every response includes `_meta` (latency, risk level, drift status) and contextual warnings.
313
+ 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.
314
+
315
+ | Tool | What it does |
316
+ |------|-----|
317
+ | `mark_intent` | One-sentence task start (≤80 chars). Becomes the turn title |
318
+ | `mark_decision` | Records a chosen approach + up to 5 alternatives (≤140 chars) |
319
+ | `mark_blocker` | Flags an unresolved obstacle. Carries into the next session's resume strip |
320
+ | `mark_resolution` | Resolves a prior blocker by `marker_id` |
321
+
322
+ 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).
347
323
 
348
324
  ---
349
325
 
350
326
  <details>
351
- <summary><strong>Commands</strong></summary>
327
+ <summary><strong>CLI commands</strong></summary>
352
328
 
353
329
  ```bash
354
- unerr # Start MCP proxy (auto-started by IDE via MCP config)
355
- unerr status # Graph stats, health grade, active rules
356
- unerr stats # Session and weekly efficiency metrics
357
- unerr install <agent> # Add unerr to a specific AI coding agent
358
- unerr uninstall # Remove unerr integration from agents
359
- unerr init # Initialize unerr in a new project
360
- unerr timeline # What happened across sessions
361
- unerr rewind # Restore to a previous working state
362
- unerr learn # Teach unerr a convention or correction
363
- unerr debug # Diagnostic dump
330
+ unerr # Start the long-lived daemon (or resume; auto-spawned by IDE if missing)
331
+ unerr --mcp # Stdio bridge what your IDE invokes via .mcp.json
332
+ unerr install <agent> # Install MCP config + skills + instructions for one agent
333
+ unerr uninstall # Remove unerr integration from agents in this repo
364
334
  ```
365
335
 
366
336
  </details>
@@ -370,30 +340,29 @@ unerr debug # Diagnostic dump
370
340
 
371
341
  ```
372
342
  src/
373
- entrypoints/ CLI entry + boot state machine
374
- intelligence/ CozoDB graph, AST extraction, conventions, rules, search, semantic
375
- proxy/ MCP server, shell compression, session stats, token tracking
376
- tracking/ Prompt ledger, drift detection, git attribution
377
- behaviors/ Agent behavior modules (cascade guard, loop breaker, auto-doc, etc.)
378
- commands/ CLI commands (install, status, stats, timeline, learn, debug, etc.)
379
- tools/ MCP tool implementations (intelligence + coding)
380
- hooks/ Claude Code hook system integration
381
- skills/ Bundled skill definitions for agent installation
382
- server/ HTTP dashboard API server
383
- ui/ React (Vite) dashboard frontend
384
- config/ Agent registry, MCP config writer, settings
385
- schemas/ Zod schemas for entity/edge/rule types
386
- utils/ Logging, detection, git helpers
343
+ entrypoints/ CLI entry + boot state machine
344
+ proxy/ MCP server (daemon), stdio↔UDS bridge, session stats, shell compression
345
+ intelligence/ CozoDB graph, AST extraction, conventions, rules, search, semantic
346
+ tracking/ Prompt ledger, drift detection, git attribution
347
+ behaviors/ Cascade guard, loop breaker, auto-doc, change narrative…
348
+ commands/ CLI commands (install, status, stats, timeline, learn, debug, )
349
+ tools/ MCP tool implementations (intelligence + coding)
350
+ hooks/ Claude Code hook system integration
351
+ skills/ 11 bundled skill definitions
352
+ server/ + ui/ HTTP API + React (Vite) dashboard
353
+ config/ Agent registry (16 agents), MCP config writer, instruction injector
354
+ schemas/ Zod schemas
387
355
  ```
388
356
 
389
- **Design principles:**
390
- - Zero network calls — fully local, no API keys
391
- - stdout is sacred — MCP JSON-RPC only, everything else to stderr
392
- - <5ms query responses — CozoDB runs in-process (Rust via NAPI)
393
- - 30s time-to-value — shallow index first, deep enrichment in background
394
- - Enhancement, not dependency — agent falls back gracefully if unerr is unavailable
357
+ **Design principles**
395
358
 
396
- **Tech stack:** TypeScript (ESM) · CozoDB (Rust/NAPI) · web-tree-sitter (WASM) · MCP SDK · Ink (React CLI) · tsup · Vitest
359
+ - Zero network calls fully local, no API keys.
360
+ - stdout is sacred — MCP JSON-RPC only; everything else to stderr.
361
+ - <5 ms query responses — CozoDB runs in-process (Rust via NAPI).
362
+ - First useful output <5 s — shallow index first, deep enrichment in background.
363
+ - Graceful degradation — the agent still works if unerr is down, you just lose the intelligence layer.
364
+
365
+ **Tech stack** TypeScript (ESM) · CozoDB (Rust/NAPI) · web-tree-sitter (WASM) · MCP SDK · Ink (React CLI) · React + Vite (dashboard) · tsup · Vitest
397
366
 
398
367
  </details>
399
368
 
@@ -407,10 +376,8 @@ pnpm run dev # tsx watch
407
376
  pnpm run test:run # full suite
408
377
  pnpm run lint # biome check
409
378
  pnpm run typecheck # tsc --noEmit
410
- ```
411
379
 
412
- ```bash
413
- pnpm link --global # make `unerr` available globally
380
+ pnpm link --global # make local `unerr` available globally
414
381
  ```
415
382
 
416
383
  </details>
@@ -418,15 +385,15 @@ pnpm link --global # make `unerr` available globally
418
385
  <details>
419
386
  <summary><strong>Contributing</strong></summary>
420
387
 
421
- Contributions welcome. Please open an issue first.
388
+ Contributions welcome please open an issue first.
422
389
 
423
390
  **Before submitting a PR:**
424
- - Run `pnpm run typecheck && pnpm run lint && pnpm run test:run`
425
- - All output goes to stderr — never stdout (MCP JSON-RPC channel)
391
+ - `pnpm run typecheck && pnpm run lint && pnpm run test:run`
392
+ - All output to stderr — never stdout (MCP JSON-RPC channel)
426
393
  - All CozoDB interactions are async — always `await`
427
394
  - Use `.js` extensions in imports (NodeNext resolution)
428
395
 
429
- See [CLAUDE.md](./CLAUDE.md) for detailed conventions.
396
+ See [CLAUDE.md](./CLAUDE.md) for full conventions.
430
397
 
431
398
  </details>
432
399
 
@@ -441,5 +408,5 @@ See [CLAUDE.md](./CLAUDE.md) for detailed conventions.
441
408
  <p align="center">
442
409
  <code>npm install -g @unerr-ai/unerr</code>
443
410
  <br /><br />
444
- <a href="https://www.npmjs.com/package/@unerr-ai/unerr"><sub>npm registry</sub></a> · <sub>No cloud. No account. Free.</sub>
411
+ <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</sub></a> · <a href="https://x.com/unerr_ai"><sub>X</sub></a> · <a href="https://www.linkedin.com/company/unerr"><sub>LinkedIn</sub></a> · <sub>Fully local. No account. No cloud. Free.</sub>
445
412
  </p>