token-pilot 0.28.0 → 0.28.2
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/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +63 -0
- package/agents/tp-api-surface-tracker.md +1 -1
- package/agents/tp-audit-scanner.md +1 -1
- package/agents/tp-commit-writer.md +1 -1
- package/agents/tp-context-engineer.md +1 -1
- package/agents/tp-dead-code-finder.md +1 -1
- package/agents/tp-debugger.md +1 -1
- package/agents/tp-dep-health.md +1 -1
- package/agents/tp-doc-writer.md +1 -1
- package/agents/tp-history-explorer.md +1 -1
- package/agents/tp-impact-analyzer.md +1 -1
- package/agents/tp-incident-timeline.md +1 -1
- package/agents/tp-incremental-builder.md +1 -1
- package/agents/tp-migration-scout.md +1 -1
- package/agents/tp-onboard.md +1 -1
- package/agents/tp-performance-profiler.md +1 -1
- package/agents/tp-pr-reviewer.md +1 -1
- package/agents/tp-refactor-planner.md +1 -1
- package/agents/tp-review-impact.md +1 -1
- package/agents/tp-run.md +1 -1
- package/agents/tp-session-restorer.md +1 -1
- package/agents/tp-ship-coordinator.md +1 -1
- package/agents/tp-spec-writer.md +1 -1
- package/agents/tp-test-coverage-gapper.md +1 -1
- package/agents/tp-test-triage.md +1 -1
- package/agents/tp-test-writer.md +1 -1
- package/dist/hooks/installer.js +1 -1
- package/dist/index.js +3 -3
- package/dist/server/tool-profiles.d.ts +15 -9
- package/dist/server/tool-profiles.js +30 -13
- package/package.json +2 -1
- /package/{.claude-plugin/hooks → hooks}/hooks.json +0 -0
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Token Pilot \u2014 save 60-90% tokens when AI reads code",
|
|
9
|
-
"version": "0.28.
|
|
9
|
+
"version": "0.28.2"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "token-pilot",
|
|
14
14
|
"source": "./",
|
|
15
15
|
"description": "Reduces token consumption by 60-90% via AST-aware lazy file reading, structural symbol navigation, and cross-session tool-usage analytics. 22 MCP tools + 19 subagents + budget watchdog hooks.",
|
|
16
|
-
"version": "0.28.
|
|
16
|
+
"version": "0.28.2",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "Digital-Threads"
|
|
19
19
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "token-pilot",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.2",
|
|
4
4
|
"description": "Saves 60-90% tokens when AI reads code. AST-aware lazy reading, symbol navigation, cross-session tool-usage analytics, 22 subagents (haiku/sonnet/opus-tiered) with budget watchdog.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Digital-Threads",
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,69 @@ All notable changes to Token Pilot will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.28.2] - 2026-04-19
|
|
9
|
+
|
|
10
|
+
### Fixed — plugin hooks were never actually reaching Claude Code
|
|
11
|
+
|
|
12
|
+
**Critical: all our PreToolUse hooks (Read, Edit, Bash, Grep) in the plugin-install path have been silently non-functional since v0.1.0.**
|
|
13
|
+
|
|
14
|
+
Live verification by Sonnet 4.6 on Windows surfaced the symptom: `grep -r`, `cat <code-file>`, and `bare git log` — documented as blocked in v0.28.0 — were not being blocked. Pattern-based deny from our hook-pre-bash / hook-pre-grep never fired. The tests passed because the pure decision logic is correct; the issue was that **Claude Code never called our hook at all**.
|
|
15
|
+
|
|
16
|
+
Root cause, confirmed against the [official Anthropic plugin-dev skill](https://github.com/anthropics/claude-code/blob/main/plugins/plugin-dev/skills/hook-development/SKILL.md):
|
|
17
|
+
|
|
18
|
+
> **For plugin hooks** in `hooks/hooks.json`, use wrapper format
|
|
19
|
+
|
|
20
|
+
Canonical plugin hook location is **`<plugin-root>/hooks/hooks.json`**, not `<plugin-root>/.claude-plugin/hooks/hooks.json`. We'd been putting it inside `.claude-plugin/` since v0.1.0 based on a misreading — Claude Code's plugin loader never looked there.
|
|
21
|
+
|
|
22
|
+
The fact that Read-hook blocking "seemed to work" earlier was because `npx token-pilot install-hook` copied the same hooks into `~/.claude/settings.json` directly (a separate code path that works). When I cleaned up duplicates via `uninstall-hook` in v0.28.0, the plugin-side fallback I thought existed turned out never to have existed — and *no one's hooks were firing at all*.
|
|
23
|
+
|
|
24
|
+
Reference comparison — `claude-context-mode@0.7.2` ships hooks.json in both locations. The `hooks/hooks.json` copy is what actually works; the `.claude-plugin/hooks/hooks.json` is dead weight.
|
|
25
|
+
|
|
26
|
+
### Change
|
|
27
|
+
|
|
28
|
+
`git mv .claude-plugin/hooks/hooks.json hooks/hooks.json`. Also:
|
|
29
|
+
|
|
30
|
+
- `package.json` `files` now includes `hooks/hooks.json`.
|
|
31
|
+
- Regression test updated to read from the new canonical path.
|
|
32
|
+
- Code comments in `src/hooks/installer.ts` and `src/index.ts` that referenced the old path corrected.
|
|
33
|
+
|
|
34
|
+
### After upgrade — required user action
|
|
35
|
+
|
|
36
|
+
Plugin users on 0.27.x / 0.28.0 / 0.28.1 need to reinstall the plugin so the hook files land in the correct location:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
claude plugin marketplace update token-pilot
|
|
40
|
+
claude plugin uninstall token-pilot@token-pilot
|
|
41
|
+
claude plugin install token-pilot@token-pilot
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Then restart Claude Code. PreToolUse hooks for all four matchers (Read / Edit / Bash / Grep) will fire in the new session. Verify with Sonnet's test: a `Grep(pattern="getUserById")` in a new session must now return a deny with the find_usages suggestion.
|
|
45
|
+
|
|
46
|
+
npm-install users on `install-hook` are unaffected (their hooks live in `~/.claude/settings.json` and always worked).
|
|
47
|
+
|
|
48
|
+
1019 tests still passing.
|
|
49
|
+
|
|
50
|
+
## [0.28.1] - 2026-04-19
|
|
51
|
+
|
|
52
|
+
### Fixed — `session_analytics` hidden in `nav` profile defeated the whole point of profiles
|
|
53
|
+
|
|
54
|
+
Field report from Opus 4.7 running our own verification prompt against v0.28.0 on Windows: user had `TOKEN_PILOT_PROFILE=nav` set, Opus tried `mcp__plugin_token-pilot_token-pilot__session_analytics` for the pre-flight baseline and got "No matching deferred tools found". The whole verification stalled — the tool that measures whether the profile saves tokens wasn't in the profile.
|
|
55
|
+
|
|
56
|
+
Root cause: in v0.26.3 I bucketed `session_analytics` / `session_budget` / `session_snapshot` as "full-only" along with `test_summary`, `code_audit`, `find_unused`. That was a mistake — those three are **diagnostic meta-tools**, not workflow tools. Hiding them from `nav` and `edit` contradicts the profile feature's own purpose: if you can't verify the savings, why would you trust the profile?
|
|
57
|
+
|
|
58
|
+
Fix: new `META_TOOLS` set in `src/server/tool-profiles.ts`. META is **always visible** regardless of profile. Contents:
|
|
59
|
+
- `session_analytics` — self-measurement (verifies the profile is working)
|
|
60
|
+
- `session_budget` — remaining budget view
|
|
61
|
+
- `session_snapshot` — state capture for /clear recovery
|
|
62
|
+
|
|
63
|
+
`filterToolsByProfile` now does `NAV_TOOLS ∪ META_TOOLS` for nav and `NAV_TOOLS ∪ EDIT_EXTRAS ∪ META_TOOLS` for edit. New regression test asserts META is present in every profile.
|
|
64
|
+
|
|
65
|
+
### Impact
|
|
66
|
+
|
|
67
|
+
Users on `nav` / `edit` profiles get **3 extra tools** in their `tools/list` (~400 additional tokens at session start) but retain the ability to verify savings. The math: if a profile saves 2200 tokens on the original 22-tool list but hides the observability tools, the user mentally pads the savings with uncertainty and eventually switches back to `full`. The 400-token tax for keeping visibility is cheaper than that.
|
|
68
|
+
|
|
69
|
+
1019 tests passing (+1 new — META_TOOLS cross-profile visibility).
|
|
70
|
+
|
|
8
71
|
## [0.28.0] - 2026-04-19
|
|
9
72
|
|
|
10
73
|
### Added — passive pre-intercept hooks for Grep and Bash
|
package/agents/tp-debugger.md
CHANGED
package/agents/tp-dep-health.md
CHANGED
package/agents/tp-doc-writer.md
CHANGED
package/agents/tp-onboard.md
CHANGED
|
@@ -10,7 +10,7 @@ tools:
|
|
|
10
10
|
- mcp__token-pilot__smart_read
|
|
11
11
|
- mcp__token-pilot__smart_read_many
|
|
12
12
|
- mcp__token-pilot__read_section
|
|
13
|
-
token_pilot_version: "0.28.
|
|
13
|
+
token_pilot_version: "0.28.2"
|
|
14
14
|
token_pilot_body_hash: ae0b86eaffaf34bf283b94b5572481fa8c2d6a2a25193f1173b70bef0fbe1919
|
|
15
15
|
---
|
|
16
16
|
|
package/agents/tp-pr-reviewer.md
CHANGED
package/agents/tp-run.md
CHANGED
package/agents/tp-spec-writer.md
CHANGED
package/agents/tp-test-triage.md
CHANGED
package/agents/tp-test-writer.md
CHANGED
package/dist/hooks/installer.js
CHANGED
|
@@ -92,7 +92,7 @@ function createHookConfig(options) {
|
|
|
92
92
|
*/
|
|
93
93
|
export async function installHook(projectRoot, options) {
|
|
94
94
|
// Skip auto-install when running as a Claude Code plugin —
|
|
95
|
-
// the plugin system already registers hooks via
|
|
95
|
+
// the plugin system already registers hooks via hooks/hooks.json
|
|
96
96
|
if (process.env.CLAUDE_PLUGIN_ROOT) {
|
|
97
97
|
return {
|
|
98
98
|
installed: false,
|
package/dist/index.js
CHANGED
|
@@ -589,13 +589,13 @@ export function handleHookEdit() {
|
|
|
589
589
|
export async function handleInstallHook(projectRoot) {
|
|
590
590
|
// v0.26.5 — plugin-aware early-return. If we're running as a Claude
|
|
591
591
|
// Code plugin (CLAUDE_PLUGIN_ROOT set) the hooks are already declared
|
|
592
|
-
// in
|
|
592
|
+
// in hooks/hooks.json and Claude Code wires them up
|
|
593
593
|
// on install. Calling install-hook in that context would write a
|
|
594
594
|
// duplicate entry to the user's settings.json and emit two hooks for
|
|
595
595
|
// every event. Bail early.
|
|
596
596
|
if (process.env.CLAUDE_PLUGIN_ROOT) {
|
|
597
597
|
console.log("token-pilot is running as a Claude Code plugin — hooks are already\n" +
|
|
598
|
-
"declared in
|
|
598
|
+
"declared in hooks/hooks.json and registered by the\n" +
|
|
599
599
|
"plugin installer. `install-hook` is only needed for npm/npx setups.\n" +
|
|
600
600
|
"Skipping to avoid duplicate hook entries.");
|
|
601
601
|
process.exit(0);
|
|
@@ -652,7 +652,7 @@ export async function handleDoctor() {
|
|
|
652
652
|
// ── Installation mode ──
|
|
653
653
|
// v0.26.5 — tell the user HOW token-pilot is installed. Matters
|
|
654
654
|
// because plugin users don't need `install-hook` (hooks come from
|
|
655
|
-
//
|
|
655
|
+
// hooks/hooks.json); npm users do. dev/worktree users
|
|
656
656
|
// are usually contributors running from a local checkout.
|
|
657
657
|
let installMode;
|
|
658
658
|
if (process.env.CLAUDE_PLUGIN_ROOT) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* v0.26.3 — tool profiles.
|
|
2
|
+
* v0.26.3 — tool profiles. v0.28.1 — META_TOOLS always-available fix.
|
|
3
3
|
*
|
|
4
4
|
* Idea lifted honestly from Token Savior's TOKEN_SAVIOR_PROFILE. When an
|
|
5
5
|
* MCP server advertises 22 tools, every tools/list response costs the
|
|
@@ -10,20 +10,26 @@
|
|
|
10
10
|
* user in the same server can still reach the full set if they know
|
|
11
11
|
* the name).
|
|
12
12
|
*
|
|
13
|
-
* Three profiles:
|
|
14
|
-
* -
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* -
|
|
19
|
-
*
|
|
20
|
-
* read_diff, read_for_edit, smart_read_many.
|
|
13
|
+
* Three profiles, plus one always-on set:
|
|
14
|
+
* - META (implicit): always advertised, every profile — meta-tools
|
|
15
|
+
* the user needs to verify token-pilot is actually saving anything.
|
|
16
|
+
* Excluding them contradicts the whole point of profiles.
|
|
17
|
+
* - full (default): everything, same as pre-v0.26.3.
|
|
18
|
+
* - nav : META + read-only exploration (10 tools + META).
|
|
19
|
+
* - edit: META + nav + batch reads + edit-prep (16 tools + META).
|
|
21
20
|
*
|
|
22
21
|
* Selection: TOKEN_PILOT_PROFILE=nav|edit|full env var. Unknown values
|
|
23
22
|
* fall back to full with a stderr warning. Silent on missing env.
|
|
24
23
|
*/
|
|
25
24
|
export type ToolProfile = "full" | "nav" | "edit";
|
|
26
25
|
export declare const PROFILE_NAMES: readonly ToolProfile[];
|
|
26
|
+
/**
|
|
27
|
+
* Meta-tools — diagnostic / self-observation tools that must be visible
|
|
28
|
+
* in EVERY profile. Excluding them defeats the profile feature's own
|
|
29
|
+
* purpose: if you can't check whether token-pilot is saving tokens, why
|
|
30
|
+
* would you trust the savings number?
|
|
31
|
+
*/
|
|
32
|
+
export declare const META_TOOLS: ReadonlySet<string>;
|
|
27
33
|
/** Minimum nav profile — exploration only, no editing support. */
|
|
28
34
|
export declare const NAV_TOOLS: ReadonlySet<string>;
|
|
29
35
|
/** Edit profile adds batch reads + edit-preparation tools. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* v0.26.3 — tool profiles.
|
|
2
|
+
* v0.26.3 — tool profiles. v0.28.1 — META_TOOLS always-available fix.
|
|
3
3
|
*
|
|
4
4
|
* Idea lifted honestly from Token Savior's TOKEN_SAVIOR_PROFILE. When an
|
|
5
5
|
* MCP server advertises 22 tools, every tools/list response costs the
|
|
@@ -10,14 +10,13 @@
|
|
|
10
10
|
* user in the same server can still reach the full set if they know
|
|
11
11
|
* the name).
|
|
12
12
|
*
|
|
13
|
-
* Three profiles:
|
|
14
|
-
* -
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* -
|
|
19
|
-
*
|
|
20
|
-
* read_diff, read_for_edit, smart_read_many.
|
|
13
|
+
* Three profiles, plus one always-on set:
|
|
14
|
+
* - META (implicit): always advertised, every profile — meta-tools
|
|
15
|
+
* the user needs to verify token-pilot is actually saving anything.
|
|
16
|
+
* Excluding them contradicts the whole point of profiles.
|
|
17
|
+
* - full (default): everything, same as pre-v0.26.3.
|
|
18
|
+
* - nav : META + read-only exploration (10 tools + META).
|
|
19
|
+
* - edit: META + nav + batch reads + edit-prep (16 tools + META).
|
|
21
20
|
*
|
|
22
21
|
* Selection: TOKEN_PILOT_PROFILE=nav|edit|full env var. Unknown values
|
|
23
22
|
* fall back to full with a stderr warning. Silent on missing env.
|
|
@@ -27,6 +26,17 @@ export const PROFILE_NAMES = [
|
|
|
27
26
|
"nav",
|
|
28
27
|
"edit",
|
|
29
28
|
];
|
|
29
|
+
/**
|
|
30
|
+
* Meta-tools — diagnostic / self-observation tools that must be visible
|
|
31
|
+
* in EVERY profile. Excluding them defeats the profile feature's own
|
|
32
|
+
* purpose: if you can't check whether token-pilot is saving tokens, why
|
|
33
|
+
* would you trust the savings number?
|
|
34
|
+
*/
|
|
35
|
+
export const META_TOOLS = new Set([
|
|
36
|
+
"session_analytics",
|
|
37
|
+
"session_budget",
|
|
38
|
+
"session_snapshot",
|
|
39
|
+
]);
|
|
30
40
|
/** Minimum nav profile — exploration only, no editing support. */
|
|
31
41
|
export const NAV_TOOLS = new Set([
|
|
32
42
|
"smart_read",
|
|
@@ -59,10 +69,17 @@ export const EDIT_EXTRAS = new Set([
|
|
|
59
69
|
export function filterToolsByProfile(tools, profile) {
|
|
60
70
|
if (profile === "full")
|
|
61
71
|
return [...tools];
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
//
|
|
65
|
-
|
|
72
|
+
// META_TOOLS are ALWAYS visible — session_analytics, session_budget,
|
|
73
|
+
// session_snapshot are the instruments for verifying the profile is
|
|
74
|
+
// doing its job. Hiding them would turn "did this save tokens?" into
|
|
75
|
+
// a guess.
|
|
76
|
+
if (profile === "nav") {
|
|
77
|
+
return tools.filter((t) => NAV_TOOLS.has(t.name) || META_TOOLS.has(t.name));
|
|
78
|
+
}
|
|
79
|
+
// edit = nav + extras + meta
|
|
80
|
+
return tools.filter((t) => NAV_TOOLS.has(t.name) ||
|
|
81
|
+
EDIT_EXTRAS.has(t.name) ||
|
|
82
|
+
META_TOOLS.has(t.name));
|
|
66
83
|
}
|
|
67
84
|
/**
|
|
68
85
|
* Parse the TOKEN_PILOT_PROFILE env value. Unknown values get a warning
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "token-pilot",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.2",
|
|
4
4
|
"description": "Save up to 80% tokens when AI reads code \u2014 MCP server for token-efficient code navigation, AST-aware structural reading instead of dumping full files into context window",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"scripts/postinstall.mjs",
|
|
16
16
|
"start.sh",
|
|
17
17
|
".claude-plugin/",
|
|
18
|
+
"hooks/hooks.json",
|
|
18
19
|
".mcp.json",
|
|
19
20
|
"skills/",
|
|
20
21
|
"README.md",
|
|
File without changes
|