claude-rework 1.3.0__tar.gz
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.
- claude_rework-1.3.0/LICENSE +21 -0
- claude_rework-1.3.0/PKG-INFO +514 -0
- claude_rework-1.3.0/README.md +487 -0
- claude_rework-1.3.0/claude_rework/__init__.py +6 -0
- claude_rework-1.3.0/claude_rework/cli.py +168 -0
- claude_rework-1.3.0/claude_rework/detect.py +215 -0
- claude_rework-1.3.0/claude_rework/installer.py +508 -0
- claude_rework-1.3.0/claude_rework/payload/__init__.py +1 -0
- claude_rework-1.3.0/claude_rework/payload/hooks/capture_events.py +121 -0
- claude_rework-1.3.0/claude_rework/payload/hooks/recall_auto.py +145 -0
- claude_rework-1.3.0/claude_rework/payload/hooks/recall_precompact.py +112 -0
- claude_rework-1.3.0/claude_rework/payload/hooks/recall_session_start.py +112 -0
- claude_rework-1.3.0/claude_rework/payload/mcp/recall_mcp.py +220 -0
- claude_rework-1.3.0/claude_rework/payload/skills/recall/SKILL.md +213 -0
- claude_rework-1.3.0/claude_rework/payload/skills/recall/reference/benchmarks.md +98 -0
- claude_rework-1.3.0/claude_rework/payload/skills/recall/reference/operations.md +122 -0
- claude_rework-1.3.0/claude_rework/payload/skills/recall/reference/retrieval-design.md +299 -0
- claude_rework-1.3.0/claude_rework/payload/skills/recall/scripts/recall.py +490 -0
- claude_rework-1.3.0/claude_rework/payload/skills/recall/scripts/recall_embed.py +409 -0
- claude_rework-1.3.0/claude_rework/payload/skills/recall/scripts/recall_extra.py +246 -0
- claude_rework-1.3.0/claude_rework/payload/skills/recall/scripts/recall_index.py +558 -0
- claude_rework-1.3.0/claude_rework/payload/skills/recall/scripts/recall_ledger.py +348 -0
- claude_rework-1.3.0/claude_rework/payload/skills/recall/scripts/recall_optimize.py +267 -0
- claude_rework-1.3.0/claude_rework/payload/skills/recall/scripts/recall_share.py +271 -0
- claude_rework-1.3.0/claude_rework/payload/skills/recall/scripts/recall_tune.py +204 -0
- claude_rework-1.3.0/claude_rework/payload/skills/recall/tests/run_tests.py +927 -0
- claude_rework-1.3.0/claude_rework/payload/skills/recall/tests/simulate.py +226 -0
- claude_rework-1.3.0/claude_rework/portable.py +558 -0
- claude_rework-1.3.0/claude_rework.egg-info/PKG-INFO +514 -0
- claude_rework-1.3.0/claude_rework.egg-info/SOURCES.txt +34 -0
- claude_rework-1.3.0/claude_rework.egg-info/dependency_links.txt +1 -0
- claude_rework-1.3.0/claude_rework.egg-info/entry_points.txt +3 -0
- claude_rework-1.3.0/claude_rework.egg-info/requires.txt +4 -0
- claude_rework-1.3.0/claude_rework.egg-info/top_level.txt +1 -0
- claude_rework-1.3.0/pyproject.toml +52 -0
- claude_rework-1.3.0/setup.cfg +4 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Luneswan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,514 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: claude-rework
|
|
3
|
+
Version: 1.3.0
|
|
4
|
+
Summary: Local, automatic memory for Claude Code. Remembers past sessions in 0.7s for ~2.5k tokens instead of 211k. Nothing leaves your machine.
|
|
5
|
+
Author: Luneswan
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Luneswan/claude-rework
|
|
8
|
+
Project-URL: Repository, https://github.com/Luneswan/claude-rework
|
|
9
|
+
Project-URL: Issues, https://github.com/Luneswan/claude-rework/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/Luneswan/claude-rework/releases
|
|
11
|
+
Keywords: claude,claude-code,claude-desktop,anthropic,memory,recall,context-window,token-optimization,mcp,mcp-server,rag,local-first,privacy,developer-tools,llm
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Classifier: Topic :: Software Development
|
|
19
|
+
Classifier: Topic :: Utilities
|
|
20
|
+
Requires-Python: >=3.9
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Provides-Extra: semantic
|
|
24
|
+
Requires-Dist: numpy>=1.21; extra == "semantic"
|
|
25
|
+
Requires-Dist: model2vec>=0.3; extra == "semantic"
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
<div align="center">
|
|
29
|
+
|
|
30
|
+
# claude-rework
|
|
31
|
+
|
|
32
|
+
**Claude forgets everything between sessions. This makes it remember - without burning your context window.**
|
|
33
|
+
|
|
34
|
+
[](https://pypi.org/project/claude-rework/)
|
|
35
|
+
[](https://pypi.org/project/claude-rework/)
|
|
36
|
+
[](https://github.com/Luneswan/claude-rework/stargazers)
|
|
37
|
+
[](https://github.com/Luneswan/claude-rework/actions/workflows/ci.yml)
|
|
38
|
+
[](https://pypi.org/project/claude-rework/)
|
|
39
|
+
[](LICENSE)
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install claude-rework && claude-rework install
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 💸 See how much you save
|
|
50
|
+
|
|
51
|
+
Every number here is **measured on a real 7.4 GB installation**, not estimated
|
|
52
|
+
from industry averages. One question about your own past work:
|
|
53
|
+
|
|
54
|
+
| Answering *"what did we decide about X?"* | Input tokens | Right answer? |
|
|
55
|
+
|---|---:|:-:|
|
|
56
|
+
| Paste the session into context | 26,539,949 | yes - and impossible, it's a 101 MB transcript |
|
|
57
|
+
| `grep` your notes and transcripts | 211,627 | yes - and unaffordable |
|
|
58
|
+
| **claude-rework** | **2,552** | **yes** |
|
|
59
|
+
| | **↓ 209,075 saved** | |
|
|
60
|
+
|
|
61
|
+
Resuming a session costs the same way: re-reading the conversation to find where
|
|
62
|
+
you left off runs 30,000–80,000 tokens. `--brief` rebuilds the same picture from
|
|
63
|
+
the index for **~600**. Call it **49,400 saved** per resume.
|
|
64
|
+
|
|
65
|
+
### One developer, one month
|
|
66
|
+
|
|
67
|
+
<sub>22 working days. Pick the row that looks like your week - then multiply by your team.</sub>
|
|
68
|
+
|
|
69
|
+
| Your usage | Per day | Tokens never sent | Opus 5 | Sonnet 5 | Haiku 4.5 |
|
|
70
|
+
|---|---|---:|---:|---:|---:|
|
|
71
|
+
| Light | 2 lookups, 1 resume | 10.3M | **$51** | $21 | $10 |
|
|
72
|
+
| **Typical** | 6 lookups, 2 resumes | **29.8M** | **$149** | $60 | $30 |
|
|
73
|
+
| Heavy | 15 lookups, 4 resumes | 73.3M | **$367** | $147 | $73 |
|
|
74
|
+
|
|
75
|
+
Ten typical developers is the same row × 10 - **297.7M tokens and $1,489 a month**,
|
|
76
|
+
$17,863 a year.
|
|
77
|
+
|
|
78
|
+
<details>
|
|
79
|
+
<summary><b>On a Pro or Max subscription instead of the API?</b></summary>
|
|
80
|
+
|
|
81
|
+
<br>
|
|
82
|
+
|
|
83
|
+
You aren't billed per token, so the saving isn't an invoice line - it's **headroom**.
|
|
84
|
+
Those 29.8M tokens a month are context you no longer spend re-deriving things you
|
|
85
|
+
already knew, which is work you get done before hitting a limit.
|
|
86
|
+
|
|
87
|
+
How many extra messages that buys is not something anyone outside Anthropic can
|
|
88
|
+
compute. Rate limits move with demand and the formula isn't published. So this
|
|
89
|
+
README won't hand you a "3× more coding hours" figure - anyone who does made it up.
|
|
90
|
+
|
|
91
|
+
What's true and checkable: **the token reduction above is measured**, and the
|
|
92
|
+
dollar column is that reduction times Anthropic's published input price.
|
|
93
|
+
|
|
94
|
+
</details>
|
|
95
|
+
|
|
96
|
+
<details>
|
|
97
|
+
<summary><b>Show me the arithmetic</b></summary>
|
|
98
|
+
|
|
99
|
+
<br>
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
per lookup saved = 211,627 (grep) - 2,552 (indexed) = 209,075 tokens
|
|
103
|
+
per resume saved = 50,000 (re-read) - 600 (--brief) = 49,400 tokens
|
|
104
|
+
|
|
105
|
+
typical developer = (6 × 22 × 209,075) + (2 × 22 × 49,400)
|
|
106
|
+
= 27,597,900 + 2,173,600
|
|
107
|
+
= 29,771,500 tokens / month
|
|
108
|
+
|
|
109
|
+
at Opus 5 input = 29.77 M × $5.00 / M = $148.86 / developer / month
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Prices are Anthropic list: Opus 5 `$5.00`, Sonnet 5 `$2.00`, Haiku 4.5 `$1.00`
|
|
113
|
+
per million input tokens. The search itself runs on your CPU and costs nothing.
|
|
114
|
+
|
|
115
|
+
</details>
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Install
|
|
120
|
+
|
|
121
|
+
**One line. Any OS. It finds everything itself.**
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
pip install claude-rework && claude-rework install
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
<details>
|
|
128
|
+
<summary><b>No pip? No terminal? Other ways in →</b></summary>
|
|
129
|
+
|
|
130
|
+
<br>
|
|
131
|
+
|
|
132
|
+
**One line, without pip:**
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
curl -fsSL https://raw.githubusercontent.com/Luneswan/claude-rework/main/install.py | python3 -
|
|
136
|
+
```
|
|
137
|
+
```powershell
|
|
138
|
+
iwr -useb https://raw.githubusercontent.com/Luneswan/claude-rework/main/install.py | python -
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**No terminal at all** - [download the zip](https://github.com/Luneswan/claude-rework/archive/refs/heads/main.zip), unzip it, then:
|
|
142
|
+
|
|
143
|
+
| Your machine | Do this |
|
|
144
|
+
|---|---|
|
|
145
|
+
| **macOS** | Double-click `install.command` |
|
|
146
|
+
| **Windows** | Right-click `install.ps1` → *Run with PowerShell* - it installs Python for you if you don't have it |
|
|
147
|
+
| **Linux** | `bash install.sh` |
|
|
148
|
+
|
|
149
|
+
All five routes run the same installer.
|
|
150
|
+
|
|
151
|
+
</details>
|
|
152
|
+
|
|
153
|
+
It detects your OS, finds every Claude surface you have, connects each one the
|
|
154
|
+
only way it can be reached, installs the semantic-search extras, and **builds
|
|
155
|
+
your index immediately** - no session, no first message, no waiting.
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
claude-rework 1.3.0 - install
|
|
159
|
+
system Darwin 24.3.0 (arm64), Python 3.12.7
|
|
160
|
+
claude_code found, not connected
|
|
161
|
+
claude_desktop found, not connected
|
|
162
|
+
index not built, 1,421 transcript file(s)
|
|
163
|
+
|
|
164
|
+
installed skill ~/.claude/skills/recall
|
|
165
|
+
installed hooks ~/.claude/hooks (4 scripts)
|
|
166
|
+
claude code connected via hooks:
|
|
167
|
+
+ SessionStart start each session knowing what is still open
|
|
168
|
+
+ UserPromptSubmit answer 'did we already do this?' before Claude guesses
|
|
169
|
+
+ PostToolUse record what was actually edited and run
|
|
170
|
+
+ PreCompact save decisions before compaction drops them
|
|
171
|
+
desktop app connected via mcp - restart the app to load it
|
|
172
|
+
ranking lexical + semantic
|
|
173
|
+
index corpus now 7.7 MB (13,074 messages)
|
|
174
|
+
vectors 13,074 vectors, dim 512, 25.5 MB, in 6s
|
|
175
|
+
|
|
176
|
+
Done. Nothing else to configure.
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**You never type a recall command again.** Ask Claude in plain English.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## What it feels like
|
|
184
|
+
|
|
185
|
+
> **you:** didn't we already fix the webhook timeout?
|
|
186
|
+
|
|
187
|
+
Before Claude sees that message, claude-rework searched 13,000 messages of your
|
|
188
|
+
own history locally and put the answer in front of it:
|
|
189
|
+
|
|
190
|
+
> **Claude:** From your history on Feb 14 - you set it to **12 seconds** after
|
|
191
|
+
> measuring the provider's p99 at 9.4s.
|
|
192
|
+
|
|
193
|
+
About 400 tokens, 0.7 seconds, answered from what you *actually decided*.
|
|
194
|
+
|
|
195
|
+
**"Add a button" triggers nothing.** History is only fetched when you ask about
|
|
196
|
+
the past - injecting it into new work is exactly the waste this exists to prevent.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Every Claude surface, connected automatically
|
|
201
|
+
|
|
202
|
+
| Surface | How it connects | Auto-detected |
|
|
203
|
+
|---|---|:-:|
|
|
204
|
+
| **Claude Code** (terminal) | 4 hooks | ✅ |
|
|
205
|
+
| **VS Code extension** | same hooks - it drives the same CLI | ✅ |
|
|
206
|
+
| **JetBrains extension** | same hooks | ✅ |
|
|
207
|
+
| **Claude Desktop app** | MCP server - desktop can't run hooks | ✅ |
|
|
208
|
+
| **Claude Cowork** | same MCP server | ✅ |
|
|
209
|
+
|
|
210
|
+
Where a surface *can't* take hooks, it falls back to MCP rather than documenting
|
|
211
|
+
the limitation and leaving you to solve it.
|
|
212
|
+
|
|
213
|
+
**The design argument in one line:** an MCP server's tool schemas load into your
|
|
214
|
+
context *before you type a word*, every session. A hook costs nothing until it
|
|
215
|
+
fires.
|
|
216
|
+
|
|
217
|
+
| | Hooks (Claude Code) | MCP (desktop app) |
|
|
218
|
+
|---|:-:|:-:|
|
|
219
|
+
| Context cost while idle | **zero** | tool schemas, every session |
|
|
220
|
+
| Fires on | only past-shaped prompts | whenever Claude decides |
|
|
221
|
+
| Records what you *did* | ✅ | ✗ |
|
|
222
|
+
| Survives compaction | ✅ writes to disk first | ✗ |
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## What runs, and when
|
|
227
|
+
|
|
228
|
+
| When | What happens | Cost |
|
|
229
|
+
|---|---|---|
|
|
230
|
+
| You open a session | Prints the threads still open from the last few days | ~600 tokens, once |
|
|
231
|
+
| You ask about the past | Looks it up locally, hands the answer to Claude | ~300 tokens, only those prompts |
|
|
232
|
+
| Claude edits or runs something | Logs one line of what actually happened | a file append |
|
|
233
|
+
| Compaction starts | Writes the decisions to disk **first** | ~600 tokens |
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## 🧳 Switching accounts or machines
|
|
238
|
+
|
|
239
|
+
New Claude account? New laptop? Your history stays behind and Claude forgets you.
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
claude-rework export memory.zip # old account
|
|
243
|
+
|
|
244
|
+
pip install claude-rework && claude-rework install
|
|
245
|
+
claude-rework import memory.zip # new account, new machine, any OS
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Everything comes with you, automatically:
|
|
249
|
+
|
|
250
|
+
| Carried across | What that means |
|
|
251
|
+
|---|---|
|
|
252
|
+
| **Your whole search index** | every message and conclusion already extracted |
|
|
253
|
+
| **Every project** | slug, real path on disk, how much history each has |
|
|
254
|
+
| **Project context** | each project's `CLAUDE.md`, `AGENTS.md`, memory notes |
|
|
255
|
+
| **The activity log** | what was actually edited and run |
|
|
256
|
+
| **Who you are** | a `who-i-am` profile, so the new account knows you on day one |
|
|
257
|
+
| Raw transcripts | only with `--with-transcripts` - large, exact |
|
|
258
|
+
|
|
259
|
+
**Never carried:** `settings.json`, hooks, credentials, API keys, OAuth tokens.
|
|
260
|
+
It's your *content*, not your configuration - so a bundle can't leak a secret it
|
|
261
|
+
never contained.
|
|
262
|
+
|
|
263
|
+
Import is a **merge, never a replace**. Import the same bundle twice and nothing
|
|
264
|
+
changes. Import a colleague's and it adds to yours. A note you already wrote is
|
|
265
|
+
never overwritten.
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
claude-rework inspect memory.zip # look before you import
|
|
269
|
+
claude-rework profile # what Claude knows about you
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## How it compares
|
|
275
|
+
|
|
276
|
+
### Against other memory & token skills
|
|
277
|
+
|
|
278
|
+
Every one of these was installed on the machine this was built on. Counts come
|
|
279
|
+
from the filesystem, not from memory.
|
|
280
|
+
|
|
281
|
+
| | Files | Code | Tests | Searches your history | Runs itself | Offline |
|
|
282
|
+
|---|---:|---:|---:|:-:|:-:|:-:|
|
|
283
|
+
| `context-budget` | 1 | 0 | 0 | ✗ | ✗ | n/a |
|
|
284
|
+
| `token-budget-advisor` | 1 | 0 | 0 | ✗ | ✗ | n/a |
|
|
285
|
+
| `rescue-tokens` | 2 | 0 | 0 | ✗ | ✗ | n/a |
|
|
286
|
+
| `token-optimization` | 8 | 1 | 2 | ✗ | ✗ | n/a |
|
|
287
|
+
| `long-context-lost-in-the-middle` | 1 | 0 | 0 | ✗ | ✗ | n/a |
|
|
288
|
+
| `mem-search` | 1 | 0 | 0 | ✗ | ✗ | n/a |
|
|
289
|
+
| `smart-explore` | 1 | 0 | 0 | ✗ | ✗ | n/a |
|
|
290
|
+
| `timeline-report` | 1 | 0 | 0 | ✗ | ✗ | n/a |
|
|
291
|
+
| `mempalace` | 1 | 0 | 0 | ✗ | ✗ | n/a |
|
|
292
|
+
| `claude-mem` (plugin) | - | 7 | 0 | ✅ via MCP | ✅ via MCP | ✗ |
|
|
293
|
+
| **claude-rework** | **34** | **17** | **9 suites, 400+ cases** | **✅** | **✅ hooks + MCP** | **✅** |
|
|
294
|
+
|
|
295
|
+
Most of that list is *advice* - well-written documents telling Claude to be
|
|
296
|
+
careful with context. A document cannot search 7 GB of transcripts or tell you
|
|
297
|
+
whether it worked. `claude-mem` is the one genuinely comparable project, and it
|
|
298
|
+
takes the MCP-only bet.
|
|
299
|
+
|
|
300
|
+
**This is not a claim those skills are bad.** Several taught me things, and
|
|
301
|
+
claude-rework absorbs what each did well: `--budget-report` is what
|
|
302
|
+
`context-budget` did, `--estimate` is `token-budget-advisor`, `--timeline` is
|
|
303
|
+
`timeline-report`. The argument is narrower - one tested program beats nine
|
|
304
|
+
overlapping documents, because loading several memory skills at once is precisely
|
|
305
|
+
the waste each of them warns about.
|
|
306
|
+
|
|
307
|
+
### Against the obvious alternatives
|
|
308
|
+
|
|
309
|
+
| | grep | RAG service | `/compact` | CLAUDE.md | **claude-rework** |
|
|
310
|
+
|---|---|---|---|---|---|
|
|
311
|
+
| Finds a decision from 3 months ago | yes, unaffordably | yes | no, it's gone | only what you typed | **yes** |
|
|
312
|
+
| Cost per answer | ~211k tokens | API calls | free but lossy | in context always | **~2.5k tokens** |
|
|
313
|
+
| Your data leaves the machine | no | **yes** | no | no | **no** |
|
|
314
|
+
| Needs a key or account | no | yes | no | no | **no** |
|
|
315
|
+
| Runs without you asking | no | no | n/a | n/a | **yes** |
|
|
316
|
+
| Survives an account switch | n/a | yes | no | manual copy | **yes, one command** |
|
|
317
|
+
| Tells you when it's wrong | no | rarely | n/a | n/a | **yes, refuses stale indexes** |
|
|
318
|
+
| Works on a plane | yes | no | yes | yes | **yes** |
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## Why it works
|
|
323
|
+
|
|
324
|
+
Four ideas. Each measured before it was kept.
|
|
325
|
+
|
|
326
|
+
**1. Extract once, search forever.** Raw transcripts are 7.4 GB of JSON, mostly
|
|
327
|
+
tool output. What answers a question is what people typed, plus the minority of
|
|
328
|
+
Claude's replies that state a conclusion. Pulled out once: 7.7 MB. Same answers,
|
|
329
|
+
158s → 0.33s.
|
|
330
|
+
|
|
331
|
+
**2. Rank across stores, not one at a time.** Notes, skills, an optional code
|
|
332
|
+
graph and your transcripts are searched in one pass and ranked together.
|
|
333
|
+
Searching notes first and stopping *sounds* principled and scored worse - a weak
|
|
334
|
+
note from an unrelated project displaces the line holding the answer. Store
|
|
335
|
+
priority is a weight, not an order.
|
|
336
|
+
|
|
337
|
+
**3. Score density, not word count.** A 6,000-character note matching two filler
|
|
338
|
+
words used to beat the 600-character chunk holding the answer. Dividing by the
|
|
339
|
+
square root of length took accuracy from 42% → 75% on its own.
|
|
340
|
+
|
|
341
|
+
**4. Semantic search that admits, but doesn't decide.** *"Why was the router
|
|
342
|
+
broken"* is answered by *"bash ate the backslashes in the interpreter path"* -
|
|
343
|
+
which shares no words with the question. Static embeddings close that gap for a
|
|
344
|
+
one-time 36 MB download, no GPU, no API. A chunk can enter the running without a
|
|
345
|
+
shared word, but it still has to win on the combined score.
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
## Proof
|
|
350
|
+
|
|
351
|
+
Nine suites, each with a floor. The run fails if any drops below it.
|
|
352
|
+
|
|
353
|
+
| Suite | Result | What it proves |
|
|
354
|
+
|---|---|---|
|
|
355
|
+
| known-item | **300/300** | retrieval on questions generated *from your corpus*, gold term held out |
|
|
356
|
+
| curated | **12/12** | hand-written cases, zero silent fallbacks |
|
|
357
|
+
| stress | **19/19** | empty input, CJK, RTL, shell metacharacters, a 3,000-char word |
|
|
358
|
+
| subcommands | **11/11** | every command runs clean |
|
|
359
|
+
| capture | **33/33** | the hook records work, drops noise, redacts secrets |
|
|
360
|
+
| vectors | **6/6** | a stale or misaligned index is refused, never guessed at |
|
|
361
|
+
| federation | **28/28** | hostile input rejected without crashing |
|
|
362
|
+
| concurrency | **5/5** | three builds at once → zero duplicates, no lock left behind |
|
|
363
|
+
| hooks | **13/13** | all four hooks under Claude Code's real calling convention |
|
|
364
|
+
| foreign machines | **4/4 at 100%** | tiny, huge, non-English and sparse corpora |
|
|
365
|
+
| optimizer | **100/100** | no file lost, no action below the evidence threshold |
|
|
366
|
+
|
|
367
|
+
```bash
|
|
368
|
+
claude-rework test
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
**CI runs a clean-room install on Ubuntu, Windows and macOS × Python 3.10 and
|
|
372
|
+
3.12 on every push** - a machine that has never seen this, synthetic transcripts,
|
|
373
|
+
the optional binary stripped from `PATH`, install → use → uninstall.
|
|
374
|
+
|
|
375
|
+
**The known-item suite is generated from your own data, not written by hand.** It
|
|
376
|
+
samples a chunk, builds a question from that chunk's own words, holds back the
|
|
377
|
+
most distinctive word so nothing passes by exact match, and demands the chunk
|
|
378
|
+
back. Twelve cases I wrote by hand scored 100% while sixty generated ones scored
|
|
379
|
+
76.7%. The gap was me overfitting to my own imagination - and I only saw it
|
|
380
|
+
because the generated set existed.
|
|
381
|
+
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
## Keeping it working
|
|
385
|
+
|
|
386
|
+
```bash
|
|
387
|
+
claude-rework status # what's connected, what's indexed
|
|
388
|
+
claude-rework doctor # check every connection; say what's wrong
|
|
389
|
+
claude-rework repair # fix what doctor found
|
|
390
|
+
claude-rework update # newest version, reconnected
|
|
391
|
+
claude-rework uninstall # remove everything; keep your memory
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
`doctor` catches the failures that are otherwise silent: a hook pointing at a
|
|
395
|
+
Python that no longer exists, a backslash in a hook path (bash eats them - that
|
|
396
|
+
one cost hours), an MCP entry orphaned by a moved interpreter, an index that was
|
|
397
|
+
never built. `repair` fixes all of them.
|
|
398
|
+
|
|
399
|
+
<details>
|
|
400
|
+
<summary><b>Commands, if you want them</b> - you shouldn't need these</summary>
|
|
401
|
+
|
|
402
|
+
<br>
|
|
403
|
+
|
|
404
|
+
```bash
|
|
405
|
+
claude-rework "<question>" # ask your history
|
|
406
|
+
claude-rework "<q>" --this-project # only this project
|
|
407
|
+
claude-rework --brief --days 2 # asked / done / still open
|
|
408
|
+
claude-rework --handoff # what must survive a compact
|
|
409
|
+
claude-rework --decisions --days 30 # a decision ledger
|
|
410
|
+
claude-rework --timeline --days 7 # by day, across projects
|
|
411
|
+
claude-rework --write "<fact>" --name <slug> --type project|user|feedback|reference
|
|
412
|
+
claude-rework --budget-report # what a session costs before you type
|
|
413
|
+
claude-rework --estimate "@file.md" # input tokens and likely response size
|
|
414
|
+
claude-rework --gc # stale/duplicate notes (never deletes)
|
|
415
|
+
claude-rework --optimize [--apply] # promote/demote skills from measured usage
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
`--budget-report` found four image-generation skills on my machine costing ~950
|
|
419
|
+
tokens *every session* for something used monthly. Moving them to a library tier
|
|
420
|
+
cut fixed session cost by 27%, and they stayed one search away.
|
|
421
|
+
|
|
422
|
+
</details>
|
|
423
|
+
|
|
424
|
+
---
|
|
425
|
+
|
|
426
|
+
## Privacy
|
|
427
|
+
|
|
428
|
+
Nothing leaves your machine. No telemetry, no account, no server.
|
|
429
|
+
|
|
430
|
+
The only networked feature is opt-in parameter sharing, and it sends about twenty
|
|
431
|
+
integers:
|
|
432
|
+
|
|
433
|
+
```json
|
|
434
|
+
{"schema": 1, "machine": "9f2c4a1b77de",
|
|
435
|
+
"params": {"sem_weight": 12, "first_div": 2, "taper": 6},
|
|
436
|
+
"scores": {"known_item": 0.99, "curated": 1.0},
|
|
437
|
+
"corpus": {"chunks": 13074, "vocab": 84210}}
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
No prompts, answers, paths, project names or note text. The machine id is a
|
|
441
|
+
random local salt, not a hostname.
|
|
442
|
+
|
|
443
|
+
- **`--export` writes a file and stops.** Nothing uploads on a schedule.
|
|
444
|
+
- **A pulled card is untrusted input.** Every field is range-checked, the whole
|
|
445
|
+
card is rejected on any bad field, and a hostile card can't crash the import.
|
|
446
|
+
- **Only integers are adopted.** It cannot fetch or run code. Code travels the
|
|
447
|
+
ordinary way - a pull request a human reads - because auto-executing code
|
|
448
|
+
pulled from strangers is a supply-chain compromise wearing a helpful hat.
|
|
449
|
+
|
|
450
|
+
**Secrets never reach the activity log.** Commands are scrubbed before writing.
|
|
451
|
+
That scrubber had a real bug, found by the test suite here:
|
|
452
|
+
`Authorization:\s*\S+` eats one token after the colon, and in
|
|
453
|
+
`Authorization: Bearer <token>` that token is the word *"Bearer"* - so the
|
|
454
|
+
credential went to disk in the clear. It now takes the scheme *and* the value,
|
|
455
|
+
with a test per credential shape.
|
|
456
|
+
|
|
457
|
+
---
|
|
458
|
+
|
|
459
|
+
## Requirements
|
|
460
|
+
|
|
461
|
+
- **Python 3.9+ and Claude.** That's the hard requirement.
|
|
462
|
+
- **`numpy` + `model2vec`** install automatically for semantic ranking. If that
|
|
463
|
+
can't happen (offline, locked-down machine), it falls back to lexical scoring
|
|
464
|
+
and still works - the install never fails over an optional extra.
|
|
465
|
+
- **graphify is not required.** If a project happens to have a code graph, it's
|
|
466
|
+
used as one more store; if not, that store is skipped. *Tested, not asserted:*
|
|
467
|
+
the suite runs with graphify absent from `PATH`, then again with a graph
|
|
468
|
+
directory present but no binary, and both must come back clean.
|
|
469
|
+
- Windows, macOS, Linux - all three in CI.
|
|
470
|
+
|
|
471
|
+
---
|
|
472
|
+
|
|
473
|
+
## Honest limitations
|
|
474
|
+
|
|
475
|
+
- **Only as good as your transcripts.** A fresh Claude install has nothing to
|
|
476
|
+
remember, and it says so rather than inventing something.
|
|
477
|
+
- **`--brief` is a heuristic.** It decides a request is "done" by checking
|
|
478
|
+
whether a later message reads like a conclusion about the same thing. Usually
|
|
479
|
+
right, and it says out loud that it's guessing.
|
|
480
|
+
- **The auto-recall hook fires on phrasing, not understanding.** Ask about the
|
|
481
|
+
past in an unusual way and it stays silent; the tool is still one question away.
|
|
482
|
+
- **Parameter sharing has never met a second real machine.** The validator is
|
|
483
|
+
tested against 28 hostile cards. Two installs converging is unproven.
|
|
484
|
+
- **Every threshold was fitted on one person's corpus.** That's why `simulate.py`
|
|
485
|
+
builds synthetic machines with alien vocabularies. It found a real bug on its
|
|
486
|
+
first honest run: an IDF floor of `0.3` let a word appearing in *every* record
|
|
487
|
+
still score - invisible on a diverse corpus, ruinous on a small one. Four
|
|
488
|
+
synthetic machines went from 44/64/88/92% → 100%.
|
|
489
|
+
|
|
490
|
+
---
|
|
491
|
+
|
|
492
|
+
## Contributing
|
|
493
|
+
|
|
494
|
+
Issues and PRs welcome. The bar is simple: **a change that can't hold the test
|
|
495
|
+
floors is the thing that's wrong.** Floors only ratchet up.
|
|
496
|
+
|
|
497
|
+
```bash
|
|
498
|
+
git clone https://github.com/Luneswan/claude-rework && cd claude-rework
|
|
499
|
+
python tests/clean_room_test.py # the real test: install into a fresh machine
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
[CONTRIBUTING.md](CONTRIBUTING.md) · [SECURITY.md](SECURITY.md) · [CHANGELOG.md](CHANGELOG.md)
|
|
503
|
+
|
|
504
|
+
---
|
|
505
|
+
|
|
506
|
+
<div align="center">
|
|
507
|
+
|
|
508
|
+
**If this saved you tokens, [⭐ star it](https://github.com/Luneswan/claude-rework) - it's the only signal that tells me whether to keep building.**
|
|
509
|
+
|
|
510
|
+
[](https://star-history.com/#Luneswan/claude-rework&Date)
|
|
511
|
+
|
|
512
|
+
MIT · Built because Claude kept asking me things I'd already answered.
|
|
513
|
+
|
|
514
|
+
</div>
|