claude-rework
Claude forgets everything between sessions. This makes it remember - without burning your context window.
pip install claude-rework && claude-rework install
💸 See how much you save
Every number here is measured on a real 7.4 GB installation, not estimated from industry averages. One question about your own past work:
| Answering "what did we decide about X?" | Input tokens | Right answer? |
|---|---|---|
| Paste the session into context | 26,539,949 | yes - and impossible, it's a 101 MB transcript |
grep your notes and transcripts |
211,627 | yes - and unaffordable |
| claude-rework | 2,552 | yes |
| ↓ 209,075 saved |
Resuming a session costs the same way: re-reading the conversation to find where
you left off runs 30,000–80,000 tokens. --brief rebuilds the same picture from
the index for ~600. Call it 49,400 saved per resume.
One developer, one month
22 working days. Pick the row that looks like your week - then multiply by your team.
| Your usage | Per day | Tokens never sent | Opus 5 | Sonnet 5 | Haiku 4.5 |
|---|---|---|---|---|---|
| Light | 2 lookups, 1 resume | 10.3M | $51 | $21 | $10 |
| Typical | 6 lookups, 2 resumes | 29.8M | $149 | $60 | $30 |
| Heavy | 15 lookups, 4 resumes | 73.3M | $367 | $147 | $73 |
Ten typical developers is the same row × 10 - 297.7M tokens and $1,489 a month, $17,863 a year.
On a Pro or Max subscription instead of the API?
You aren't billed per token, so the saving isn't an invoice line - it's headroom. Those 29.8M tokens a month are context you no longer spend re-deriving things you already knew, which is work you get done before hitting a limit.
How many extra messages that buys is not something anyone outside Anthropic can compute. Rate limits move with demand and the formula isn't published. So this README won't hand you a "3× more coding hours" figure - anyone who does made it up.
What's true and checkable: the token reduction above is measured, and the dollar column is that reduction times Anthropic's published input price.
Show me the arithmetic
per lookup saved = 211,627 (grep) - 2,552 (indexed) = 209,075 tokens
per resume saved = 50,000 (re-read) - 600 (--brief) = 49,400 tokens
typical developer = (6 × 22 × 209,075) + (2 × 22 × 49,400)
= 27,597,900 + 2,173,600
= 29,771,500 tokens / month
at Opus 5 input = 29.77 M × $5.00 / M = $148.86 / developer / month
Prices are Anthropic list: Opus 5 $5.00, Sonnet 5 $2.00, Haiku 4.5 $1.00
per million input tokens. The search itself runs on your CPU and costs nothing.
Install
One line. Any OS. It finds everything itself.
pip install claude-rework && claude-rework install
No pip? No terminal? Other ways in →
One line, without pip:
curl -fsSL https://raw.githubusercontent.com/Luneswan/claude-rework/main/install.py | python3 -
iwr -useb https://raw.githubusercontent.com/Luneswan/claude-rework/main/install.py | python -
No terminal at all - download the zip, unzip it, then:
| Your machine | Do this |
|---|---|
| macOS | Double-click install.command |
| Windows | Right-click install.ps1 → Run with PowerShell - it installs Python for you if you don't have it |
| Linux | bash install.sh |
All five routes run the same installer.
It detects your OS, finds every Claude surface you have, connects each one the only way it can be reached, installs the semantic-search extras, and builds your index immediately - no session, no first message, no waiting.
claude-rework 1.3.0 - install
system Darwin 24.3.0 (arm64), Python 3.12.7
claude_code found, not connected
claude_desktop found, not connected
index not built, 1,421 transcript file(s)
installed skill ~/.claude/skills/recall
installed hooks ~/.claude/hooks (4 scripts)
claude code connected via hooks:
+ SessionStart start each session knowing what is still open
+ UserPromptSubmit answer 'did we already do this?' before Claude guesses
+ PostToolUse record what was actually edited and run
+ PreCompact save decisions before compaction drops them
desktop app connected via mcp - restart the app to load it
ranking lexical + semantic
index corpus now 7.7 MB (13,074 messages)
vectors 13,074 vectors, dim 512, 25.5 MB, in 6s
Done. Nothing else to configure.
You never type a recall command again. Ask Claude in plain English.
What it feels like
you: didn't we already fix the webhook timeout?
Before Claude sees that message, claude-rework searched 13,000 messages of your own history locally and put the answer in front of it:
Claude: From your history on Feb 14 - you set it to 12 seconds after measuring the provider's p99 at 9.4s.
About 400 tokens, 0.7 seconds, answered from what you actually decided.
"Add a button" triggers nothing. History is only fetched when you ask about the past - injecting it into new work is exactly the waste this exists to prevent.
Every Claude surface, connected automatically
| Surface | How it connects | Auto-detected |
|---|---|---|
| Claude Code (terminal) | 4 hooks | ✅ |
| VS Code extension | same hooks - it drives the same CLI | ✅ |
| JetBrains extension | same hooks | ✅ |
| Claude Desktop app | MCP server - desktop can't run hooks | ✅ |
| Claude Cowork | same MCP server | ✅ |
Where a surface can't take hooks, it falls back to MCP rather than documenting the limitation and leaving you to solve it.
The design argument in one line: an MCP server's tool schemas load into your context before you type a word, every session. A hook costs nothing until it fires.
| Hooks (Claude Code) | MCP (desktop app) | |
|---|---|---|
| Context cost while idle | zero | tool schemas, every session |
| Fires on | only past-shaped prompts | whenever Claude decides |
| Records what you did | ✅ | ✗ |
| Survives compaction | ✅ writes to disk first | ✗ |
What runs, and when
| When | What happens | Cost |
|---|---|---|
| You open a session | Prints the threads still open from the last few days | ~600 tokens, once |
| You ask about the past | Looks it up locally, hands the answer to Claude | ~300 tokens, only those prompts |
| Claude edits or runs something | Logs one line of what actually happened | a file append |
| Compaction starts | Writes the decisions to disk first | ~600 tokens |
🧳 Switching accounts or machines
New Claude account? New laptop? Your history stays behind and Claude forgets you.
claude-rework export memory.zip # old account
pip install claude-rework && claude-rework install
claude-rework import memory.zip # new account, new machine, any OS
Everything comes with you, automatically:
| Carried across | What that means |
|---|---|
| Your whole search index | every message and conclusion already extracted |
| Every project | slug, real path on disk, how much history each has |
| Project context | each project's CLAUDE.md, AGENTS.md, memory notes |
| The activity log | what was actually edited and run |
| Who you are | a who-i-am profile, so the new account knows you on day one |
| Raw transcripts | only with --with-transcripts - large, exact |
Never carried: settings.json, hooks, credentials, API keys, OAuth tokens.
It's your content, not your configuration - so a bundle can't leak a secret it
never contained.
Import is a merge, never a replace. Import the same bundle twice and nothing changes. Import a colleague's and it adds to yours. A note you already wrote is never overwritten.
claude-rework inspect memory.zip # look before you import
claude-rework profile # what Claude knows about you
How it compares
Against other memory & token skills
Every one of these was installed on the machine this was built on. Counts come from the filesystem, not from memory.
| Files | Code | Tests | Searches your history | Runs itself | Offline | |
|---|---|---|---|---|---|---|
context-budget |
1 | 0 | 0 | ✗ | ✗ | n/a |
token-budget-advisor |
1 | 0 | 0 | ✗ | ✗ | n/a |
rescue-tokens |
2 | 0 | 0 | ✗ | ✗ | n/a |
token-optimization |
8 | 1 | 2 | ✗ | ✗ | n/a |
long-context-lost-in-the-middle |
1 | 0 | 0 | ✗ | ✗ | n/a |
mem-search |
1 | 0 | 0 | ✗ | ✗ | n/a |
smart-explore |
1 | 0 | 0 | ✗ | ✗ | n/a |
timeline-report |
1 | 0 | 0 | ✗ | ✗ | n/a |
mempalace |
1 | 0 | 0 | ✗ | ✗ | n/a |
claude-mem (plugin) |
- | 7 | 0 | ✅ via MCP | ✅ via MCP | ✗ |
| claude-rework | 34 | 17 | 9 suites, 400+ cases | ✅ | ✅ hooks + MCP | ✅ |
Most of that list is advice - well-written documents telling Claude to be
careful with context. A document cannot search 7 GB of transcripts or tell you
whether it worked. claude-mem is the one genuinely comparable project, and it
takes the MCP-only bet.
This is not a claim those skills are bad. Several taught me things, and
claude-rework absorbs what each did well: --budget-report is what
context-budget did, --estimate is token-budget-advisor, --timeline is
timeline-report. The argument is narrower - one tested program beats nine
overlapping documents, because loading several memory skills at once is precisely
the waste each of them warns about.
Against the obvious alternatives
| grep | RAG service | /compact |
CLAUDE.md | claude-rework | |
|---|---|---|---|---|---|
| Finds a decision from 3 months ago | yes, unaffordably | yes | no, it's gone | only what you typed | yes |
| Cost per answer | ~211k tokens | API calls | free but lossy | in context always | ~2.5k tokens |
| Your data leaves the machine | no | yes | no | no | no |
| Needs a key or account | no | yes | no | no | no |
| Runs without you asking | no | no | n/a | n/a | yes |
| Survives an account switch | n/a | yes | no | manual copy | yes, one command |
| Tells you when it's wrong | no | rarely | n/a | n/a | yes, refuses stale indexes |
| Works on a plane | yes | no | yes | yes | yes |
Why it works
Four ideas. Each measured before it was kept.
1. Extract once, search forever. Raw transcripts are 7.4 GB of JSON, mostly tool output. What answers a question is what people typed, plus the minority of Claude's replies that state a conclusion. Pulled out once: 7.7 MB. Same answers, 158s → 0.33s.
2. Rank across stores, not one at a time. Notes, skills, an optional code graph and your transcripts are searched in one pass and ranked together. Searching notes first and stopping sounds principled and scored worse - a weak note from an unrelated project displaces the line holding the answer. Store priority is a weight, not an order.
3. Score density, not word count. A 6,000-character note matching two filler words used to beat the 600-character chunk holding the answer. Dividing by the square root of length took accuracy from 42% → 75% on its own.
4. Semantic search that admits, but doesn't decide. "Why was the router broken" is answered by "bash ate the backslashes in the interpreter path" - which shares no words with the question. Static embeddings close that gap for a one-time 36 MB download, no GPU, no API. A chunk can enter the running without a shared word, but it still has to win on the combined score.
Proof
Nine suites, each with a floor. The run fails if any drops below it.
| Suite | Result | What it proves |
|---|---|---|
| known-item | 300/300 | retrieval on questions generated from your corpus, gold term held out |
| curated | 12/12 | hand-written cases, zero silent fallbacks |
| stress | 19/19 | empty input, CJK, RTL, shell metacharacters, a 3,000-char word |
| subcommands | 11/11 | every command runs clean |
| capture | 33/33 | the hook records work, drops noise, redacts secrets |
| vectors | 6/6 | a stale or misaligned index is refused, never guessed at |
| federation | 28/28 | hostile input rejected without crashing |
| concurrency | 5/5 | three builds at once → zero duplicates, no lock left behind |
| hooks | 13/13 | all four hooks under Claude Code's real calling convention |
| foreign machines | 4/4 at 100% | tiny, huge, non-English and sparse corpora |
| optimizer | 100/100 | no file lost, no action below the evidence threshold |
claude-rework test
CI runs a clean-room install on Ubuntu, Windows and macOS × Python 3.10 and
3.12 on every push - a machine that has never seen this, synthetic transcripts,
the optional binary stripped from PATH, install → use → uninstall.
The known-item suite is generated from your own data, not written by hand. It samples a chunk, builds a question from that chunk's own words, holds back the most distinctive word so nothing passes by exact match, and demands the chunk back. Twelve cases I wrote by hand scored 100% while sixty generated ones scored 76.7%. The gap was me overfitting to my own imagination - and I only saw it because the generated set existed.
Keeping it working
claude-rework status # what's connected, what's indexed
claude-rework doctor # check every connection; say what's wrong
claude-rework repair # fix what doctor found
claude-rework update # newest version, reconnected
claude-rework uninstall # remove everything; keep your memory
doctor catches the failures that are otherwise silent: a hook pointing at a
Python that no longer exists, a backslash in a hook path (bash eats them - that
one cost hours), an MCP entry orphaned by a moved interpreter, an index that was
never built. repair fixes all of them.
Commands, if you want them - you shouldn't need these
claude-rework "<question>" # ask your history
claude-rework "<q>" --this-project # only this project
claude-rework --brief --days 2 # asked / done / still open
claude-rework --handoff # what must survive a compact
claude-rework --decisions --days 30 # a decision ledger
claude-rework --timeline --days 7 # by day, across projects
claude-rework --write "<fact>" --name <slug> --type project|user|feedback|reference
claude-rework --budget-report # what a session costs before you type
claude-rework --estimate "@file.md" # input tokens and likely response size
claude-rework --gc # stale/duplicate notes (never deletes)
claude-rework --optimize [--apply] # promote/demote skills from measured usage
--budget-report found four image-generation skills on my machine costing ~950
tokens every session for something used monthly. Moving them to a library tier
cut fixed session cost by 27%, and they stayed one search away.
Privacy
Nothing leaves your machine. No telemetry, no account, no server.
The only networked feature is opt-in parameter sharing, and it sends about twenty integers:
{"schema": 1, "machine": "9f2c4a1b77de",
"params": {"sem_weight": 12, "first_div": 2, "taper": 6},
"scores": {"known_item": 0.99, "curated": 1.0},
"corpus": {"chunks": 13074, "vocab": 84210}}
No prompts, answers, paths, project names or note text. The machine id is a random local salt, not a hostname.
--exportwrites a file and stops. Nothing uploads on a schedule.- A pulled card is untrusted input. Every field is range-checked, the whole card is rejected on any bad field, and a hostile card can't crash the import.
- Only integers are adopted. It cannot fetch or run code. Code travels the ordinary way - a pull request a human reads - because auto-executing code pulled from strangers is a supply-chain compromise wearing a helpful hat.
Secrets never reach the activity log. Commands are scrubbed before writing.
That scrubber had a real bug, found by the test suite here:
Authorization:\s*\S+ eats one token after the colon, and in
Authorization: Bearer <token> that token is the word "Bearer" - so the
credential went to disk in the clear. It now takes the scheme and the value,
with a test per credential shape.
Requirements
- Python 3.9+ and Claude. That's the hard requirement.
numpy+model2vecinstall automatically for semantic ranking. If that can't happen (offline, locked-down machine), it falls back to lexical scoring and still works - the install never fails over an optional extra.- graphify is not required. If a project happens to have a code graph, it's
used as one more store; if not, that store is skipped. Tested, not asserted:
the suite runs with graphify absent from
PATH, then again with a graph directory present but no binary, and both must come back clean. - Windows, macOS, Linux - all three in CI.
Honest limitations
- Only as good as your transcripts. A fresh Claude install has nothing to remember, and it says so rather than inventing something.
--briefis a heuristic. It decides a request is "done" by checking whether a later message reads like a conclusion about the same thing. Usually right, and it says out loud that it's guessing.- The auto-recall hook fires on phrasing, not understanding. Ask about the past in an unusual way and it stays silent; the tool is still one question away.
- Parameter sharing has never met a second real machine. The validator is tested against 28 hostile cards. Two installs converging is unproven.
- Every threshold was fitted on one person's corpus. That's why
simulate.pybuilds synthetic machines with alien vocabularies. It found a real bug on its first honest run: an IDF floor of0.3let a word appearing in every record still score - invisible on a diverse corpus, ruinous on a small one. Four synthetic machines went from 44/64/88/92% → 100%.
Contributing
Issues and PRs welcome. The bar is simple: a change that can't hold the test floors is the thing that's wrong. Floors only ratchet up.
git clone https://github.com/Luneswan/claude-rework && cd claude-rework
python tests/clean_room_test.py # the real test: install into a fresh machine
CONTRIBUTING.md · SECURITY.md · CHANGELOG.md
If this saved you tokens, ⭐ star it - it's the only signal that tells me whether to keep building.
MIT · Built because Claude kept asking me things I'd already answered.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_rework-1.3.0.tar.gz.
File metadata
- Download URL: claude_rework-1.3.0.tar.gz
- Upload date:
- Size: 105.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a0a0a8c3b8a4d627878c008cb5cb37692f8517bf5b5350e61a8a36c987317f8
|
|
| MD5 |
484371976b20a26cc16fe18605fd61c8
|
|
| BLAKE2b-256 |
fe073e3af5d50d02b3926eb85fbcfd3259ece0767618649787f1a2e614bf8ebe
|
Provenance
The following attestation bundles were made for claude_rework-1.3.0.tar.gz:
Publisher:
publish.yml on Luneswan/claude-rework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_rework-1.3.0.tar.gz -
Subject digest:
5a0a0a8c3b8a4d627878c008cb5cb37692f8517bf5b5350e61a8a36c987317f8 - Sigstore transparency entry: 2686937259
- Sigstore integration time:
-
Permalink:
Luneswan/claude-rework@3dac11bb0bb09d75f8bc4a878ed8408331f459d6 -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/Luneswan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3dac11bb0bb09d75f8bc4a878ed8408331f459d6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file claude_rework-1.3.0-py3-none-any.whl.
File metadata
- Download URL: claude_rework-1.3.0-py3-none-any.whl
- Upload date:
- Size: 116.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eeef30aebb05c5a645644049151007e751da2548f4c2576049abd769daa5f65e
|
|
| MD5 |
bb8af9c8d2e1b430014f0fd407464673
|
|
| BLAKE2b-256 |
8485b7bf7f96d0ef76945ad656fcec228e473b526e361d04abe15f27c9662bc8
|
Provenance
The following attestation bundles were made for claude_rework-1.3.0-py3-none-any.whl:
Publisher:
publish.yml on Luneswan/claude-rework
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_rework-1.3.0-py3-none-any.whl -
Subject digest:
eeef30aebb05c5a645644049151007e751da2548f4c2576049abd769daa5f65e - Sigstore transparency entry: 2686937280
- Sigstore integration time:
-
Permalink:
Luneswan/claude-rework@3dac11bb0bb09d75f8bc4a878ed8408331f459d6 -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/Luneswan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3dac11bb0bb09d75f8bc4a878ed8408331f459d6 -
Trigger Event:
release
-
Statement type: