@delt/claude-jev-advisor 0.3.0 β 0.4.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 +27 -13
- package/dist/cli.js +298 -124
- package/dist/context-hook.js +30 -17
- package/dist/rm-hook.js +2 -0
- package/dist/statusline.js +28 -15
- package/mod/.claude-plugin/plugin.json +2 -2
- package/mod/hooks/register.js +138 -16
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ Not affiliated with Anthropic or TypeSafe.
|
|
|
17
17
|
## Requirements
|
|
18
18
|
|
|
19
19
|
- Node.js 18 or later
|
|
20
|
-
- Claude Code (the bottom-row display
|
|
20
|
+
- Claude Code (the bottom-row display and the advice button use Claude Code mods, an early-access feature that may change between releases)
|
|
21
21
|
- A TypeSafe API key for the `context` helper and for the Jev check of the `rm` helper, in `TYPESAFE_API_KEY` or in a key file (`--key-file`). Without a key, `rm` asks about every real file.
|
|
22
22
|
- Windows for the `rm` helper. On other systems `install` skips it and says why. It reads PowerShell commands with Windows PowerShell, which comes with Windows, or with PowerShell 7 when `pwsh` is on `PATH`, the same one Claude Code uses. It was checked with Windows PowerShell 5.1; PowerShell 7 was not tested.
|
|
23
23
|
|
|
@@ -35,11 +35,13 @@ claude-jev-advisor install
|
|
|
35
35
|
|
|
36
36
|
When the context helper is installed and no key is found, `install` asks for your TypeSafe API key. What you type is hidden. It checks the key with one small Jev call and saves it to `~/.claude/claude-jev-advisor/jev-key.env`. Press Enter to skip; `claude-jev-advisor key` asks again later. Instead of typing it, you can set `TYPESAFE_API_KEY`, or pass `--key-file <path>` to a file holding a line `TYPESAFE_API_KEY=...` (then only that path is saved). The key is never printed or logged. On Windows that file is protected by your user folder's permissions only.
|
|
37
37
|
|
|
38
|
-
Before it changes `~/.claude/settings.json`, `install` copies it to `~/.claude/backups/settings.json.<YYYY-MM-DD-HHmmss>-before-claude-jev-advisor`. If a backup from the same second already exists, it adds `-2`, `-3` and so on instead of overwriting it. It then adds or replaces only this package's entries. Running it again with the same version changes nothing.
|
|
38
|
+
Before it changes `~/.claude/settings.json`, `install` copies it to `~/.claude/backups/settings.json.<YYYY-MM-DD-HHmmss>-before-claude-jev-advisor`. If a backup from the same second already exists, it adds `-2`, `-3` and so on instead of overwriting it. It then adds or replaces only this package's entries. Running it again with the same version changes nothing. With the mod display it also binds `ctrl+x ctrl+f` in `~/.claude/keybindings.json` (see the context helper below), backing that file up the same way first.
|
|
39
39
|
|
|
40
40
|
After upgrading from 0.2 or earlier, run `claude-jev-advisor install rm` again so that the rm hook also covers the PowerShell tool. Until you do, `status` shows `Bash only`.
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
After upgrading from 0.3 or earlier, run `claude-jev-advisor install context` again so that it binds `ctrl+x ctrl+f` for the advice button. Until you do, `status` shows `shortcut: none - run "claude-jev-advisor install context" ...`.
|
|
43
|
+
|
|
44
|
+
The hooks also reach Claude Code sessions that are already open. The bottom-row display and the advice button start with the next new session; sessions that already show the bottom-row display pick up an upgrade by themselves. Turning a helper on or off applies at once, even to open sessions.
|
|
43
45
|
|
|
44
46
|
## Commands
|
|
45
47
|
|
|
@@ -48,7 +50,7 @@ The hooks also reach Claude Code sessions that are already open; the bottom-row
|
|
|
48
50
|
| `claude-jev-advisor install [rm] [context] [--lang ko\|en] [--key-file <path>] [--display mod\|statusline\|message]` | Registers the hooks (backs up `settings.json` first) and switches the helpers on |
|
|
49
51
|
| `claude-jev-advisor uninstall [rm] [context]` | Removes this package's hooks and display from `settings.json` |
|
|
50
52
|
| `claude-jev-advisor on [rm] [context]` / `off [rm] [context]` | Switches helpers on or off without touching `settings.json` |
|
|
51
|
-
| `claude-jev-advisor status` | Shows what is registered and on, the display, whether a key is set, the thresholds and the last judgment |
|
|
53
|
+
| `claude-jev-advisor status` | Shows what is registered and on, the display, the shortcut, whether a key is set, the thresholds and the last judgment |
|
|
52
54
|
| `claude-jev-advisor report [--days 7]` | Lists the `/compact` and `/clear` advice shown and what followed it, and the deletions Jev let through |
|
|
53
55
|
| `claude-jev-advisor key` | Asks for the TypeSafe API key, checks it and saves it (needs an interactive terminal) |
|
|
54
56
|
| `claude-jev-advisor help` | Prints the usage |
|
|
@@ -64,13 +66,22 @@ When a turn ends, a `Stop` hook reads the size of the conversation from the sess
|
|
|
64
66
|
|
|
65
67
|
The answer is saved for the display. Nothing is added to what Claude sees, so it costs no Claude tokens. If Jev does not answer within 8 seconds, only the size is shown. While a subagent or a workflow runs in the background, the turn counts as work in progress and Jev is not asked; background shells and monitors do not count.
|
|
66
68
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
|
70
|
-
|
|
71
|
-
|
|
|
72
|
-
| Work
|
|
73
|
-
|
|
|
69
|
+
With the mod display (the default):
|
|
70
|
+
|
|
71
|
+
| Situation | Bottom row | Above the prompt |
|
|
72
|
+
|---|---|---|
|
|
73
|
+
| Under 250k, or no judgment (no key, Jev unreachable) | `52k +12k` | |
|
|
74
|
+
| Work in progress | `π’ 312k +38k` | |
|
|
75
|
+
| A whole stage closed (from 250k) | `312k +38k` | `π‘ μλ‘κ² μμνλ 건 μ΄λ μΈμ?` and a `/clear` button |
|
|
76
|
+
| Work finished, stage goes on (from 250k) | `312k +38k` | `π‘ μ§κΈκΉμ§ μ 리νκ³ μ΄μ΄κ°λ 건 μ΄λ μΈμ?` and a `/compact` button |
|
|
77
|
+
| Within 20% of auto-compact, with one of the two above | `790k +38k` | `π΄ 18%`, the advice and its button |
|
|
78
|
+
| Within 20% of auto-compact otherwise | `π΄ 790k +38k 18%`, then ` Β· μμ
μ΄ λλλ©΄ μ 리νκ³ μ΄μ΄κ°λ 건 μ΄λ μΈμ? /compact` while the work is still going | |
|
|
79
|
+
|
|
80
|
+
`+38k` is how much the conversation grew in the last request, counted from when it was sent. It is left out when the conversation did not grow, for example after a `/compact`. The `statusline` and `message` displays show the whole advice on one line instead, without the increase: `π‘ 312k μλ‘κ² μμνλ 건 μ΄λ μΈμ? /clear` and so on.
|
|
81
|
+
|
|
82
|
+
The button runs `/compact` or `/clear` at once; a `/clear` can be undone with `/resume`. Click it, press `ctrl+x ctrl+f`, or press `ctrl+x tab` and then Enter. It is not drawn while a request runs or while Claude Code waits for your answer to a question, and once pressed it stays away until Jev judges a newer reply. A refused `/compact` (too few messages, for example) shows the reason in a toast.
|
|
83
|
+
|
|
84
|
+
`install` writes the shortcut to `~/.claude/keybindings.json` as `"ctrl+x ctrl+f": "diff:back"` in the `DiffDialog` block. Claude Code lets a mod's button take the key of one of its own actions while that action is not in use; `diff:back` has no key of its own and works only inside the diff dialog, where `ctrl+x ctrl+f` keeps doing that. If `ctrl+x ctrl+f` is already bound in your file, or the file cannot be read, `install` leaves the file alone and says so, and the button is pressed with a click or `ctrl+x tab`. Both keys are pressed with `ctrl` on purpose: with a Korean or other input method on, a plain letter after `ctrl+x` arrives as another character and the chord would not match. `uninstall context` and switching to another display take the line out again if it is still ours. To keep `install` from binding it, set `"ctrl+x ctrl+f": null` in any block of that file.
|
|
74
85
|
|
|
75
86
|
With `--lang en` the advice reads `Start fresh? /clear`, `Wrap up what you have and continue? /compact` and `When this work is done, wrap up and continue? /compact`.
|
|
76
87
|
|
|
@@ -78,7 +89,7 @@ Judging starts at 250k because a conversation passes 100k after a request or two
|
|
|
78
89
|
|
|
79
90
|
| `--display` | Where |
|
|
80
91
|
|---|---|
|
|
81
|
-
| `mod` (default) | At the end of the bottom row, after `β΅β΅ β¦ mode on
|
|
92
|
+
| `mod` (default) | At the end of the bottom row, after `β΅β΅ β¦ mode on`, and advice that can be acted on in a band above the prompt with a button. A small Claude Code mod in the package's `mod/` folder draws both. The mod is listed in `env.CLAUDE_CODE_PLUGIN_DIRS` and told the data folder through `pluginConfigs`. |
|
|
82
93
|
| `statusline` | Claude Code's status line, the row above the bottom row. An existing status line of yours keeps running first, with our text after it, and is put back when you switch away or uninstall. On Windows that command runs in Git Bash when it is installed and in PowerShell otherwise, as Claude Code runs it; it gets 2 seconds. No red zone, because the auto-compact threshold is not known there. |
|
|
83
94
|
| `message` | A `Stop says: β¦` line in the transcript when there is advice. Claude does not see it. No red zone. |
|
|
84
95
|
|
|
@@ -169,6 +180,8 @@ A key saved by `install` or `key` stays in `~/.claude/claude-jev-advisor/jev-key
|
|
|
169
180
|
| `~/.claude/claude-jev-advisor/statusline-before.json` | Your own status line while `--display statusline` is in use |
|
|
170
181
|
| `~/.claude/claude-jev-advisor/jev-key.env` | Your TypeSafe API key, when you typed it in `install` or `key` |
|
|
171
182
|
| `~/.claude/backups/settings.json.*-before-claude-jev-advisor` | Copies of `settings.json` from before each change |
|
|
183
|
+
| `~/.claude/keybindings.json` | The `ctrl+x ctrl+f` line, with the `mod` display |
|
|
184
|
+
| `~/.claude/backups/keybindings.json.*-before-claude-jev-advisor` | Copies of `keybindings.json` from before each change |
|
|
172
185
|
|
|
173
186
|
Defaults:
|
|
174
187
|
|
|
@@ -177,12 +190,13 @@ Defaults:
|
|
|
177
190
|
"lang": "ko",
|
|
178
191
|
"keyFile": null,
|
|
179
192
|
"display": "mod",
|
|
193
|
+
"shortcut": null,
|
|
180
194
|
"context": { "enabled": true, "minTokens": 250000, "compactMinTokens": 250000, "redRemainingPct": 20, "unitDoneYes": 0.6, "phaseDoneYes": 0.6 },
|
|
181
195
|
"rm": { "enabled": true, "jev": true, "throwawayYes": 0.8, "maxDirFiles": 50 }
|
|
182
196
|
}
|
|
183
197
|
```
|
|
184
198
|
|
|
185
|
-
`minTokens` is where judging starts, `compactMinTokens` where `/compact` is suggested, `redRemainingPct` where the red zone starts, and `unitDoneYes` / `phaseDoneYes` are the Jev probabilities needed for "work finished" (`/compact`) and "stage closed" (`/clear`). For `rm`, `jev` switches the Jev check, `throwawayYes` is the probability needed to lift an ask, and `maxDirFiles` the most files a folder of this session may hold.
|
|
199
|
+
`minTokens` is where judging starts, `compactMinTokens` where `/compact` is suggested, `redRemainingPct` where the red zone starts, and `unitDoneYes` / `phaseDoneYes` are the Jev probabilities needed for "work finished" (`/compact`) and "stage closed" (`/clear`). For `rm`, `jev` switches the Jev check, `throwawayYes` is the probability needed to lift an ask, and `maxDirFiles` the most files a folder of this session may hold. `shortcut` is set by `install`: the key it bound, or `null` when it bound none.
|
|
186
200
|
|
|
187
201
|
`config.json` keeps only the values you changed, with `"version": 2`. A config written by 0.1.x, which saved every value, has its old default thresholds (`minTokens` 100000, `compactMinTokens` 200000, `unitDoneYes` 0.7) read as unset, so the new defaults apply.
|
|
188
202
|
|