claude-smart 0.2.20 → 0.2.22

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.
Files changed (2) hide show
  1. package/README.md +43 -35
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
  <img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License">
14
14
  </a>
15
15
  <a href="plugin/pyproject.toml">
16
- <img src="https://img.shields.io/badge/version-0.2.20-green.svg" alt="Version">
16
+ <img src="https://img.shields.io/badge/version-0.2.22-green.svg" alt="Version">
17
17
  </a>
18
18
  <a href="plugin/pyproject.toml">
19
19
  <img src="https://img.shields.io/badge/python-%3E%3D3.12-brightgreen.svg" alt="Python">
@@ -24,6 +24,9 @@
24
24
  <a href="#quick-start">
25
25
  <img src="https://img.shields.io/badge/llm-claude%20code%20cli-purple.svg" alt="LLM">
26
26
  </a>
27
+ <a href="https://discord.gg/Jbft3jPn">
28
+ <img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord">
29
+ </a>
27
30
  </p>
28
31
 
29
32
  <p align="center">
@@ -37,13 +40,11 @@
37
40
  </p>
38
41
 
39
42
  <p align="center">
40
- It learns both corrections and successful execution patterns—so Claude Code avoids repeating mistakes and reuses what works. Playbook rules travel with you across every project; per-project profiles capture how you like to work on each repo.
43
+ It learns both corrections and successful execution patterns—so Claude Code avoids repeating mistakes and reuses what works. Project-specific skills capture repo-local rules, and shared skills roll up durable patterns for reuse across projects.
41
44
  </p>
42
45
 
43
46
  <p align="center">
44
- <b>Head-to-head vs <code>claude-mem</code>.</b> Evaluated across 12 scripted scenarios.
45
- <br>
46
- <b>~2.7× higher overall quality </b> &nbsp;·&nbsp; Right user correction learnt every time vs none &nbsp;·&nbsp; See <a href="benchmarks/memory_comparison/EXPERIMENT.md">EXPERIMENT.md</a> for details.
47
+ <b>vs <code>claude-mem</code>:</b> ~3× better at turning your corrections into rules Claude follows, ~50% more of what you tell Claude sticks. <a href="EXPERIMENT.md"><b>Read the benchmark →</b></a>
47
48
  </p>
48
49
 
49
50
  ---
@@ -56,11 +57,11 @@ Most memory solutions are still mostly informative—Claude remembers what happe
56
57
 
57
58
  Four ways this changes what Claude Code can do for you:
58
59
 
59
- - 💡 **Stop repeating the same mistakes:** Produces actionable playbooks Claude can follow next time; memory only records what happened.
60
+ - 💡 **Stop repeating the same mistakes:** Produces actionable skills Claude can follow next time; memory only records what happened.
60
61
 
61
- > *Example:* you tell Claude to stop running `npm test` without `--run` because watch mode hangs.<br>
62
- > **Memory:** “user was annoyed about npm test hanging”<br>
63
- > **Learning:** “always pass `--run` to `npm test` in this repo default watch mode blocks CI
62
+ > *Example:* a deploy fails after Claude bumps `prisma` from 5.x to 6.0; you tell it to roll back because 6.0 breaks nested writes in your order flow.<br>
63
+ > **Memory:** “deploy broke after prisma bump; user rolled back”<br>
64
+ > **Learning:** “treat major-version bumps of ORMs/DB drivers as breakingverify with integration tests, not just unit tests
64
65
 
65
66
  - 🚀 **Start from the optimized path:** Preserves and optimizes execution paths so Claude can reuse what already works.
66
67
  > *Example:* Claude spends several iterations trying to start the local dev environment before discovering that this repo requires `pnpm dev:all` instead of the usual `npm run dev`.<br>
@@ -69,23 +70,28 @@ Four ways this changes what Claude Code can do for you:
69
70
 
70
71
  Instead of re-exploring, Claude starts from the proven path—reducing planning steps, latency, and token usage.
71
72
 
72
- - 🌐 **Global playbook, project-scoped profiles:** Session memory disappears with the conversation. The playbook persists *globally* rules learned in one repo are available in every repo you work in — while user profiles stay scoped to the current project so per-repo preferences don't leak across projects.
73
+ - 🌐 **Project-specific and shared skills:** Session memory disappears with the conversation. Project-specific skills preserve repo-local rules, while shared skills roll up patterns that should transfer across projects. Preferences stay scoped to the current project so per-repo preferences don't leak across projects.
73
74
 
74
- - 🪶 **Better context without prompt bloat:** Distilled, deduplicated playbooks stay in dozens of tokens—not thousands—even as the project grows.
75
+ - 🪶 **Better context without prompt bloat:** Distilled, deduplicated skills stay in dozens of tokens—not thousands—even as the project grows.
75
76
 
76
77
  ---
77
78
 
78
79
  ## Quick Start
79
80
 
80
81
  ```bash
81
- npx claude-smart install # or: uvx claude-smart install
82
+ claude plugin marketplace add ReflexioAI/claude-smart
83
+ claude plugin install claude-smart@reflexioai
82
84
  ```
83
85
 
84
- Or run the equivalent marketplace commands directly via the Claude Code CLI:
86
+ The plugin Setup hook installs its own `uv`, Python 3.12 environment, and
87
+ private Node.js/npm runtime under `~/.claude-smart/` when they are missing, so
88
+ you do not need to install Python or Node globally for the plugin/dashboard.
89
+
90
+ If you already have Node.js or uv, these convenience wrappers are equivalent
91
+ but require their own runtime to already exist:
85
92
 
86
93
  ```bash
87
- claude plugin marketplace add ReflexioAI/claude-smart
88
- claude plugin install claude-smart@reflexioai
94
+ npx claude-smart install # or: uvx claude-smart install
89
95
  ```
90
96
 
91
97
  Then restart Claude Code.
@@ -93,13 +99,13 @@ Then restart Claude Code.
93
99
  To uninstall:
94
100
 
95
101
  ```bash
96
- npx claude-smart uninstall # or: uvx claude-smart uninstall
102
+ claude plugin uninstall claude-smart@reflexioai
97
103
  ```
98
104
 
99
- Or run the equivalent command directly via the Claude Code CLI:
105
+ Or, if you already have Node.js or uv:
100
106
 
101
107
  ```bash
102
- claude plugin uninstall claude-smart@reflexioai
108
+ npx claude-smart uninstall # or: uvx claude-smart uninstall
103
109
  ```
104
110
 
105
111
  Local data under `~/.reflexio/` and `~/.claude-smart/` is left in place — remove manually if desired.
