@tokmizer/plugin 1.0.2 → 1.1.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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/README.md +36 -36
- package/command-templates/tkr-status.md +1 -1
- package/dist/bin/tkr-codex-hook.js +53 -53
- package/dist/bin/tkr-context-hook.js +1 -1
- package/dist/bin/tkr-daemon.js +135 -135
- package/dist/bin/tkr-exec +11 -11
- package/dist/bin/tkr-exec.js +11 -11
- package/dist/bin/tkr-processor.js +14 -14
- package/dist/bin/tkr-shim.js +12 -12
- package/dist/bin/tkr.js +216 -216
- package/dist/hooks-host/post-tool-use.js +9 -9
- package/dist/hooks-host/reducer-prompt-submit.js +1 -1
- package/dist/hooks-host/reducer-session-start.js +1 -1
- package/dist/hooks-host/reducer-stop.js +25 -25
- package/dist/hooks-host/session-recap.js +2 -2
- package/dist/index.js +94 -94
- package/dist/native/manifest.json +12 -12
- package/dist/native/single.json +12 -12
- package/dist/native/tkr-exec-darwin-arm64 +0 -0
- package/dist/native/tkr-exec-darwin-x64 +0 -0
- package/dist/native/tkr-exec-linux-arm64 +0 -0
- package/dist/native/tkr-exec-linux-x64 +0 -0
- package/dist/native/tkr-exec-win32-arm64.exe +0 -0
- package/dist/native/tkr-exec-win32-x64.exe +0 -0
- package/hooks/on-session-start.mjs +1 -1
- package/package.json +8 -8
- package/scripts/README-INSTALL.md +1 -1
- package/scripts/install-mac-linux.sh +2 -2
- package/scripts/install-windows.ps1 +4 -3
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Free · no account · Claude Code, Codex, Cursor, Gemini CLI, Copilot and 16 mor
|
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/@tokmizer/plugin)
|
|
10
10
|
[](https://github.com/norwelltw/Tokmizer/blob/main/packages/plugin/LICENSES.md)
|
|
11
|
-
[](https://nodejs.org)
|
|
12
12
|
|
|
13
13
|
[Website](https://tokmizer.com) · [Docs](https://tokmizer.com/en/docs) · [Benchmark vs rtk](https://tokmizer.com/en/compare/rtk) · [CI](https://tokmizer.com/en/ci)
|
|
14
14
|
|
|
@@ -77,7 +77,7 @@ curl -fsSL https://tokmizer.com/install.sh | bash
|
|
|
77
77
|
tkr setup --all
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
The script uses npm when Node.js
|
|
80
|
+
The script uses npm when a patched Node.js (24.22.1+, or 22.23.4+) is installed, and otherwise downloads a standalone build for macOS or Linux after checking its signature and SHA-256. Your shell profile is not touched.
|
|
81
81
|
|
|
82
82
|
<table>
|
|
83
83
|
<tr><td><b>npm</b></td><td>
|
|
@@ -190,9 +190,9 @@ Agents check their allow, ask and deny rules against the command text. Tokmizer
|
|
|
190
190
|
|
|
191
191
|
| Mode | What Tokmizer does |
|
|
192
192
|
| --- | --- |
|
|
193
|
-
| Default | Build and test commands (`npm test`, `cargo test`, `pytest`, `./gradlew build`…) are shortened before they run; Claude Code asks for them once, as it would anyway. Read-only commands (`ls`, `cat`, `git status`) run as typed, so Claude Code still approves them on its own, and their output is shortened once they succeed.
|
|
194
|
-
| Default, with a narrow allow rule of yours
|
|
195
|
-
| `bypassPermissions`, or a plain `Bash` allow rule |
|
|
193
|
+
| Default | Build and test commands (`npm test`, `cargo test`, `pytest`, `./gradlew build`…) are shortened before they run; Claude Code asks for them once, as it would anyway. Read-only commands (`ls`, `cat`, `git status`) run as typed, so Claude Code still approves them on its own, and their output is shortened once they succeed. |
|
|
194
|
+
| Default, with a narrow allow rule of yours such as `Bash(pytest:*)` | A single command it covers is rewritten too, with no new prompt. |
|
|
195
|
+
| `bypassPermissions`, or a plain `Bash` allow rule | Every routed command is rewritten, and failing output is shortened too. |
|
|
196
196
|
|
|
197
197
|
Your deny and ask rules, `--disallowedTools`, `--settings`, managed policies and the claude.ai console rules always win. In a linked git worktree, commands that mention git run as typed so Claude Code's worktree check never refuses them.
|
|
198
198
|
|
|
@@ -210,11 +210,11 @@ Your deny and ask rules, `--disallowedTools`, `--settings`, managed policies and
|
|
|
210
210
|
| `/power` | `$power` in Codex, `/power` in most agents | plan, build, test and ship a change in one go |
|
|
211
211
|
| `/tkr` | `tkr settings show\|set\|configure` | every setting |
|
|
212
212
|
| `/tkr-telemetry` | `tkr telemetry on\|off\|status` | usage stats |
|
|
213
|
-
| `/tkr-link` | `tkr link <key>` | optional account: synced settings and a dashboard |
|
|
213
|
+
| `/tkr-link` | `tkr link <key>` | optional account: synced settings and a dashboard, up to 15 devices at once |
|
|
214
214
|
| `/tkr-unlink` | `tkr unlink` | detach this machine from the account |
|
|
215
215
|
| `/tkr-update` | npm, brew or auto-update | latest version |
|
|
216
216
|
|
|
217
|
-
Also in the terminal: `tkr restore`, `tkr doctor [--fix]`, `tkr discover`, `tkr session`, `tkr network`, `tkr filters`, `tkr migrate rtk`, `tkr setup`, `tkr uninstall`. `tkr
|
|
217
|
+
Also in the terminal: `tkr restore`, `tkr doctor [--fix]`, `tkr discover`, `tkr session`, `tkr network`, `tkr filters`, `tkr migrate rtk`, `tkr setup`, `tkr uninstall`. `tkr help` lists everything.
|
|
218
218
|
|
|
219
219
|
## Compression modes
|
|
220
220
|
|
|
@@ -235,12 +235,12 @@ The **reducer** is separate: from the next session it asks the model to answer i
|
|
|
235
235
|
```bash
|
|
236
236
|
tkr restore <hash> # the whole original output
|
|
237
237
|
tkr restore <hash> --lines 120:180 # only some lines
|
|
238
|
-
tkr restore <hash> --grep
|
|
239
|
-
tkr restore --grep
|
|
238
|
+
tkr restore <hash> --grep timeout # matching lines with their numbers
|
|
239
|
+
tkr restore --grep timeout # search every cached output of this project
|
|
240
240
|
tkr restore --list # what is cached here; --all-projects for every project
|
|
241
241
|
```
|
|
242
242
|
|
|
243
|
-
Copies stay on your machine
|
|
243
|
+
Copies stay on your machine for 30 days, up to 8 MB each and 200 MB in total. Private keys, GitHub, npm, AWS, Slack and Stripe tokens, `Bearer` headers and passwords in URLs are masked before a copy is saved; what the agent sees is unchanged. `TOKMIZER_CCR_DISABLED=1` turns copies off.
|
|
244
244
|
|
|
245
245
|
## Measuring your own savings
|
|
246
246
|
|
|
@@ -263,28 +263,28 @@ Each view also takes `--project` and `--json`. `tkr gain` estimates command-outp
|
|
|
263
263
|
|
|
264
264
|
| Agent | `/power` | Reducer |
|
|
265
265
|
| --- | --- | --- |
|
|
266
|
-
| Claude Code |
|
|
267
|
-
| Codex | skill `~/.agents/skills/power`, type `$power <request>` |
|
|
268
|
-
| Gemini CLI |
|
|
269
|
-
| Cursor | skill `/power
|
|
270
|
-
| GitHub Copilot CLI | skill `/power
|
|
271
|
-
| Factory Droid | skill `/power
|
|
272
|
-
| Qwen Code |
|
|
273
|
-
| ZCode | skill `/power
|
|
274
|
-
| Trae |
|
|
275
|
-
| Antigravity | skill `/power
|
|
276
|
-
| Crush | skill `user:power
|
|
277
|
-
| Junie CLI |
|
|
278
|
-
| Grok Build | skill `/power
|
|
279
|
-
| Mistral Vibe | skill `/power
|
|
280
|
-
| OpenCode |
|
|
281
|
-
| Kilo Code |
|
|
282
|
-
| Amp | skill `power
|
|
283
|
-
| Pi |
|
|
284
|
-
| Oh My Pi |
|
|
285
|
-
| Hermes | skill `/power
|
|
286
|
-
| OpenClaw | skill `/power
|
|
287
|
-
| Cline, Windsurf
|
|
266
|
+
| Claude Code | `/power` command | SessionStart and UserPromptSubmit hooks |
|
|
267
|
+
| Codex | skill `~/.agents/skills/power`, type `$power <request>` | SessionStart and UserPromptSubmit hooks |
|
|
268
|
+
| Gemini CLI | `~/.gemini/commands/power.toml` | SessionStart and BeforeAgent hooks |
|
|
269
|
+
| Cursor | skill `/power`, `~/.agents/skills` | sessionStart hook |
|
|
270
|
+
| GitHub Copilot CLI | skill `/power`, `~/.agents/skills` | sessionStart hook |
|
|
271
|
+
| Factory Droid | skill `/power`, `~/.agents/skills` | SessionStart and UserPromptSubmit hooks |
|
|
272
|
+
| Qwen Code | `~/.qwen/commands/power.md` | SessionStart and UserPromptSubmit hooks |
|
|
273
|
+
| ZCode | skill `/power`, `~/.zcode/skills` | SessionStart and UserPromptSubmit hooks |
|
|
274
|
+
| Trae | no documented location | SessionStart and UserPromptSubmit hooks |
|
|
275
|
+
| Antigravity | skill `/power`, `~/.gemini/config/skills` | SessionStart hook |
|
|
276
|
+
| Crush | skill `user:power`, `~/.agents/skills` | managed block in `~/.config/crush/CRUSH.md` |
|
|
277
|
+
| Junie CLI | `~/.junie/commands/power.md` | managed block in `~/.junie/AGENTS.md` |
|
|
278
|
+
| Grok Build | skill `/power`, `~/.grok/skills` | managed block in `~/.grok/AGENTS.md` |
|
|
279
|
+
| Mistral Vibe | skill `/power`, `~/.vibe/skills` | managed block in `~/.vibe/AGENTS.md` |
|
|
280
|
+
| OpenCode | `~/.config/opencode/commands/power.md` | plugin, experimental system prompt hook |
|
|
281
|
+
| Kilo Code | `~/.config/kilo/commands/power.md` | plugin, experimental system prompt hook |
|
|
282
|
+
| Amp | skill `power`, `~/.agents/skills`; ask Amp to use it | managed block in `~/.config/amp/AGENTS.md` |
|
|
283
|
+
| Pi | `~/.pi/agent/prompts/power.md` | managed block in `~/.pi/agent/APPEND_SYSTEM.md` |
|
|
284
|
+
| Oh My Pi | `~/.omp/agent/commands/power.md` | managed block in `~/.omp/agent/APPEND_SYSTEM.md` |
|
|
285
|
+
| Hermes | skill `/power`, `~/.hermes/skills` | plugin, system prompt section |
|
|
286
|
+
| OpenClaw | skill `/power`, `~/.openclaw/skills` | plugin, once `plugins.entries.tokmizer.hooks.allowConversationAccess` is `true` |
|
|
287
|
+
| Aider, Cline, Windsurf | not installed | not installed |
|
|
288
288
|
|
|
289
289
|
</details>
|
|
290
290
|
|
|
@@ -355,8 +355,8 @@ tkr network off # stop every connection; compression keeps working with the
|
|
|
355
355
|
|
|
356
356
|
| When | What is sent | Why |
|
|
357
357
|
| --- | --- | --- |
|
|
358
|
-
| First online run | A random install ID,
|
|
359
|
-
| `tkr link <key>` | The same, plus your key, and your email only with `--email` | attach this machine to your account |
|
|
358
|
+
| First online run | A random install ID, its SHA-256 hash (the fingerprint), your time zone and the plugin version. Nothing that describes your machine: no computer name, OS, hardware or user name | create the install token used to download rules |
|
|
359
|
+
| `tkr link <key>` | The same, plus your key, and your email only with `--email` | attach this machine to your account (up to 15 connected at once) |
|
|
360
360
|
| Check-in (heartbeat) | Install ID, fingerprint, plugin version, local date and time zone; while usage stats are on, install health counts such as outdated shims, broken hooks and repairs | refresh access, announce new versions, spot broken installs |
|
|
361
361
|
| Rule downloads | Install ID, fingerprint, plugin version | latest rules, `/power` and reducer instructions |
|
|
362
362
|
| Settings sync, linked accounts only | Your Tokmizer settings | keep them in sync with the dashboard |
|
|
@@ -364,7 +364,7 @@ tkr network off # stop every connection; compression keeps working with the
|
|
|
364
364
|
| `tkr unlink` | Install ID, fingerprint | remove this device from your account |
|
|
365
365
|
| Self-update | `npm i -g @tokmizer/plugin@<version>` or `brew upgrade tokmizer` | keep the CLI current; `tkr auto-update off` stops it |
|
|
366
366
|
|
|
367
|
-
The
|
|
367
|
+
The install ID is drawn at random on first run and says nothing about your machine. Like any web server, `tokmizer.com` sees your IP address and keeps it in its security log. Usage stats are on by default; Tokmizer says so once before anything is sent, and turning them off survives updates. Detailed rows are kept 90 days, then only a running total. With the network off, Tokmizer uses the last downloaded rules for up to 7 days, then the rules built into the CLI. `tkr network off` does not cover Claude Code's own marketplace auto-update. Full policy: [tokmizer.com/en/privacy](https://tokmizer.com/en/privacy).
|
|
368
368
|
|
|
369
369
|
</details>
|
|
370
370
|
|
|
@@ -379,7 +379,7 @@ In Claude Code: `/plugin uninstall tokmizer@tokmizer`. Your savings history stay
|
|
|
379
379
|
|
|
380
380
|
## Build from source
|
|
381
381
|
|
|
382
|
-
Node.js
|
|
382
|
+
Node.js 24.22.1+ (or 22.23.4+) and npm. The optional native launcher needs Rust.
|
|
383
383
|
|
|
384
384
|
```bash
|
|
385
385
|
git clone https://github.com/norwelltw/Tokmizer
|
|
@@ -13,7 +13,7 @@ node "${CLAUDE_PLUGIN_ROOT}/dist/bin/tkr.js" status
|
|
|
13
13
|
|
|
14
14
|
Print the output as is. It includes the network state, the token state, whether the device is linked and whether `/power` is available right now. Tokmizer is free: there is no plan or subscription to mention.
|
|
15
15
|
|
|
16
|
-
If the user asks what Tokmizer sends over the network, answer plainly. No account or email is needed. Tokmizer contacts tokmizer.com to keep its rules up to date and to improve the product. It sends a random install ID
|
|
16
|
+
If the user asks what Tokmizer sends over the network, answer plainly. No account or email is needed. Tokmizer contacts tokmizer.com to keep its rules up to date and to improve the product. It sends a random install ID and the plugin version, nothing that describes the machine: no computer name, OS, hardware or user name. Command contents and output are never sent. Usage stats (command names, token counts and install health counts) are on by default and sent only while they are on; `tkr telemetry off` stops them. Git and GitHub commands are recorded only as the tool and its action, such as `git push`.
|
|
17
17
|
|
|
18
18
|
If the output shows `Network: off`, explain that nothing leaves the machine and Tokmizer keeps compressing with the rules already on it. To turn it back on: `tkr network on`. To turn everything off: `tkr network off`; usage stats only: `tkr telemetry off`.
|
|
19
19
|
|