claude-smart 0.1.1 → 0.1.2
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 +40 -113
- package/bin/claude-smart.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License">
|
|
12
12
|
</a>
|
|
13
13
|
<a href="pyproject.toml">
|
|
14
|
-
<img src="https://img.shields.io/badge/version-0.1.
|
|
14
|
+
<img src="https://img.shields.io/badge/version-0.1.2-green.svg" alt="Version">
|
|
15
15
|
</a>
|
|
16
16
|
<a href="pyproject.toml">
|
|
17
17
|
<img src="https://img.shields.io/badge/python-%3E%3D3.12-brightgreen.svg" alt="Python">
|
|
@@ -56,37 +56,15 @@ The result is a compact, always-up-to-date set of instructions Claude reads at t
|
|
|
56
56
|
## Quick Start
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
|
-
# 1.
|
|
60
|
-
|
|
61
|
-
cd claude-smart
|
|
59
|
+
# 1. Install the plugin into Claude Code (pick whichever is handier)
|
|
60
|
+
npx claude-smart install # or: uvx claude-smart install
|
|
62
61
|
|
|
63
|
-
# 2.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
# 3. Turn on the local providers inside reflexio — no API key required at all
|
|
67
|
-
mkdir -p ~/.reflexio
|
|
68
|
-
grep -q '^CLAUDE_SMART_USE_LOCAL_CLI=' ~/.reflexio/.env 2>/dev/null \
|
|
69
|
-
|| echo 'CLAUDE_SMART_USE_LOCAL_CLI=1' >> ~/.reflexio/.env
|
|
70
|
-
grep -q '^CLAUDE_SMART_USE_LOCAL_EMBEDDING=' ~/.reflexio/.env 2>/dev/null \
|
|
71
|
-
|| echo 'CLAUDE_SMART_USE_LOCAL_EMBEDDING=1' >> ~/.reflexio/.env
|
|
72
|
-
|
|
73
|
-
# 4. Start the local reflexio backend (storage + search + extraction orchestrator)
|
|
62
|
+
# 2. Start the reflexio backend (leave running in a separate terminal)
|
|
63
|
+
cd ~/.claude/plugins/marketplaces/reflexioai
|
|
74
64
|
uv run reflexio services start --only backend --no-reload
|
|
75
|
-
|
|
76
|
-
# 5. Install the plugin into Claude Code (project-level)
|
|
77
|
-
mkdir -p .claude && cat > .claude/settings.local.json <<'JSON'
|
|
78
|
-
{
|
|
79
|
-
"extraKnownMarketplaces": {
|
|
80
|
-
"claude-smart-local": {
|
|
81
|
-
"source": { "source": "directory", "path": "." }
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
"enabledPlugins": { "claude-smart@claude-smart-local": true }
|
|
85
|
-
}
|
|
86
|
-
JSON
|
|
87
65
|
```
|
|
88
66
|
|
|
89
|
-
Restart Claude Code
|
|
67
|
+
Restart Claude Code. The first time you correct it on something project-specific (*"no, don't use pytest-asyncio — use anyio with trio"*), a playbook rule is extracted. Every subsequent session in the project starts with that rule injected — automatically, without you asking.
|
|
90
68
|
|
|
91
69
|
---
|
|
92
70
|
|
|
@@ -151,79 +129,43 @@ Cross-session playbook retrieval uses `search_user_playbooks(agent_version=proje
|
|
|
151
129
|
|
|
152
130
|
## Installation
|
|
153
131
|
|
|
154
|
-
### One-command install
|
|
155
|
-
|
|
156
|
-
If you just want the plugin wired into Claude Code (marketplace added, plugin installed, `~/.reflexio/.env` seeded with the local-provider flags), run **one** of:
|
|
157
|
-
|
|
158
|
-
```bash
|
|
159
|
-
# uvx — pulls the Python package straight from git, no clone required
|
|
160
|
-
uvx --from git+https://github.com/ReflexioAI/claude-smart claude-smart install
|
|
161
|
-
|
|
162
|
-
# npx — same thing via the published npm wrapper
|
|
163
|
-
npx claude-smart install
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
Both do the same three things:
|
|
167
|
-
|
|
168
|
-
1. `claude plugin marketplace add ReflexioAI/claude-smart`
|
|
169
|
-
2. `claude plugin install claude-smart@yilu`
|
|
170
|
-
3. Append `CLAUDE_SMART_USE_LOCAL_CLI=1` and `CLAUDE_SMART_USE_LOCAL_EMBEDDING=1` to `~/.reflexio/.env` (idempotent).
|
|
171
|
-
|
|
172
|
-
You still need to start the reflexio backend yourself the first time (`uv run reflexio services start --only backend --no-reload` from a clone of this repo). Everything else — submodule init, `uv sync` — runs inside Claude Code's `Setup` hook on first session.
|
|
173
|
-
|
|
174
|
-
For a manual, step-by-step walkthrough, see below.
|
|
175
|
-
|
|
176
132
|
### Prerequisites
|
|
177
133
|
|
|
178
134
|
| Tool | Purpose |
|
|
179
135
|
| --- | --- |
|
|
180
|
-
| [Claude Code](https://claude.com/claude-code) |
|
|
181
|
-
| [uv](https://docs.astral.sh/uv/) | Python package manager
|
|
182
|
-
| `git` |
|
|
136
|
+
| [Claude Code](https://claude.com/claude-code) | Host CLI — also the LLM backend for extraction |
|
|
137
|
+
| [uv](https://docs.astral.sh/uv/) | Python 3.12+ package manager — runs the reflexio backend |
|
|
138
|
+
| `git` | The install flow clones the plugin into Claude Code's plugin cache |
|
|
183
139
|
|
|
184
|
-
> **No external API keys needed.** Generation runs through your local `claude` CLI (via a LiteLLM custom provider). Embeddings run through an in-process ONNX model (`all-MiniLM-L6-v2`, bundled by `chromadb`). Both are
|
|
140
|
+
> **No external API keys needed.** Generation runs through your local `claude` CLI (via a LiteLLM custom provider). Embeddings run through an in-process ONNX model (`all-MiniLM-L6-v2`, bundled by `chromadb`). Both are turned on by default after install; reflexio refuses to fall back to paid APIs.
|
|
185
141
|
|
|
186
|
-
### Step 1 —
|
|
142
|
+
### Step 1 — Install the plugin
|
|
187
143
|
|
|
188
|
-
|
|
189
|
-
git clone --recurse-submodules https://github.com/ReflexioAI/claude-smart.git
|
|
190
|
-
cd claude-smart
|
|
191
|
-
|
|
192
|
-
# If you forgot --recurse-submodules
|
|
193
|
-
git submodule update --init --recursive
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### Step 2 — Install Python dependencies
|
|
144
|
+
Pick whichever is handier — both published packages do the exact same thing:
|
|
197
145
|
|
|
198
146
|
```bash
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
This creates `.venv/`, pulls `reflexio-ai` as a path dependency from the `reflexio/` submodule, and registers the `claude-smart` and `claude-smart-hook` console scripts.
|
|
203
|
-
|
|
204
|
-
### Step 3 — Enable the local providers in reflexio
|
|
205
|
-
|
|
206
|
-
Two env flags turn on the local generation backend (Claude Code CLI) and the local embedder (in-process ONNX). Both live in `~/.reflexio/.env`:
|
|
147
|
+
# npm wrapper
|
|
148
|
+
npx claude-smart install
|
|
207
149
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
grep -q '^CLAUDE_SMART_USE_LOCAL_CLI=' ~/.reflexio/.env 2>/dev/null \
|
|
211
|
-
|| echo 'CLAUDE_SMART_USE_LOCAL_CLI=1' >> ~/.reflexio/.env
|
|
212
|
-
grep -q '^CLAUDE_SMART_USE_LOCAL_EMBEDDING=' ~/.reflexio/.env 2>/dev/null \
|
|
213
|
-
|| echo 'CLAUDE_SMART_USE_LOCAL_EMBEDDING=1' >> ~/.reflexio/.env
|
|
150
|
+
# Python wrapper
|
|
151
|
+
uvx claude-smart install
|
|
214
152
|
```
|
|
215
153
|
|
|
216
|
-
|
|
154
|
+
Either command:
|
|
217
155
|
|
|
218
|
-
|
|
156
|
+
1. Registers `ReflexioAI/claude-smart` as a Claude Code marketplace, clones it to `~/.claude/plugins/marketplaces/reflexioai/`, and enables the plugin.
|
|
157
|
+
2. Appends `CLAUDE_SMART_USE_LOCAL_CLI=1` and `CLAUDE_SMART_USE_LOCAL_EMBEDDING=1` to `~/.reflexio/.env` (idempotent — safe to re-run).
|
|
219
158
|
|
|
220
|
-
|
|
159
|
+
On the first Claude Code session, the plugin's `Setup` hook runs `plugin/scripts/smart-install.sh` once — that initializes the reflexio submodule and runs `uv sync` inside the plugin directory. You don't have to do this manually.
|
|
160
|
+
|
|
161
|
+
### Step 2 — Start the reflexio backend
|
|
221
162
|
|
|
222
163
|
```bash
|
|
164
|
+
cd ~/.claude/plugins/marketplaces/reflexioai
|
|
223
165
|
uv run reflexio services start --only backend --no-reload
|
|
224
166
|
```
|
|
225
167
|
|
|
226
|
-
|
|
168
|
+
Expected log lines:
|
|
227
169
|
|
|
228
170
|
```
|
|
229
171
|
Registered claude-code LiteLLM provider (cli=/path/to/claude)
|
|
@@ -241,51 +183,36 @@ curl http://localhost:8081/health
|
|
|
241
183
|
# {"status":"healthy"}
|
|
242
184
|
```
|
|
243
185
|
|
|
244
|
-
Leave this running in a separate terminal. Stop it
|
|
186
|
+
Leave this running in a separate terminal. Stop it with:
|
|
245
187
|
|
|
246
188
|
```bash
|
|
247
189
|
uv run reflexio services stop
|
|
248
190
|
```
|
|
249
191
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
**Project-level (recommended while you evaluate):**
|
|
253
|
-
|
|
254
|
-
```bash
|
|
255
|
-
mkdir -p .claude
|
|
256
|
-
cat > .claude/settings.local.json <<JSON
|
|
257
|
-
{
|
|
258
|
-
"extraKnownMarketplaces": {
|
|
259
|
-
"claude-smart-local": {
|
|
260
|
-
"source": { "source": "directory", "path": "$PWD" }
|
|
261
|
-
}
|
|
262
|
-
},
|
|
263
|
-
"enabledPlugins": { "claude-smart@claude-smart-local": true }
|
|
264
|
-
}
|
|
265
|
-
JSON
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
**User-level (all projects):**
|
|
269
|
-
|
|
270
|
-
Put the same JSON into `~/.claude/settings.json`, using an absolute path for the marketplace `path`.
|
|
192
|
+
On first use the embedder downloads the ~80 MB ONNX model once and caches it at `~/.cache/chroma/onnx_models/`. Subsequent starts reuse the cache and stay offline.
|
|
271
193
|
|
|
272
|
-
|
|
194
|
+
### Step 3 — Sanity check
|
|
273
195
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
Inside Claude Code:
|
|
196
|
+
Restart Claude Code. In any session:
|
|
277
197
|
|
|
278
198
|
```
|
|
279
199
|
/show
|
|
280
200
|
```
|
|
281
201
|
|
|
282
|
-
On a fresh project
|
|
202
|
+
On a fresh project: `_No playbook or profiles yet for project `<name>`._` — expected. Have a conversation, include at least one genuine correction (`"no, don't use X — use Y"`), then run `/learn` to force extraction. After ~20–30 seconds, `/show` will surface the new rule.
|
|
283
203
|
|
|
204
|
+
### Uninstall
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
claude plugin uninstall claude-smart@reflexioai
|
|
208
|
+
|
|
209
|
+
# Optional — wipe learned data and per-session buffers
|
|
210
|
+
rm -rf ~/.reflexio/data/ ~/.claude-smart/sessions/
|
|
284
211
|
```
|
|
285
|
-
/learn
|
|
286
|
-
```
|
|
287
212
|
|
|
288
|
-
|
|
213
|
+
### Developing claude-smart itself
|
|
214
|
+
|
|
215
|
+
If you want to iterate on the plugin code (hooks, Python package, reflexio patch, install CLIs), don't install from npm/PyPI — clone the repo and point Claude Code at your working copy. See [DEVELOPER.md](./DEVELOPER.md#developing-locally) for the step-by-step.
|
|
289
216
|
|
|
290
217
|
---
|
|
291
218
|
|
|
@@ -379,7 +306,7 @@ project playbooks, and tweak the claude-smart environment. It connects to the
|
|
|
379
306
|
same reflexio backend the plugin uses, so run that first.
|
|
380
307
|
|
|
381
308
|
```bash
|
|
382
|
-
# 1. reflexio backend on :8081 (see Step
|
|
309
|
+
# 1. reflexio backend on :8081 (see Step 2 above)
|
|
383
310
|
uv run reflexio services start --only backend --no-reload
|
|
384
311
|
|
|
385
312
|
# 2. install and run the dashboard
|
package/bin/claude-smart.js
CHANGED
|
@@ -15,7 +15,7 @@ const { homedir } = require("os");
|
|
|
15
15
|
const { dirname, join } = require("path");
|
|
16
16
|
|
|
17
17
|
const DEFAULT_MARKETPLACE_SOURCE = "ReflexioAI/claude-smart";
|
|
18
|
-
const PLUGIN_SPEC = "claude-smart@
|
|
18
|
+
const PLUGIN_SPEC = "claude-smart@reflexioai";
|
|
19
19
|
const REFLEXIO_ENV_PATH = join(homedir(), ".reflexio", ".env");
|
|
20
20
|
|
|
21
21
|
function hasClaudeCli() {
|