claude-smart 0.1.2 → 0.1.4
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 +77 -214
- package/bin/claude-smart.js +3 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/claude-smart-icon.png" alt="claude-smart" width="140">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
1
5
|
<h1 align="center">
|
|
2
|
-
<br>
|
|
3
6
|
claude-smart
|
|
4
|
-
<br>
|
|
5
7
|
</h1>
|
|
6
8
|
|
|
7
|
-
<h4 align="center">
|
|
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 rules it actually follows next time.</h4>
|
|
8
10
|
|
|
9
11
|
<p align="center">
|
|
10
12
|
<a href="LICENSE">
|
|
11
13
|
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg" alt="License">
|
|
12
14
|
</a>
|
|
13
|
-
<a href="pyproject.toml">
|
|
14
|
-
<img src="https://img.shields.io/badge/version-0.1.
|
|
15
|
+
<a href="plugin/pyproject.toml">
|
|
16
|
+
<img src="https://img.shields.io/badge/version-0.1.4-green.svg" alt="Version">
|
|
15
17
|
</a>
|
|
16
|
-
<a href="pyproject.toml">
|
|
18
|
+
<a href="plugin/pyproject.toml">
|
|
17
19
|
<img src="https://img.shields.io/badge/python-%3E%3D3.12-brightgreen.svg" alt="Python">
|
|
18
20
|
</a>
|
|
19
|
-
<a href="#
|
|
21
|
+
<a href="#quick-start">
|
|
20
22
|
<img src="https://img.shields.io/badge/llm-claude%20code%20cli-purple.svg" alt="LLM">
|
|
21
23
|
</a>
|
|
22
24
|
</p>
|
|
@@ -24,205 +26,123 @@
|
|
|
24
26
|
<p align="center">
|
|
25
27
|
<a href="#quick-start">Quick Start</a> •
|
|
26
28
|
<a href="#how-it-works">How It Works</a> •
|
|
27
|
-
<a href="#installation">Installation</a> •
|
|
28
29
|
<a href="#slash-commands">Slash Commands</a> •
|
|
30
|
+
<a href="#dashboard">Dashboard</a> •
|
|
29
31
|
<a href="#configuration">Configuration</a> •
|
|
30
32
|
<a href="#troubleshooting">Troubleshooting</a> •
|
|
31
33
|
<a href="#license">License</a>
|
|
32
34
|
</p>
|
|
33
35
|
|
|
34
36
|
<p align="center">
|
|
35
|
-
claude-smart turns
|
|
37
|
+
Every time you correct Claude Code, claude-smart turns that moment into a durable rule it follows from then on. No more re-explaining your stack, your conventions, or the same gotcha you flagged last week — Claude Code steadily adapts to how <i>your</i> codebase actually wants to be written, session after session.
|
|
38
|
+
</p>
|
|
39
|
+
|
|
40
|
+
<p align="center">
|
|
41
|
+
<b>Head-to-head vs <code>claude-mem</code></b> (LLM-judged on how well each system's reinjected context matches the expected rule): claude-smart is <b>~2.7× more accurate overall</b>, <b>stops Claude from repeating mistakes you've already corrected</b> where claude-mem only recalls that they happened, and is <b>3× better at turning past events into future-facing rules</b> — see <a href="benchmarks/memory_comparison/EXPERIMENT.md">EXPERIMENT.md</a> for details.
|
|
36
42
|
</p>
|
|
37
43
|
|
|
38
44
|
---
|
|
39
45
|
|
|
40
46
|
## Why Learning, Not Memory
|
|
41
47
|
|
|
42
|
-
Plain memory solutions
|
|
48
|
+
Plain memory solutions re-inject transcripts or summaries from prior sessions — useful for continuity, but purely informative. claude-smart extracts *rules* from those sessions instead. Four ways that changes what Claude Code can do for you:
|
|
43
49
|
|
|
44
|
-
- **
|
|
45
|
-
|
|
50
|
+
- **Actionable, not just informative.** Memory logs *what happened*; learning produces *rules to follow* that change the next decision.
|
|
51
|
+
> *e.g.* you told Claude to stop running `npm test` without `--run` because it hangs on watch mode. **Memory** recalls "user was annoyed about npm test hanging". **Learning** writes the rule *"always pass `--run` to `npm test` in this repo — default watch mode blocks CI"* and applies it next session.
|
|
52
|
+
- **Preferences, not events.** Memory records literal facts; learning abstracts the *why* into rules that generalize.
|
|
53
|
+
> *e.g.* you reject Jest in favor of Vitest once. **Memory** stores that single choice. **Learning** derives *"prefer ESM-native test runners for this TypeScript monorepo"* — which also covers the next framework decision (e.g. picking `tsx` over `ts-node`) without waiting for the same correction to repeat.
|
|
54
|
+
- **Carries across sessions and workspaces.** Playbooks are keyed to the project and surface in every future session against that repo.
|
|
55
|
+
- **Compact.** Distilled, deduplicated rules stay in dozens of tokens — not thousands — even as the project grows.
|
|
46
56
|
|
|
47
|
-
claude-smart
|
|
48
|
-
|
|
49
|
-
- **User profile** — short, session-scoped preferences Claude should respect right now.
|
|
50
|
-
- **Project playbook** — cross-session behavioral rules keyed to your project, with an explicit `trigger` (when the rule applies) and `rationale` (why). Rules are deduplicated, updated, and archived as they evolve.
|
|
51
|
-
|
|
52
|
-
The result is a compact, always-up-to-date set of instructions Claude reads at the start of every session — measured in *dozens* of tokens rather than thousands, and actually capable of changing behavior.
|
|
57
|
+
claude-smart's approach: **extract, don't accumulate**. Corrections and successful patterns are distilled into two artifacts — a session-scoped **user profile** and a cross-session **project playbook** (each rule with explicit `trigger` and `rationale`, deduplicated and archived as they evolve) — and reinjected at the start of every session.
|
|
53
58
|
|
|
54
59
|
---
|
|
55
60
|
|
|
56
61
|
## Quick Start
|
|
57
62
|
|
|
58
63
|
```bash
|
|
59
|
-
|
|
60
|
-
|
|
64
|
+
npx claude-smart install # or: uvx claude-smart install
|
|
65
|
+
```
|
|
61
66
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
Or run the equivalent marketplace commands directly inside Claude Code:
|
|
68
|
+
|
|
69
|
+
```text
|
|
70
|
+
/plugin marketplace add ReflexioAI/claude-smart
|
|
71
|
+
/plugin install claude-smart@reflexioai
|
|
65
72
|
```
|
|
66
73
|
|
|
67
|
-
|
|
74
|
+
Then restart Claude Code.
|
|
75
|
+
|
|
76
|
+
To uninstall: `/plugin uninstall claude-smart@reflexioai`.
|
|
77
|
+
|
|
78
|
+
Developing the plugin itself? See [DEVELOPER.md](./DEVELOPER.md#developing-locally).
|
|
68
79
|
|
|
69
80
|
---
|
|
70
81
|
|
|
71
82
|
## Key Features
|
|
72
83
|
|
|
73
84
|
- 🧠 **Learn, don't just remember** — Corrections become structured, deduplicated rules, not transcript replays.
|
|
85
|
+
- ⚡ **Fully automatic learning** — Every user turn, tool call, and assistant response is captured via lifecycle hooks and extracted into rules without you running anything.
|
|
86
|
+
- 📈 **Compounds with every session** — Rules auto-merge, supersede, and archive as your project evolves — the playbook sharpens with use instead of bloating.
|
|
87
|
+
> *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.
|
|
74
88
|
- 🎯 **Two-tier scope** — Per-session profiles for the current conversation; cross-session playbooks for the whole project.
|
|
75
|
-
- 🔌 **
|
|
89
|
+
- 🔌 **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/`).
|
|
76
90
|
- 🔎 **Hybrid search** — Playbooks and profiles are indexed with vector + BM25 search for fast, robust retrieval.
|
|
77
|
-
- 📥 **Automatic hook ingestion** — `SessionStart`, `UserPromptSubmit`, `PostToolUse`, `Stop`, `SessionEnd` all wired up; you don't run anything manually.
|
|
78
|
-
- 🏷️ **Correction-aware** — Corrective phrasings (`"no, don't"`, `"actually"`, `"stop"`, `"wrong"`) are detected and weighted during extraction.
|
|
79
91
|
- 🧪 **Offline resilience** — If the reflexio backend is down, hooks buffer to disk; the next successful publish drains them.
|
|
80
|
-
- 🧰 **
|
|
92
|
+
- 🧰 **Manual correction tag** — `/claude-smart:tag` flags the last turn as a correction so the extractor weights it heavily.
|
|
81
93
|
|
|
82
94
|
---
|
|
83
95
|
|
|
84
|
-
##
|
|
85
|
-
|
|
86
|
-
**Core components:**
|
|
87
|
-
|
|
88
|
-
1. **5 lifecycle hooks** (`plugin/hooks/hooks.json`)
|
|
89
|
-
- `SessionStart` — fetches the project playbook from reflexio and injects it as `additionalContext`.
|
|
90
|
-
- `UserPromptSubmit` — buffers each user turn, heuristically flags corrections.
|
|
91
|
-
- `PostToolUse` — records tool invocations for later extraction.
|
|
92
|
-
- `Stop` — finalizes the assistant turn from the transcript, publishes to reflexio.
|
|
93
|
-
- `SessionEnd` — flushes the remaining buffer with `force_extraction=True`.
|
|
94
|
-
2. **Local state buffer** — JSONL per session at `~/.claude-smart/sessions/{session_id}.jsonl`. Offline-safe.
|
|
95
|
-
3. **Reflexio backend** (submodule at `reflexio/`) — SQLite storage, hybrid search, profile/playbook extraction, dedup, status lifecycle (`CURRENT` → `ARCHIVED`). Runs on `localhost:8081`.
|
|
96
|
-
4. **Claude Code LLM provider** — a LiteLLM custom provider registered inside reflexio. Every generation call (extraction, update, dedup, evaluation) subprocesses `claude -p --output-format json`, so no OpenAI/Anthropic key is needed for the learning loop.
|
|
97
|
-
5. **Three slash commands** — `/show`, `/learn`, `/tag`.
|
|
98
|
-
|
|
99
|
-
**Data flow:**
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
Claude Code session
|
|
103
|
-
├─ UserPromptSubmit ─┐
|
|
104
|
-
├─ PostToolUse ─────┤ → JSONL buffer ─→ Stop ─→ reflexio publish_interaction
|
|
105
|
-
└─ Stop ─────┘ │
|
|
106
|
-
▼
|
|
107
|
-
┌─────────────────────────┐
|
|
108
|
-
│ reflexio extractors │
|
|
109
|
-
│ (run via claude -p) │
|
|
110
|
-
│ → profiles + playbooks │
|
|
111
|
-
└────────────┬────────────┘
|
|
112
|
-
│
|
|
113
|
-
▼
|
|
114
|
-
Next session → SessionStart → search_user_playbooks(agent_version=project_id)
|
|
115
|
-
→ additionalContext injected into Claude's system prompt
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
**Mapping to reflexio:**
|
|
96
|
+
## Slash Commands
|
|
119
97
|
|
|
120
|
-
|
|
|
98
|
+
| Command | What it does |
|
|
121
99
|
| --- | --- |
|
|
122
|
-
| `
|
|
123
|
-
| `
|
|
124
|
-
| `
|
|
125
|
-
|
|
126
|
-
Cross-session playbook retrieval uses `search_user_playbooks(agent_version=project_id, user_id=None)` — playbooks written from any prior session in this project surface for every future session.
|
|
100
|
+
| `/show` | Print the current project playbook plus the current session's user profiles (same markdown that `SessionStart` injects). Use it to audit what rules and preferences Claude is being told to follow. |
|
|
101
|
+
| `/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. |
|
|
102
|
+
| `/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. |
|
|
127
103
|
|
|
128
104
|
---
|
|
129
105
|
|
|
130
|
-
##
|
|
131
|
-
|
|
132
|
-
### Prerequisites
|
|
133
|
-
|
|
134
|
-
| Tool | Purpose |
|
|
135
|
-
| --- | --- |
|
|
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 |
|
|
139
|
-
|
|
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.
|
|
141
|
-
|
|
142
|
-
### Step 1 — Install the plugin
|
|
143
|
-
|
|
144
|
-
Pick whichever is handier — both published packages do the exact same thing:
|
|
145
|
-
|
|
146
|
-
```bash
|
|
147
|
-
# npm wrapper
|
|
148
|
-
npx claude-smart install
|
|
149
|
-
|
|
150
|
-
# Python wrapper
|
|
151
|
-
uvx claude-smart install
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
Either command:
|
|
155
|
-
|
|
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).
|
|
158
|
-
|
|
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
|
|
162
|
-
|
|
163
|
-
```bash
|
|
164
|
-
cd ~/.claude/plugins/marketplaces/reflexioai
|
|
165
|
-
uv run reflexio services start --only backend --no-reload
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
Expected log lines:
|
|
169
|
-
|
|
170
|
-
```
|
|
171
|
-
Registered claude-code LiteLLM provider (cli=/path/to/claude)
|
|
172
|
-
Local embedding provider enabled (model=local/minilm-l6-v2)
|
|
173
|
-
Auto-detected LLM providers (priority order): ['claude-code', 'local']
|
|
174
|
-
Primary provider for generation: claude-code
|
|
175
|
-
Embedding provider: local
|
|
176
|
-
Application startup complete.
|
|
177
|
-
```
|
|
106
|
+
## Dashboard
|
|
178
107
|
|
|
179
|
-
|
|
108
|
+
A Next.js web UI lives in [`plugin/dashboard/`](plugin/dashboard/) for browsing session buffers, inspecting user profiles, and editing project playbooks. It auto-starts alongside the backend — just open **http://localhost:3001**.
|
|
180
109
|
|
|
181
|
-
|
|
182
|
-
curl http://localhost:8081/health
|
|
183
|
-
# {"status":"healthy"}
|
|
184
|
-
```
|
|
110
|
+
---
|
|
185
111
|
|
|
186
|
-
|
|
112
|
+
## How It Works
|
|
187
113
|
|
|
188
|
-
|
|
189
|
-
uv run reflexio services stop
|
|
190
|
-
```
|
|
114
|
+
As you work, claude-smart builds two things and hands them back to Claude at the start of every new session:
|
|
191
115
|
|
|
192
|
-
|
|
116
|
+
### Your user profile — *who you are, this session*
|
|
193
117
|
|
|
194
|
-
|
|
118
|
+
A quick sketch of how you want to work right now — your stack, your role, small preferences you've dropped into the conversation. Scoped to the current session, so it doesn't follow you into unrelated projects.
|
|
195
119
|
|
|
196
|
-
|
|
120
|
+
> *Examples:*
|
|
121
|
+
> - *Uses pnpm, not npm.*
|
|
122
|
+
> - *Prefers terse answers, no trailing summaries.*
|
|
123
|
+
> - *Backend engineer — explain frontend code with backend analogues.*
|
|
197
124
|
|
|
198
|
-
|
|
199
|
-
/show
|
|
200
|
-
```
|
|
125
|
+
### The project playbook — *durable rules, every session*
|
|
201
126
|
|
|
202
|
-
|
|
127
|
+
A growing list of **rules for this project**, pulled from every session you've ever run in it. Each rule says when it applies and why it exists.
|
|
203
128
|
|
|
204
|
-
|
|
129
|
+
> *Examples:*
|
|
130
|
+
> - *Always pass `--run` to `npm test` — default watch mode hangs CI.*
|
|
131
|
+
> - *Use a real Postgres for integration tests, not mocks — mocks once hid a broken migration.*
|
|
132
|
+
> - *Prefer ESM-native test runners in this monorepo.*
|
|
205
133
|
|
|
206
|
-
|
|
207
|
-
claude plugin uninstall claude-smart@reflexioai
|
|
134
|
+
Rules clean themselves up: correct the same thing twice and they merge; change your mind later and the old one is archived.
|
|
208
135
|
|
|
209
|
-
|
|
210
|
-
rm -rf ~/.reflexio/data/ ~/.claude-smart/sessions/
|
|
211
|
-
```
|
|
136
|
+
### How it runs
|
|
212
137
|
|
|
213
|
-
|
|
138
|
+
1. You have a normal Claude Code session.
|
|
139
|
+
2. claude-smart quietly watches your turns, tool calls, and Claude's replies — flagging corrections automatically (or anything you `/tag`).
|
|
140
|
+
3. When the session ends (or you run `/learn`), it turns what happened into profile entries and playbook rules.
|
|
141
|
+
4. Next session, both get injected into Claude's system prompt. Run `/show` any time to see what Claude is being told.
|
|
214
142
|
|
|
215
|
-
|
|
143
|
+
No chat, no prompts to rewrite, no config files to groom. Everything runs on your machine.
|
|
216
144
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
## Slash Commands
|
|
220
|
-
|
|
221
|
-
| Command | What it does |
|
|
222
|
-
| --- | --- |
|
|
223
|
-
| `/show` | Print the current project playbook plus the current session's user profiles (same markdown that `SessionStart` injects). Use it to audit what rules and preferences Claude is being told to follow. |
|
|
224
|
-
| `/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. |
|
|
225
|
-
| `/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. |
|
|
145
|
+
See [ARCHITECTURE.md](./ARCHITECTURE.md) for the hooks, data flow, and reflexio details.
|
|
226
146
|
|
|
227
147
|
---
|
|
228
148
|
|
|
@@ -232,11 +152,14 @@ If you want to iterate on the plugin code (hooks, Python package, reflexio patch
|
|
|
232
152
|
|
|
233
153
|
| Variable | Default | Purpose |
|
|
234
154
|
| --- | --- | --- |
|
|
235
|
-
| `CLAUDE_SMART_USE_LOCAL_CLI` | `0`
|
|
236
|
-
| `CLAUDE_SMART_USE_LOCAL_EMBEDDING` | `0`
|
|
155
|
+
| `CLAUDE_SMART_USE_LOCAL_CLI` | `0` (installer sets `1`) | Route generation through the local `claude` CLI. Written to `~/.reflexio/.env` by `claude-smart install`. |
|
|
156
|
+
| `CLAUDE_SMART_USE_LOCAL_EMBEDDING` | `0` (installer sets `1`) | Use the in-process ONNX embedder (requires `chromadb`). Written to `~/.reflexio/.env` by `claude-smart install`. |
|
|
237
157
|
| `CLAUDE_SMART_CLI_PATH` | `shutil.which("claude")` | Override the path to the `claude` binary. |
|
|
238
158
|
| `CLAUDE_SMART_CLI_TIMEOUT` | `120` | Per-call subprocess timeout (seconds). Raise for slow prompts. |
|
|
239
159
|
| `CLAUDE_SMART_STATE_DIR` | `~/.claude-smart/sessions/` | Where the per-session JSONL buffer lives. |
|
|
160
|
+
| `CLAUDE_SMART_BACKEND_AUTOSTART` | `1` | Set to `0` to stop the SessionStart hook from spawning the reflexio backend on `localhost:8081`. |
|
|
161
|
+
| `CLAUDE_SMART_DASHBOARD_AUTOSTART` | `1` | Set to `0` to stop the SessionStart hook from spawning the Next.js dashboard on `localhost:3001`. |
|
|
162
|
+
| `CLAUDE_SMART_BACKEND_STOP_ON_END` | `0` | Set to `1` to tear down the backend at `SessionEnd` instead of leaving it long-lived. |
|
|
240
163
|
| `REFLEXIO_URL` | `http://localhost:8081/` | Point the plugin at a non-local reflexio backend. |
|
|
241
164
|
|
|
242
165
|
### Where data lives
|
|
@@ -261,25 +184,13 @@ If you still want to use a cloud embedding provider (OpenAI, Gemini, etc.), omit
|
|
|
261
184
|
|
|
262
185
|
---
|
|
263
186
|
|
|
264
|
-
## How the Claude Code Provider Works
|
|
265
|
-
|
|
266
|
-
claude-smart ships a small patch to reflexio (`reflexio/server/llm/providers/claude_code_provider.py`) that registers a LiteLLM `CustomLLM` named `claude-code`. Every time reflexio wants to generate, evaluate, or dedup, it ends up in `litellm.completion(model="claude-code/default", ...)` — which routes to our handler. The handler:
|
|
267
|
-
|
|
268
|
-
1. Splits LiteLLM's messages into `(system_prompt, dialogue)`.
|
|
269
|
-
2. Subprocesses `claude -p --output-format json --append-system-prompt "<system>"` with the dialogue on stdin.
|
|
270
|
-
3. Parses the JSON stdout into a LiteLLM `ModelResponse` with populated usage tokens.
|
|
271
|
-
|
|
272
|
-
Registration is opt-in (`CLAUDE_SMART_USE_LOCAL_CLI=1`) and idempotent, so enabling it does not affect users who still want OpenAI/Anthropic — reflexio's normal provider-priority chain stays intact.
|
|
273
|
-
|
|
274
|
-
---
|
|
275
|
-
|
|
276
187
|
## Troubleshooting
|
|
277
188
|
|
|
278
189
|
**SessionStart injects nothing after a correction.**
|
|
279
190
|
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.
|
|
280
191
|
|
|
281
192
|
**Reflexio refuses to boot with "no embedding-capable provider".**
|
|
282
|
-
Check that `CLAUDE_SMART_USE_LOCAL_EMBEDDING=1` is in `~/.reflexio/.env` *and* that `chromadb` is installed in the venv (`uv run 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.
|
|
193
|
+
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.
|
|
283
194
|
|
|
284
195
|
**`claude-smart` doesn't see my interactions.**
|
|
285
196
|
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`.
|
|
@@ -298,53 +209,6 @@ rm -rf ~/.reflexio/data/ # reflexio SQLite store
|
|
|
298
209
|
|
|
299
210
|
---
|
|
300
211
|
|
|
301
|
-
## Dashboard (web UI)
|
|
302
|
-
|
|
303
|
-
A Next.js management UI lives in [`dashboard/`](dashboard/). Use it to browse
|
|
304
|
-
local session buffers, inspect extracted user profiles, edit and archive
|
|
305
|
-
project playbooks, and tweak the claude-smart environment. It connects to the
|
|
306
|
-
same reflexio backend the plugin uses, so run that first.
|
|
307
|
-
|
|
308
|
-
```bash
|
|
309
|
-
# 1. reflexio backend on :8081 (see Step 2 above)
|
|
310
|
-
uv run reflexio services start --only backend --no-reload
|
|
311
|
-
|
|
312
|
-
# 2. install and run the dashboard
|
|
313
|
-
cd dashboard
|
|
314
|
-
npm install
|
|
315
|
-
npm run dev # http://localhost:3001
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
The dashboard reads `~/.claude-smart/sessions/*.jsonl` directly (server-side)
|
|
319
|
-
for in-flight session transcripts and proxies everything else through reflexio.
|
|
320
|
-
All state lives where the CLI already keeps it — the dashboard does not
|
|
321
|
-
introduce a second source of truth.
|
|
322
|
-
|
|
323
|
-
---
|
|
324
|
-
|
|
325
|
-
## Development
|
|
326
|
-
|
|
327
|
-
Run the test suite:
|
|
328
|
-
|
|
329
|
-
```bash
|
|
330
|
-
# reflexio patch unit tests
|
|
331
|
-
cd reflexio
|
|
332
|
-
uv run pytest tests/server/llm/ -q -o 'addopts='
|
|
333
|
-
|
|
334
|
-
# claude-smart package tests
|
|
335
|
-
cd ..
|
|
336
|
-
uv run pytest tests/ -q
|
|
337
|
-
```
|
|
338
|
-
|
|
339
|
-
Exercise a hook handler directly (useful for debugging without a live Claude Code session):
|
|
340
|
-
|
|
341
|
-
```bash
|
|
342
|
-
echo '{"session_id":"dev-1","source":"startup","cwd":"'"$PWD"'"}' \
|
|
343
|
-
| uv run python -m claude_smart.hook session-start
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
---
|
|
347
|
-
|
|
348
212
|
## License
|
|
349
213
|
|
|
350
214
|
This project is licensed under the **Apache License 2.0**. The bundled `reflexio/` submodule is also Apache 2.0. Claude Code is Anthropic's and not covered by this license.
|
|
@@ -355,8 +219,7 @@ See the [LICENSE](LICENSE) file for details.
|
|
|
355
219
|
|
|
356
220
|
## Support
|
|
357
221
|
|
|
358
|
-
- **Issues**: open one on GitHub describing the symptom and include the reflexio
|
|
359
|
-
- **Architecture notes**: see the plan file in `.claude/plans/` (if present), which walks through each design decision and the rationale.
|
|
222
|
+
- **Issues**: open one on GitHub describing the symptom and include the reflexio backend log (`~/.claude-smart/backend.log`) and the relevant lines of `~/.claude-smart/sessions/{session_id}.jsonl`.
|
|
360
223
|
|
|
361
224
|
---
|
|
362
225
|
|
package/bin/claude-smart.js
CHANGED
|
@@ -110,10 +110,9 @@ function runInstall(args) {
|
|
|
110
110
|
process.stdout.write(
|
|
111
111
|
[
|
|
112
112
|
"",
|
|
113
|
-
"claude-smart installed.
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
" 2. Restart Claude Code in your project.",
|
|
113
|
+
"claude-smart installed. Restart Claude Code in your project.",
|
|
114
|
+
"The reflexio backend and dashboard auto-start on session start.",
|
|
115
|
+
"Opt out with CLAUDE_SMART_BACKEND_AUTOSTART=0 or CLAUDE_SMART_DASHBOARD_AUTOSTART=0.",
|
|
117
116
|
"",
|
|
118
117
|
].join("\n"),
|
|
119
118
|
);
|