cc-dejavu 0.2.0 → 0.3.0
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 +15 -11
- package/package.json +14 -19
package/README.md
CHANGED
|
@@ -36,19 +36,19 @@ Every bash command Claude Code runs is logged in session files. `deja` indexes t
|
|
|
36
36
|
|
|
37
37
|
## Features
|
|
38
38
|
|
|
39
|
-
- **
|
|
39
|
+
- **Smart ranking** - Combines BM25 relevance with frecency (frequency + recency) so the most useful commands appear first
|
|
40
|
+
- **Full-text search** - Uses SQLite FTS5 for fast, typo-tolerant searching
|
|
40
41
|
- **Match highlighting** - Search patterns are highlighted in yellow in the output
|
|
41
42
|
- **Automatic sync** - History is automatically synced before each search
|
|
42
43
|
|
|
43
44
|
## Install
|
|
44
45
|
|
|
46
|
+
Requires [Bun](https://bun.sh).
|
|
47
|
+
|
|
45
48
|
```bash
|
|
46
|
-
#
|
|
49
|
+
# Install globally
|
|
47
50
|
bun add -g cc-dejavu
|
|
48
51
|
|
|
49
|
-
# With npm
|
|
50
|
-
npm install -g cc-dejavu
|
|
51
|
-
|
|
52
52
|
# Or build from source
|
|
53
53
|
git clone https://github.com/Michaelliv/cc-dejavu
|
|
54
54
|
cd cc-dejavu
|
|
@@ -146,16 +146,20 @@ Index new commands from Claude Code sessions.
|
|
|
146
146
|
|------|-------------|
|
|
147
147
|
| `--force`, `-f` | Re-index all sessions from scratch |
|
|
148
148
|
|
|
149
|
-
##
|
|
149
|
+
## Ranking Algorithm
|
|
150
|
+
|
|
151
|
+
Results are ranked by combining **BM25 relevance** with **frecency** (frequency + recency):
|
|
150
152
|
|
|
151
|
-
|
|
153
|
+
```
|
|
154
|
+
score = frecency × (0.5 + normalized_bm25)
|
|
155
|
+
```
|
|
152
156
|
|
|
153
|
-
- **
|
|
154
|
-
- **
|
|
157
|
+
- **BM25**: Search terms that are more prominent in a command score higher. "build" in `bun run build` ranks higher than "build" buried in a long command.
|
|
158
|
+
- **Frecency**: Commands you run often and recently score higher. Uses logarithmic scaling for frequency and time-decay weights for recency.
|
|
155
159
|
|
|
156
|
-
This means
|
|
160
|
+
This means a command that closely matches your search AND you use frequently will appear at the top.
|
|
157
161
|
|
|
158
|
-
Use `--sort time` to revert to simple timestamp ordering.
|
|
162
|
+
Use `--sort time` to revert to simple timestamp ordering (ignores BM25 and frecency).
|
|
159
163
|
|
|
160
164
|
## How It Works
|
|
161
165
|
|
package/package.json
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cc-dejavu",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"type": "module",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"author": "Michaelliv",
|
|
7
5
|
"repository": {
|
|
8
6
|
"type": "git",
|
|
9
7
|
"url": "git+https://github.com/Michaelliv/cc-dejavu.git"
|
|
10
8
|
},
|
|
9
|
+
"devDependencies": {
|
|
10
|
+
"@types/bun": "latest"
|
|
11
|
+
},
|
|
12
|
+
"bin": {
|
|
13
|
+
"deja": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"description": "CLI tool to search and browse Claude Code bash command history",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
11
19
|
"keywords": [
|
|
12
20
|
"claude",
|
|
13
21
|
"claude-code",
|
|
@@ -17,25 +25,12 @@
|
|
|
17
25
|
"search",
|
|
18
26
|
"dejavu"
|
|
19
27
|
],
|
|
20
|
-
"
|
|
21
|
-
"bin": {
|
|
22
|
-
"deja": "./dist/index.js"
|
|
23
|
-
},
|
|
24
|
-
"files": [
|
|
25
|
-
"dist"
|
|
26
|
-
],
|
|
28
|
+
"license": "MIT",
|
|
27
29
|
"scripts": {
|
|
28
30
|
"dev": "bun run src/index.ts",
|
|
29
31
|
"build": "bun build --compile --outfile=deja ./src/index.ts",
|
|
30
|
-
"build:npm": "bun build ./src/index.ts --outdir ./dist --target node",
|
|
31
32
|
"test": "bun test",
|
|
32
|
-
"prepublishOnly": "bun run build:npm",
|
|
33
33
|
"postinstall": "echo '\n Run \"deja onboard\" to add deja to ~/.claude/CLAUDE.md\n'"
|
|
34
34
|
},
|
|
35
|
-
"
|
|
36
|
-
"sql.js": "^1.13.0"
|
|
37
|
-
},
|
|
38
|
-
"devDependencies": {
|
|
39
|
-
"@types/bun": "latest"
|
|
40
|
-
}
|
|
35
|
+
"type": "module"
|
|
41
36
|
}
|