@@ -113,10 +119,10 @@ Developing the plugin itself? See [DEVELOPER.md](./DEVELOPER.md#developing-local
113
119
 
114
120
  - 🧠 **Learn, don't just remember** — Corrections become structured, deduplicated rules, not transcript replays.
115
121
  - ⚡ **Fully automatic learning** — Every user turn, tool call, and assistant response is captured via lifecycle hooks and extracted into rules without you running anything.
116
- - 📈 **Updates with every session** — Playbooks auto-merge, supersede, and archive as your project evolves the playbook sharpens with use instead of bloating.
117
- > *e.g.* you correct the same `npm test --run` gotcha twice → **claude-smart** consolidates them into one stronger rule. Later you switch the policy to `pnpm test` → the old rule is archived and the new one supersedes it, no manual cleanup.
118
- - 🔌 **No external API call** — semantic search runs on an in-process ONNX embedder (all-MiniLM-L6-v2), and all data (profiles, playbooks, interaction buffers) is stored locally on your machine (`~/.reflexio/` and `~/.claude-smart/`).
119
- - 🔎 **Hybrid search** — Playbooks and profiles are indexed with vector + BM25 search for fast, robust retrieval.
122
+ - 📈 **Continuously self-tuning, not just append-on-conflict** — Existing rules are continuously refined, not just appended to. Wording gets clearer, *when-to-apply* triggers tighten or broaden as evidence accumulates, near-duplicates merge, stale rules are superseded, and dead ones are archived. The library gets sharper, not just bigger.
123
+ > *e.g.* correct the same `npm test --run` gotcha twice → consolidated into one rule. New evidence shows it applies to `vitest` too → scope broadened. Switch policy to `pnpm test` → old rule archived, new one supersedes it.
124
+ - 🔌 **No external API call** — semantic search runs on an in-process ONNX embedder (all-MiniLM-L6-v2), and all data (preferences, skills, interaction buffers) is stored locally on your machine (`~/.reflexio/` and `~/.claude-smart/`).
125
+ - 🔎 **Hybrid search** — Skills and preferences are indexed with vector + BM25 search for fast, robust retrieval.
120
126
  - 🧪 **Offline resilience** — If the reflexio backend is down, hooks buffer to disk; the next successful publish drains them.
121
127
  - 🧰 **Manual correction marker** — `/claude-smart:learn` flags the last turn as a correction so the extractor weights it heavily.
122
128
 
@@ -124,36 +130,37 @@ Developing the plugin itself? See [DEVELOPER.md](./DEVELOPER.md#developing-local
124
130
 
125
131
  ## Dashboard
126
132
 
127
- A web UI for browsing session histories, inspecting user profiles, and editing playbook rules. The dashboard auto-starts alongside the backend, so you can open **http://localhost:3001** directly. Or run `/claude-smart:dashboard` in Claude Code to launch dashboard in browser.
133
+ A web UI for browsing session histories, inspecting preferences, and editing project-specific and shared skills. The dashboard auto-starts alongside the backend, so you can open **http://localhost:3001** directly. Or run `/claude-smart:dashboard` in Claude Code to launch dashboard in browser.
128
134
 
129
135
  <p align="center">
130
- <img src="assets/profile_dashboard.png" alt="Profile dashboard" width="49%">
131
- <img src="assets/playbook_dashboard.png" alt="Playbook dashboard" width="49%">
136
+ <img src="assets/preferences_dashboard.png" alt="Preferences dashboard" width="49%">
137
+ <img src="assets/skills_dashboard.png" alt="Skills dashboard" width="49%">
132
138
  </p>
133
139
 
134
140
  ---
135
141
 
136
142
  ## How It Works
137
143
 
138
- claude-smart builds two artifacts as you work and injects them into Claude at the start of every new session:
144
+ claude-smart builds three artifacts as you work and injects the relevant ones into Claude:
139
145
 
140
- - **User profile** (project-scoped) — preferences about how you work in this specific repo (stack, role, small quirks). *e.g.* "uses pnpm, not npm"; "prefers terse answers"; "backend engineer — explain frontend with backend analogues."
141
- - **Playbook** (global, cross-project) — durable, generalized rules accumulated across every session, shared across every project you use claude-smart in. Each rule says when it applies and why, so a rule learned in one repo only fires in the contexts where it's relevant. *e.g.* "always pass `--run` to `npm test` — watch mode hangs CI"; "use real Postgres for integration tests — mocks once hid a broken migration."
146
+ - **Preferences** (project-scoped) — how you work in this specific repo (stack, role, small quirks). *e.g.* "uses pnpm, not npm"; "prefers terse answers"; "backend engineer — explain frontend with backend analogues."
147
+ - **Project-specific skills** — durable rules with triggers and rationales learned from corrections in a project. *e.g.* "always pass `--run` to `npm test` — watch mode hangs CI."
148
+ - **Shared skills** — optimized rollups of project-specific skills that should transfer across projects. *e.g.* "use real Postgres for integration tests — mocks once hid a broken migration."
142
149
 
143
- Playbooks clean themselves up: correct the same thing twice and they merge; change your mind and the old one is archived.
150
+ Skills clean themselves up: correct the same thing twice and they merge; change your mind and the old one is archived.
144
151
 
145
- Under the hood: hooks watch your turns, tool calls, and Claude's replies, auto-flagging corrections (or anything you flag with `/learn`). At session end (or on `/learn`), [reflexio](https://github.com/ReflexioAI/reflexio) — the self-improving engine that powers claude-smart — extracts profile entries and playbook rules. Next session, both get injected into the system prompt — run `/show` to see what Claude is being told. Everything runs on your machine.
152
+ Under the hood: hooks watch your turns, tool calls, and Claude's replies, auto-flagging corrections (or anything you flag with `/learn`). At session end (or on `/learn`), [reflexio](https://github.com/ReflexioAI/reflexio) — the self-improving engine that powers claude-smart — extracts preferences and project-specific skills, then rolls durable patterns into shared skills. Next session, the relevant context gets injected into the system prompt — run `/show` to see what Claude is being told. Everything runs on your machine.
146
153
 
147
154
  **Citations (`cs-cite`).** At the end of a reply, Claude may run:
148
155
 
149
156
  ```
150
- ⏺ Bash(cs-cite r1-252,p1-5aed)
157
+ ⏺ Bash(cs-cite s1-252,p1-5aed)
151
158
  ⎿ (No output)
152
159
 
153
160
  ⏺ ✨ 2 claude-smart learnings applied
154
161
  ```
155
162
 
156
- That signals a profile entry (`p…`) or playbook rule (`r…`) materially shaped the reply. Open the interaction's detail page in the [dashboard](#dashboard) to see the exact cited item.
163
+ That signals a preference (`p…`) or skill (`s…`) materially shaped the reply. Open the interaction's detail page in the [dashboard](#dashboard) to see the exact cited item.
157
164
 
158
165
  See [ARCHITECTURE.md](./ARCHITECTURE.md) for hooks, data flow, and reflexio details.
159
166
 
@@ -164,10 +171,10 @@ See [ARCHITECTURE.md](./ARCHITECTURE.md) for hooks, data flow, and reflexio deta
164
171
  | Command | What it does |
165
172
  | --- | --- |
166
173
  | `/dashboard` | Open the dashboard in your browser, auto-starting the reflexio backend and dashboard services if they aren't already running. |
167
- | `/show` | Print the current (global) playbook plus the current project's user profiles (same markdown that `SessionStart` injects). Use it to audit what playbooks and preferences Claude is being told to follow. |
174
+ | `/show` | Print current project-specific skills plus the current project's preferences (same markdown that `SessionStart` injects). Use it to audit what skills and preferences Claude is being told to follow. |
168
175
  | `/learn [note]` | Flag the most recent turn as a correction (for cases the automatic heuristic missed) and force reflexio to run extraction *now* on the session's unpublished interactions. The optional note becomes the correction description the extractor sees. |
169
176
  | `/restart` | Restart the reflexio backend and dashboard to pick up new changes (e.g. after upgrading the plugin or editing local reflexio code). |
170
- | `/clear-all` | **Destructive.** Delete *all* reflexio interactions, profiles, and user playbooks. Use when you want to wipe learned state and start fresh. |
177
+ | `/clear-all` | **Destructive.** Delete *all* reflexio interactions, preferences, and skills. Use when you want to wipe learned state and start fresh. |
171
178
 
172
179
  ---
173
180
 
@@ -179,8 +186,9 @@ Advanced users can tune claude-smart via environment variables — see [DEVELOPE
179
186
 
180
187
  | Path | What |
181
188
  | --- | --- |
182
- | `~/.reflexio/data/reflexio.db` | Source of truth profiles, user_playbooks, interactions, FTS5 indexes, and vec0 embedding tables (plus `.db-shm` / `.db-wal` WAL sidecars). Inspect with `sqlite3`. |
189
+ | `~/.reflexio/data/reflexio.db` | Source of truth for learned preferences, skills, interactions, full-text indexes, and embedding tables (plus `.db-shm` / `.db-wal` WAL sidecars). Inspect with `sqlite3`. |
183
190
  | `~/.reflexio/.env` | Provider config — `CLAUDE_SMART_USE_LOCAL_CLI`, `CLAUDE_SMART_USE_LOCAL_EMBEDDING`, any optional API keys. |
191
+ | `.claude/settings.local.json` or `~/.claude/settings.json` | Claude Code hook environment, such as `CLAUDE_SMART_ENABLE_OPTIMIZER`; use project-local settings for one repo or user settings for all projects. |
184
192
  | `~/.reflexio/plugin-root` | Self-healed symlink to the active plugin dir (managed by `ensure-plugin-root.sh` — written on install, refreshed each `SessionStart`). Slash commands resolve through it, so don't delete it; if you do, the next session will recreate it. |
185
193
  | `~/.claude-smart/sessions/{session_id}.jsonl` | Per-session buffer. User turns, assistant turns, tool invocations, `{"published_up_to": N}` watermarks. Safe to inspect and safe to delete — everything past the latest watermark has already been written to reflexio's DB. |
186
194
  | `~/.cache/chroma/onnx_models/all-MiniLM-L6-v2/` | Cached ONNX weights (~86 MB, downloaded once). Delete to force a re-download. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-smart",
3
- "version": "0.2.20",
3
+ "version": "0.2.22",
4
4
  "description": "Self-improving Claude Code plugin — learns from corrections via reflexio",
5
5
  "keywords": [
6
6
  "claude",