claude-smart 0.2.25 → 0.2.27
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 +30 -53
- package/bin/claude-smart.js +516 -11
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-plugin/plugin.json +2 -1
- package/plugin/hooks/codex-hooks.json +7 -7
- package/plugin/pyproject.toml +2 -1
- package/plugin/scripts/_codex_env.sh +1 -0
- package/plugin/scripts/backend-service.sh +12 -7
- package/plugin/scripts/codex-claude-compat.py +144 -0
- package/plugin/scripts/codex-hook.js +386 -0
- package/plugin/scripts/ensure-plugin-root.sh +3 -2
- package/plugin/scripts/smart-install.sh +0 -1
- package/plugin/skills/claude-smart/SKILL.md +32 -0
- package/plugin/src/claude_smart/cli.py +234 -17
- package/plugin/src/claude_smart/events/stop.py +16 -1
- package/plugin/src/claude_smart/internal_call.py +30 -0
- package/plugin/src/claude_smart/optimizer_assistant.py +86 -6
- package/plugin/uv.lock +12 -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.
|
|
16
|
+
<img src="https://img.shields.io/badge/version-0.2.27-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">
|
|
@@ -81,66 +81,45 @@ Four ways this changes what your coding assistant can do for you:
|
|
|
81
81
|
### Claude Code
|
|
82
82
|
|
|
83
83
|
```bash
|
|
84
|
-
claude
|
|
85
|
-
claude plugin install claude-smart@reflexioai
|
|
84
|
+
npx claude-smart install # or: uvx claude-smart install
|
|
86
85
|
```
|
|
87
86
|
|
|
88
|
-
|
|
89
|
-
private Node.js/npm runtime under `~/.claude-smart/` when they are missing, so
|
|
90
|
-
you do not need to install Python or Node globally for the plugin/dashboard.
|
|
87
|
+
Then restart Claude Code.
|
|
91
88
|
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
Requires Node.js (for `npx`) or uv (for `uvx`) to already exist.
|
|
90
|
+
|
|
91
|
+
Alternatively, install via Claude Code's plugin marketplace:
|
|
94
92
|
|
|
95
93
|
```bash
|
|
96
|
-
|
|
94
|
+
claude plugin marketplace add ReflexioAI/claude-smart
|
|
95
|
+
claude plugin install claude-smart@reflexioai
|
|
97
96
|
```
|
|
98
97
|
|
|
99
|
-
|
|
98
|
+
The plugin Setup hook installs its own `uv`, Python 3.12 environment, and
|
|
99
|
+
private Node.js/npm runtime under `~/.claude-smart/` when they are missing, so
|
|
100
|
+
you do not need to install Python or Node globally for the plugin/dashboard.
|
|
100
101
|
|
|
101
102
|
To uninstall:
|
|
102
103
|
|
|
103
104
|
```bash
|
|
104
|
-
claude
|
|
105
|
+
npx claude-smart uninstall # or: uvx claude-smart uninstall
|
|
105
106
|
```
|
|
106
107
|
|
|
107
|
-
Or, if
|
|
108
|
+
Or, if installed via the plugin marketplace:
|
|
108
109
|
|
|
109
110
|
```bash
|
|
110
|
-
|
|
111
|
+
claude plugin uninstall claude-smart@reflexioai
|
|
111
112
|
```
|
|
112
113
|
|
|
113
114
|
### Codex
|
|
114
115
|
|
|
115
|
-
You need the `codex` CLI on `PATH` and Node.js available for `npx`:
|
|
116
|
-
|
|
117
116
|
```bash
|
|
118
117
|
npx claude-smart install --host codex
|
|
119
118
|
```
|
|
120
119
|
|
|
121
|
-
|
|
122
|
-
Codex's `plugin_hooks` feature, installs `claude-smart` into Codex's local
|
|
123
|
-
plugin cache, and enables it in `~/.codex/config.toml`. Hooks are not active in
|
|
124
|
-
already-running Codex windows; after the command finishes:
|
|
125
|
-
|
|
126
|
-
1. Fully quit and reopen Codex in your project so hooks reload.
|
|
127
|
-
2. Run `/plugins` only if you want to verify `claude-smart` shows as installed
|
|
128
|
-
from the **ReflexioAI** marketplace.
|
|
129
|
-
|
|
130
|
-
If you install or toggle `claude-smart` manually from `/plugins`, still run
|
|
131
|
-
`npx claude-smart install --host codex` once afterward so `plugin_hooks` is
|
|
132
|
-
enabled and the cache/config are prepared.
|
|
133
|
-
|
|
134
|
-
Do not create a `~/plugins/claude-smart` symlink for a normal `npx` install;
|
|
135
|
-
that symlink is only for plugin development from a cloned checkout.
|
|
136
|
-
|
|
137
|
-
Installing from a clone is only for plugin development; see
|
|
138
|
-
[DEVELOPER.md](./DEVELOPER.md#developing-locally).
|
|
139
|
-
|
|
140
|
-
Codex and Claude Code intentionally share the same `CLAUDE_SMART_*` environment
|
|
141
|
-
variables, `~/.reflexio/` data, `~/.claude-smart/` session buffers, backend,
|
|
142
|
-
dashboard, and learned skills/preferences.
|
|
120
|
+
Then fully quit and reopen Codex so hooks reload.
|
|
143
121
|
|
|
122
|
+
Requires the `codex` CLI on `PATH` and Node.js (for `npx`).
|
|
144
123
|
|
|
145
124
|
To uninstall:
|
|
146
125
|
|
|
@@ -148,11 +127,10 @@ To uninstall:
|
|
|
148
127
|
npx claude-smart uninstall --host codex
|
|
149
128
|
```
|
|
150
129
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
130
|
+
Restart Codex after uninstalling. Learned data under `~/.reflexio/` and `~/.claude-smart/` is preserved and shared with Claude Code, so you can switch between hosts without losing skills or preferences.
|
|
131
|
+
|
|
132
|
+
Developing the plugin itself? See [DEVELOPER.md](./DEVELOPER.md#developing-locally) for what the installer does, manual toggles via `/plugins`, and clone-based development.
|
|
154
133
|
|
|
155
|
-
Developing the plugin itself? See [DEVELOPER.md](./DEVELOPER.md#developing-locally).
|
|
156
134
|
> **Not supported:** Claude Code Cowork, claude.ai/code web, or remote Codex environments without local plugin hooks — they run outside your local machine, so the local backend/dashboard and `~/.reflexio/` aren't reachable.
|
|
157
135
|
|
|
158
136
|
---
|
|
@@ -200,9 +178,7 @@ Under the hood: hooks watch your turns, tool calls, and assistant replies, auto-
|
|
|
200
178
|
```
|
|
201
179
|
|
|
202
180
|
That signals a preference (`p…`) or skill (`s…`) materially shaped the reply.
|
|
203
|
-
|
|
204
|
-
link back to dashboard entries. Open the interaction's detail page in the
|
|
205
|
-
[dashboard](#dashboard) to see the exact cited item.
|
|
181
|
+
Open the session's detail page in the [dashboard](http://localhost:3001) to see the exact cited item.
|
|
206
182
|
|
|
207
183
|
See [ARCHITECTURE.md](./ARCHITECTURE.md) for hooks, data flow, and reflexio details.
|
|
208
184
|
|
|
@@ -211,16 +187,17 @@ See [ARCHITECTURE.md](./ARCHITECTURE.md) for hooks, data flow, and reflexio deta
|
|
|
211
187
|
## Commands
|
|
212
188
|
|
|
213
189
|
Claude Code installs these as plugin slash commands. Codex does not currently
|
|
214
|
-
support
|
|
215
|
-
|
|
190
|
+
support plugin-provided slash commands, so claude-smart ships a Codex skill that
|
|
191
|
+
maps requests like "claude-smart show" or "run claude-smart learn" to the
|
|
192
|
+
equivalent action.
|
|
216
193
|
|
|
217
|
-
| Claude Code | Codex
|
|
194
|
+
| Claude Code | Codex request | What it does |
|
|
218
195
|
| --- | --- | --- |
|
|
219
|
-
| `/claude-smart:dashboard` | `
|
|
220
|
-
| `/claude-smart:show` | `
|
|
221
|
-
| `/claude-smart:learn [note]` | `
|
|
222
|
-
| `/claude-smart:restart` | `
|
|
223
|
-
| `/claude-smart:clear-all` | `
|
|
196
|
+
| `/claude-smart:dashboard` | `open claude-smart dashboard` | Open the dashboard in your browser, auto-starting the reflexio backend and dashboard services if they aren't already running. |
|
|
197
|
+
| `/claude-smart:show` | `claude-smart show` | Print current project-specific skills, shared skills, and the current project's preferences so you can audit learned state manually. |
|
|
198
|
+
| `/claude-smart:learn [note]` | `claude-smart learn with note "optional 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. |
|
|
199
|
+
| `/claude-smart:restart` | `restart claude-smart` | Restart the reflexio backend and dashboard to pick up new changes (e.g. after upgrading the plugin or editing local reflexio code). |
|
|
200
|
+
| `/claude-smart:clear-all` | `clear all claude-smart learnings` | **Destructive.** Delete *all* reflexio interactions, preferences, and skills. Use when you want to wipe learned state and start fresh. |
|
|
224
201
|
|
|
225
202
|
---
|
|
226
203
|
|
|
@@ -235,7 +212,7 @@ Advanced users can tune claude-smart via environment variables — see [DEVELOPE
|
|
|
235
212
|
| `~/.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`. |
|
|
236
213
|
| `~/.reflexio/.env` | Provider config — `CLAUDE_SMART_USE_LOCAL_CLI`, `CLAUDE_SMART_USE_LOCAL_EMBEDDING`, any optional API keys. |
|
|
237
214
|
| `.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. |
|
|
238
|
-
| `~/.codex/config.toml` | Codex feature flags,
|
|
215
|
+
| `~/.codex/config.toml` | Codex plugin state, hook feature flags, and per-hook trust entries after `claude-smart install --host codex`. |
|
|
239
216
|
| `~/.codex/plugins/cache/reflexioai/claude-smart/<version>/` | Codex's cached install of the `claude-smart` plugin from the `ReflexioAI` marketplace. |
|
|
240
217
|
| `~/.reflexio/plugin-root` | Self-healed symlink to the active plugin dir (managed by `ensure-plugin-root.sh` — written on install, refreshed each `SessionStart`). Claude Code slash commands and Codex shell-command helpers resolve through it, so don't delete it; if you do, the next session will recreate it. |
|
|
241
218
|
| `~/.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. |
|