claude-smart 0.1.5 → 0.1.7
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 +27 -44
- package/bin/claude-smart.js +37 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
claude-smart
|
|
7
7
|
</h1>
|
|
8
8
|
|
|
9
|
-
<h4 align="center">The <a href="https://claude.com/claude-code" target="_blank">Claude Code</a> plugin that makes Claude Code self-improve as you use it — not by remembering past sessions, but by turning your corrections into
|
|
9
|
+
<h4 align="center">The <a href="https://claude.com/claude-code" target="_blank">Claude Code</a> plugin that makes Claude Code self-improve as you use it — not by remembering past sessions, but by turning your corrections into playbooks it actually follows next time.</h4>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
<a href="LICENSE">
|
|
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.1.
|
|
16
|
+
<img src="https://img.shields.io/badge/version-0.1.7-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">
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<a href="#slash-commands">Slash Commands</a> •
|
|
33
33
|
<a href="#dashboard">Dashboard</a> •
|
|
34
34
|
<a href="#configuration">Configuration</a> •
|
|
35
|
-
<a href="
|
|
35
|
+
<a href="TROUBLESHOOTING.md">Troubleshooting</a> •
|
|
36
36
|
<a href="#license">License</a>
|
|
37
37
|
</p>
|
|
38
38
|
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
|
|
48
48
|
## Why Learning, Not Memory
|
|
49
49
|
|
|
50
|
-
Most memory solutions
|
|
50
|
+
Most memory solutions are still mostly informative—Claude remembers what happened, without necessarily changing what it does next.
|
|
51
51
|
|
|
52
52
|
`claude-smart` focuses on learning instead.
|
|
53
53
|
|
|
54
54
|
Four ways this changes what Claude Code can do for you:
|
|
55
55
|
|
|
56
|
-
- **Actionable, not just informative:** Produces
|
|
56
|
+
- **Actionable, not just informative:** Produces playbooks Claude can follow next time; memory only records what happened.
|
|
57
57
|
|
|
58
58
|
> *Example:* you tell Claude to stop running `npm test` without `--run` because watch mode hangs.
|
|
59
59
|
> **Memory:** “user was annoyed about npm test hanging”
|
|
@@ -68,7 +68,7 @@ Four ways this changes what Claude Code can do for you:
|
|
|
68
68
|
|
|
69
69
|
- **Project-wide, not session-siloed:** Session memory disappears with the conversation. The project playbook persists and improves across every session in that repo.
|
|
70
70
|
|
|
71
|
-
- **Compact:** Distilled, deduplicated
|
|
71
|
+
- **Compact:** Distilled, deduplicated playbooks stay in dozens of tokens—not thousands—even as the project grows.
|
|
72
72
|
|
|
73
73
|
claude-smart turns corrections and successful execution patterns into two artifacts:
|
|
74
74
|
|
|
@@ -85,16 +85,28 @@ Both are automatically reinjected at the start of every session, so Claude Code
|
|
|
85
85
|
npx claude-smart install # or: uvx claude-smart install
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
Or run the equivalent marketplace commands directly
|
|
88
|
+
Or run the equivalent marketplace commands directly via the Claude Code CLI:
|
|
89
89
|
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
```bash
|
|
91
|
+
claude plugin marketplace add ReflexioAI/claude-smart
|
|
92
|
+
claude plugin install claude-smart@reflexioai
|
|
93
93
|
```
|
|
94
94
|
|
|
95
95
|
Then restart Claude Code.
|
|
96
96
|
|
|
97
|
-
To uninstall:
|
|
97
|
+
To uninstall:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
npx claude-smart uninstall # or: uvx claude-smart uninstall
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Or run the equivalent command directly via the Claude Code CLI:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
claude plugin uninstall claude-smart@reflexioai
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Local data under `~/.reflexio/` and `~/.claude-smart/` is left in place — remove manually if desired.
|
|
98
110
|
|
|
99
111
|
Developing the plugin itself? See [DEVELOPER.md](./DEVELOPER.md#developing-locally).
|
|
100
112
|
|
|
@@ -104,7 +116,7 @@ Developing the plugin itself? See [DEVELOPER.md](./DEVELOPER.md#developing-local
|
|
|
104
116
|
|
|
105
117
|
- 🧠 **Learn, don't just remember** — Corrections become structured, deduplicated rules, not transcript replays.
|
|
106
118
|
- ⚡ **Fully automatic learning** — Every user turn, tool call, and assistant response is captured via lifecycle hooks and extracted into rules without you running anything.
|
|
107
|
-
- 📈 **
|
|
119
|
+
- 📈 **Updates with every session** — Playbooks auto-merge, supersede, and archive as your project evolves — the playbook sharpens with use instead of bloating.
|
|
108
120
|
> *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.
|
|
109
121
|
- 🎯 **Two-tier scope** — Per-session profiles for the current conversation; cross-session playbooks for the whole project.
|
|
110
122
|
- 🔌 **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/`).
|
|
@@ -132,7 +144,7 @@ claude-smart builds two artifacts as you work and injects them into Claude at th
|
|
|
132
144
|
- **User profile** — session-scoped preferences (stack, role, small quirks). *e.g.* "uses pnpm, not npm"; "prefers terse answers"; "backend engineer — explain frontend with backend analogues."
|
|
133
145
|
- **Project playbook** — durable, generalized rules accumulated across every session in the repo. Each says when it applies and why. *e.g.* "always pass `--run` to `npm test` — watch mode hangs CI"; "use real Postgres for integration tests — mocks once hid a broken migration."
|
|
134
146
|
|
|
135
|
-
|
|
147
|
+
Playbooks clean themselves up: correct the same thing twice and they merge; change your mind and the old one is archived.
|
|
136
148
|
|
|
137
149
|
Under the hood: hooks watch your turns, tool calls, and Claude's replies, auto-flagging corrections (or anything you `/tag`). 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.
|
|
138
150
|
|
|
@@ -144,7 +156,7 @@ See [ARCHITECTURE.md](./ARCHITECTURE.md) for hooks, data flow, and reflexio deta
|
|
|
144
156
|
|
|
145
157
|
| Command | What it does |
|
|
146
158
|
| --- | --- |
|
|
147
|
-
| `/show` | Print the current project playbook plus the current session's user profiles (same markdown that `SessionStart` injects). Use it to audit what
|
|
159
|
+
| `/show` | Print the current project playbook plus the current session's user profiles (same markdown that `SessionStart` injects). Use it to audit what playbooks and preferences Claude is being told to follow. |
|
|
148
160
|
| `/learn` | Force reflexio to run extraction *now* on the current session's unpublished interactions. Without this, extraction runs at the end of the session or on reflexio's batch interval. |
|
|
149
161
|
| `/tag [note]` | Tag the most recent turn as a correction, for cases the automatic heuristic missed. The note becomes the correction description the extractor sees. |
|
|
150
162
|
| `/restart` | Restart the reflexio backend and dashboard to pick up new changes (e.g. after upgrading the plugin or editing local reflexio code). |
|
|
@@ -165,36 +177,7 @@ Advanced users can tune claude-smart via environment variables — see [DEVELOPE
|
|
|
165
177
|
| `~/.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. |
|
|
166
178
|
| `~/.cache/chroma/onnx_models/all-MiniLM-L6-v2/` | Cached ONNX weights (~86 MB, downloaded once). Delete to force a re-download. |
|
|
167
179
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
claude-smart uses an in-process ONNX embedder (Chroma's `all-MiniLM-L6-v2`, 384-dim, zero-padded to reflexio's 512-dim schema). The model weights are downloaded on first use (~80 MB, cached under `~/.cache/chroma/onnx_models/`) — after that, no network calls for embedding. Runtime cost is a few milliseconds per short document on CPU.
|
|
171
|
-
|
|
172
|
-
If you still want to use a cloud embedding provider (OpenAI, Gemini, etc.), omit `CLAUDE_SMART_USE_LOCAL_EMBEDDING` and set the corresponding API key in `~/.reflexio/.env` — reflexio will fall back to its standard provider-priority chain.
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
## Troubleshooting
|
|
177
|
-
|
|
178
|
-
**SessionStart injects nothing after a correction.**
|
|
179
|
-
Extraction is async by default. Run `/learn` to force it, wait ~20–30s, then run `/show` — no new session needed. `/show` shows whether the rule was actually extracted.
|
|
180
|
-
|
|
181
|
-
**Reflexio refuses to boot with "no embedding-capable provider".**
|
|
182
|
-
Check that `CLAUDE_SMART_USE_LOCAL_EMBEDDING=1` is in `~/.reflexio/.env` *and* that `chromadb` is installed in the venv (`uv run --project plugin python -c "import chromadb"` should print nothing). If you'd rather use a cloud embedder instead, drop the env flag and set `OPENAI_API_KEY` or `GEMINI_API_KEY` in the same file.
|
|
183
|
-
|
|
184
|
-
**`claude-smart` doesn't see my interactions.**
|
|
185
|
-
Check `~/.claude-smart/sessions/`. If your current session's JSONL has no `User`/`Assistant` rows, the plugin isn't receiving hook events — verify `.claude/settings.local.json` has the right path and that `enabledPlugins` is `true`.
|
|
186
|
-
|
|
187
|
-
**Hooks appear to time out.**
|
|
188
|
-
Each hook is capped at 15–60s. If you see long pauses, check `uv` is on PATH (hooks shell out to `uv run`). Set `CLAUDE_SMART_CLI_TIMEOUT=180` to give the LLM provider more headroom.
|
|
189
|
-
|
|
190
|
-
**A different LLM is being used.**
|
|
191
|
-
Reflexio's provider priority is `claude-code > local > anthropic > gemini > ... > openai`. If you have `CLAUDE_SMART_USE_LOCAL_CLI=1` *and* an Anthropic key set, claude-code still wins for generation; `local` sits above openai/gemini for embeddings. Check the startup log line `Primary provider for generation: <name>` and `Embedding provider: <name>` to confirm.
|
|
192
|
-
|
|
193
|
-
**I want to wipe everything and start over.**
|
|
194
|
-
```bash
|
|
195
|
-
rm -rf ~/.claude-smart/sessions/
|
|
196
|
-
rm -rf ~/.reflexio/data/ # reflexio SQLite store
|
|
197
|
-
```
|
|
180
|
+
For troubleshooting, see [TROUBLESHOOTING.md](./TROUBLESHOOTING.md).
|
|
198
181
|
|
|
199
182
|
---
|
|
200
183
|
|
package/bin/claude-smart.js
CHANGED
|
@@ -61,6 +61,9 @@ function printHelp() {
|
|
|
61
61
|
"Update:",
|
|
62
62
|
" npx claude-smart update Update to the latest version",
|
|
63
63
|
"",
|
|
64
|
+
"Uninstall:",
|
|
65
|
+
" npx claude-smart uninstall Remove the plugin from Claude Code",
|
|
66
|
+
"",
|
|
64
67
|
].join("\n"),
|
|
65
68
|
);
|
|
66
69
|
}
|
|
@@ -96,6 +99,35 @@ function runUpdate() {
|
|
|
96
99
|
process.stdout.write("\nclaude-smart updated. Restart Claude Code to apply.\n");
|
|
97
100
|
}
|
|
98
101
|
|
|
102
|
+
function runUninstall() {
|
|
103
|
+
if (!hasClaudeCli()) {
|
|
104
|
+
process.stderr.write(
|
|
105
|
+
"error: 'claude' CLI not found on PATH. " +
|
|
106
|
+
"Install Claude Code first: https://claude.com/claude-code\n",
|
|
107
|
+
);
|
|
108
|
+
process.exit(1);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
try {
|
|
112
|
+
execFileSync("claude", ["plugin", "uninstall", PLUGIN_SPEC], { stdio: "inherit" });
|
|
113
|
+
} catch (err) {
|
|
114
|
+
const code = typeof err.status === "number" ? err.status : 1;
|
|
115
|
+
process.stderr.write(
|
|
116
|
+
`error: \`claude plugin uninstall ${PLUGIN_SPEC}\` failed (exit ${code})\n`,
|
|
117
|
+
);
|
|
118
|
+
process.exit(code);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
process.stdout.write(
|
|
122
|
+
[
|
|
123
|
+
"",
|
|
124
|
+
"claude-smart uninstalled. Restart Claude Code to apply.",
|
|
125
|
+
"Local data in ~/.reflexio/ and ~/.claude-smart/ was left in place — remove manually if desired.",
|
|
126
|
+
"",
|
|
127
|
+
].join("\n"),
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
99
131
|
function runInstall(args) {
|
|
100
132
|
if (!hasClaudeCli()) {
|
|
101
133
|
process.stderr.write(
|
|
@@ -160,6 +192,11 @@ function main() {
|
|
|
160
192
|
return;
|
|
161
193
|
}
|
|
162
194
|
|
|
195
|
+
if (cmd === "uninstall") {
|
|
196
|
+
runUninstall();
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
|
|
163
200
|
process.stderr.write(
|
|
164
201
|
`claude-smart: unknown command '${cmd}'. Try 'npx claude-smart --help'.\n`,
|
|
165
202
|
);
|