You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: v5.5.0 — bash compression on by default, security hardening
Bash Output Compression now ships ON for all users. 16 handlers cover
git, pytest, jest, npm, lint, logs, tree, docker, kubectl, sqlite3,
du/df/wc, and build tools. Disable with TOKEN_OPTIMIZER_BASH_COMPRESS=0.
Security hardening for default-ON:
- Remove printenv from whitelist (dumps all env vars including secrets)
- Remove docker exec from whitelist (not read-only, arbitrary container commands)
- Add kubectl guard blocking 'kubectl get secrets' resource type
Also: remove outdated 'Unknown skill: plugin' README section, sync
dashboard.html V5_FEATURES_FALLBACK with measure.py source of truth,
fix dashboard toggle handler to use per-feature defaults, update welcome
screen text, update all SVGs from yellow/opt-in to green/on.
@@ -51,19 +51,6 @@ Then in Claude Code: `/token-optimizer`
51
51
52
52
> **Please enable auto-update after installing.** Claude Code ships third-party marketplaces with auto-update **off by default**, and plugin authors cannot change that default. So you won't get bug fixes automatically unless you turn it on. In Claude Code: `/plugin` → **Marketplaces** tab → select `alexgreensh-token-optimizer` → **Enable auto-update**. One-time, 10 seconds, and you'll never miss a fix again. Token Optimizer also prints a one-time reminder on your first SessionStart so you don't forget.
-**Native installer**: re-run the install command from [claude.com/product/claude-code](https://claude.com/product/claude-code)
62
-
63
-
Then restart Claude Code and re-run the two `/plugin` commands above.
64
-
65
-
</details>
66
-
67
54
<details>
68
55
<summary><h3>Windows users: read this first</h3></summary>
69
56
@@ -180,7 +167,7 @@ Lighter users see proportional savings. Structural audit wins (unused skills, du
180
167
<details>
181
168
<summary>🎯 <strong>Can Token Optimizer degrade my context quality?</strong></summary>
182
169
183
-
No. Structural optimization only removes genuinely unused components (skills you never invoke, duplicate configs, orphaned memory entries). Active Compression features are independently toggleable, and the lossy ones (like Bash Compression) are OFF by default. The 7-signal quality score actively tracks degradation, so if anything ever hurt quality, the score would show it.
170
+
No. Structural optimization only removes genuinely unused components (skills you never invoke, duplicate configs, orphaned memory entries). Active Compression features are independently toggleable, and the lossy ones (like Bash Compression) can be disabled with a single command or env var. The 7-signal quality score actively tracks degradation, so if anything ever hurt quality, the score would show it.
184
171
</details>
185
172
186
173
<details>
@@ -205,7 +192,7 @@ No network calls. No analytics. No opt-out telemetry because there's nothing to
205
192
<details>
206
193
<summary>🛟 <strong>Can it hurt my session?</strong></summary>
207
194
208
-
No. All hooks are non-blocking with fail-open design. If a Token Optimizer script ever errors, your command runs normally. Compression is opt-in. Checkpoints are additive. Quality scoring is read-only measurement.
195
+
No. All hooks are non-blocking with fail-open design. If a Token Optimizer script ever errors, your command runs normally. Compression features are all individually toggleable. Checkpoints are additive. Quality scoring is read-only measurement.
209
196
</details>
210
197
211
198
<details>
@@ -337,8 +324,8 @@ Token Optimizer no longer just measures context bloat. It actively reduces it. F
337
324
338
325

339
326
340
-
**On by default**: Quality Nudges, Loop Detection, Delta Mode.
341
-
**Opt-in**: Bash Compression (7 handlers as of v5.1.0) and Structure Map Beta.
All five features are independently toggleable from the Manage tab in the dashboard, via CLI (`measure.py v5 enable|disable <feature>`), or with environment variables.
344
331
@@ -348,7 +335,7 @@ All five features are independently toggleable from the Manage tab in the dashbo
> **Privacy note**: Every feature runs 100% on your machine. Nothing is ever sent anywhere. No analytics endpoint, no phone-home, no cloud sync. "Measurement" and "beta telemetry" always mean local-only SQLite writes to a file you own, and you can inspect, export, or delete that file at any time. Token Optimizer has zero network calls by design.
354
341
@@ -402,7 +389,7 @@ Writes measurement events to your local SQLite database when a code file is read
402
389
403
390

404
391
405
-
### Bash Output Compression (OFF, opt-in, lossy)
392
+
### Bash Output Compression (ON by default, lossy)
406
393
407
394
Rewrites common CLI commands to return compressed summaries instead of verbose output. v5.1.0 ships seven new handlers covering the command families that eat the most context: lint (rule-code grouping for eslint, ruff, flake8, shellcheck, rubocop, golangci-lint), log tails (adjacent-duplicate collapse), tree (depth-2 truncation), docker build and pull (progress filtering), long listings (pip list, npm ls, docker ps, with top-N plus tail marker), JS/TS/Go build output (error-and-summary view), and test runner routing (cypress, playwright, mocha, karma all route through the unified pytest compressor).
408
395
@@ -414,9 +401,9 @@ Together with the existing git and pytest handlers, that's full coverage for ~90
414
401
415
402
**Security**: `shell=True` is never used. Credentials (AWS keys, GitHub PATs, Slack tokens, Stripe keys, OpenAI keys, HTTP basic-auth URLs) are scanned pre-compression and preserved verbatim. Multilingual error lines survive the preservation path. Partial output on timeout is returned raw, never compressed.
416
403
417
-
**How to enable**: `measure.py v5 enable bash_compress` or `TOKEN_OPTIMIZER_BASH_COMPRESS=1`
404
+
**How to disable**: `measure.py v5 disable bash_compress` or `TOKEN_OPTIMIZER_BASH_COMPRESS=0`
418
405
419
-
**Risk**: moderate. Compression is lossy by design. For routine checks this is fine. For careful diff review or debugging specific test failures, it could hide information. OFF by default, opt-in only.
406
+
**Risk**: low. Compression is lossy by design. For routine checks this is fine. For careful diff review or debugging specific test failures, disable temporarily with the command above.
420
407
421
408
### Managing v5 features
422
409
@@ -437,7 +424,7 @@ python3 measure.py compression-stats # see actual measured savings fr
437
424
TOKEN_OPTIMIZER_QUALITY_NUDGES=0 # kill switch for nudges
438
425
TOKEN_OPTIMIZER_LOOP_DETECTION=0 # kill switch for loop detection
what: "Rewrites 'git status', 'pytest', 'npm install' etc. to return compressed summaries instead of verbose output.",
2192
2192
value: "Strips hundreds of lines of test/build/git output down to just the essentials. Best for sessions with lots of CLI commands.",
2193
2193
how: "A PreToolUse hook intercepts safe read-only commands and routes them through a compression wrapper. Only whitelisted commands (git status/log/diff, pytest, jest, npm install, ls) are touched. Compound commands (anything with &&, ;, |, $()) are never touched.",
2194
-
risk: "Moderate. Compression is lossy by design: 'git diff' truncates to 30 lines on large diffs, 'pytest' shows pass/fail counts but strips individual passing tests, 'git log' drops merge commit details. For routine checks this is fine. For careful diff review or debugging specific test failures, it could hide information. OFF by default -- opt-in only.",
2194
+
risk: "Low. Compression is lossy by design: 'git diff' truncates to 30 lines on large diffs, 'pytest' shows pass/fail counts but strips individual passing tests, 'git log' drops merge commit details. For routine checks this is fine. For careful diff review or debugging specific test failures, set TOKEN_OPTIMIZER_BASH_COMPRESS=0 to disable temporarily.",
0 commit comments