token-pilot 0.35.0 → 0.36.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/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +37 -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/session-start.js +49 -0
- package/package.json +1 -1
- package/skills/guide/SKILL.md +11 -0
- package/skills/install/SKILL.md +10 -0
- package/skills/stats/SKILL.md +8 -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.
|
|
9
|
+
"version": "0.36.0"
|
|
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.
|
|
16
|
+
"version": "0.36.0",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "Digital-Threads"
|
|
19
19
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "token-pilot",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "Saves 60-90% tokens on AI code reading. AST-aware lazy reads, symbol navigation, find_usages, structural git diff/log, edit-safety guard, Task-routing matcher, cross-session telemetry (errors + diagnostics), 25 tp-* subagents tiered to haiku/sonnet/opus with budget watchdog.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Digital-Threads",
|
package/README.md
CHANGED
|
@@ -232,6 +232,43 @@ lines instead of bouncing the call. The structural summary still
|
|
|
232
232
|
rides along in `additionalContext`. Default OFF because the field
|
|
233
233
|
is undocumented and may change.
|
|
234
234
|
|
|
235
|
+
## What's new for Claude Code 2.1.151+
|
|
236
|
+
|
|
237
|
+
These notes are about behaviour you'll see automatically once you
|
|
238
|
+
update both Claude Code and `token-pilot@latest`. No extra
|
|
239
|
+
configuration required.
|
|
240
|
+
|
|
241
|
+
### Session title badge (`[TP] Nk saved`)
|
|
242
|
+
|
|
243
|
+
The SessionStart hook now sets the window/tab title to the cumulative
|
|
244
|
+
token savings for the current project, using Claude Code 2.1.152's
|
|
245
|
+
`hookSpecificOutput.sessionTitle` field. You'll see a badge like
|
|
246
|
+
`[TP] 1.2M saved` in the title bar so you can confirm at a glance
|
|
247
|
+
that the plugin is doing its job.
|
|
248
|
+
|
|
249
|
+
### Hardened skills (`disallowed-tools`)
|
|
250
|
+
|
|
251
|
+
The three bundled skills (`guide`, `install`, `stats`) declare
|
|
252
|
+
`disallowed-tools` (Claude Code 2.1.152+) so a runaway model can't
|
|
253
|
+
issue `Write` / `Edit` / `Task` while the skill is on display. The
|
|
254
|
+
install skill keeps `Bash` because it has to run
|
|
255
|
+
`npx token-pilot install-ast-index`; the other two have Bash
|
|
256
|
+
disallowed too.
|
|
257
|
+
|
|
258
|
+
### Auto mode on third-party providers
|
|
259
|
+
|
|
260
|
+
Claude Code 2.1.158 opened auto mode to Bedrock / Vertex / Foundry
|
|
261
|
+
on Opus 4.7 + 4.8. If you're on one of those, opt in with
|
|
262
|
+
`CLAUDE_CODE_ENABLE_AUTO_MODE=1`. token-pilot's deny-Read /
|
|
263
|
+
deny-Bash gates still run on top — auto mode never bypasses them.
|
|
264
|
+
|
|
265
|
+
### Opus 4.8 as fast-mode default
|
|
266
|
+
|
|
267
|
+
Claude Code 2.1.154 made Opus 4.8 the default for high effort. The
|
|
268
|
+
tp-* agents that already declared `model: haiku` keep their cheaper
|
|
269
|
+
tier (90 %+ of the agent roster); the few sonnet/opus-tier ones
|
|
270
|
+
ride the upgrade automatically.
|
|
271
|
+
|
|
235
272
|
## Troubleshooting
|
|
236
273
|
|
|
237
274
|
```bash
|
|
@@ -9,7 +9,7 @@ tools:
|
|
|
9
9
|
- mcp__token-pilot__read_symbol
|
|
10
10
|
- Bash
|
|
11
11
|
model: haiku
|
|
12
|
-
token_pilot_version: "0.
|
|
12
|
+
token_pilot_version: "0.36.0"
|
|
13
13
|
token_pilot_body_hash: dd184501203fa7f3c73f419c4ffbe33c4be75400cb64a7a51733a3fe23f6e085
|
|
14
14
|
requiredMcpServers:
|
|
15
15
|
- "token-pilot"
|
|
@@ -8,7 +8,7 @@ tools:
|
|
|
8
8
|
- mcp__token-pilot__test_summary
|
|
9
9
|
- mcp__token-pilot__outline
|
|
10
10
|
- Bash
|
|
11
|
-
token_pilot_version: "0.
|
|
11
|
+
token_pilot_version: "0.36.0"
|
|
12
12
|
token_pilot_body_hash: de64a406b5176de19f7422619c7de7949b1f28865f225402c9cea9255f377428
|
|
13
13
|
requiredMcpServers:
|
|
14
14
|
- "token-pilot"
|
package/agents/tp-debugger.md
CHANGED
package/agents/tp-dep-health.md
CHANGED
package/agents/tp-doc-writer.md
CHANGED
|
@@ -12,7 +12,7 @@ tools:
|
|
|
12
12
|
- mcp__token-pilot__read_symbols
|
|
13
13
|
- Read
|
|
14
14
|
model: sonnet
|
|
15
|
-
token_pilot_version: "0.
|
|
15
|
+
token_pilot_version: "0.36.0"
|
|
16
16
|
token_pilot_body_hash: 351a987e11eba63852f5431a16d8eb53104f4f689f82fdcc5a2bf4db948ba92f
|
|
17
17
|
requiredMcpServers:
|
|
18
18
|
- "token-pilot"
|
|
@@ -8,7 +8,7 @@ tools:
|
|
|
8
8
|
- mcp__token-pilot__read_symbol
|
|
9
9
|
- Bash
|
|
10
10
|
model: inherit
|
|
11
|
-
token_pilot_version: "0.
|
|
11
|
+
token_pilot_version: "0.36.0"
|
|
12
12
|
token_pilot_body_hash: de5722bfea374eaab096c1ae635c37879e7a91370ee3cd0532f4240be03c91eb
|
|
13
13
|
requiredMcpServers:
|
|
14
14
|
- "token-pilot"
|
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.
|
|
13
|
+
token_pilot_version: "0.36.0"
|
|
14
14
|
token_pilot_body_hash: 832e95633fbc8e9b0c10f3e540a327d4be062fb4b3f17a6cce6be13f414e2927
|
|
15
15
|
requiredMcpServers:
|
|
16
16
|
- "token-pilot"
|
package/agents/tp-pr-reviewer.md
CHANGED
|
@@ -11,7 +11,7 @@ tools:
|
|
|
11
11
|
- mcp__token-pilot__read_for_edit
|
|
12
12
|
- Read
|
|
13
13
|
model: sonnet
|
|
14
|
-
token_pilot_version: "0.
|
|
14
|
+
token_pilot_version: "0.36.0"
|
|
15
15
|
token_pilot_body_hash: f83f50d05b4f70285ae7afed2b1a406fc436df56e61a0aedbfb31edc7f2b6e66
|
|
16
16
|
requiredMcpServers:
|
|
17
17
|
- "token-pilot"
|
|
@@ -8,7 +8,7 @@ tools:
|
|
|
8
8
|
- mcp__token-pilot__outline
|
|
9
9
|
- mcp__token-pilot__read_symbol
|
|
10
10
|
model: sonnet
|
|
11
|
-
token_pilot_version: "0.
|
|
11
|
+
token_pilot_version: "0.36.0"
|
|
12
12
|
token_pilot_body_hash: c5f6fc122c89e16e5cf774045f92169ee3468555320b898171ba13eca5323550
|
|
13
13
|
requiredMcpServers:
|
|
14
14
|
- "token-pilot"
|
|
@@ -9,7 +9,7 @@ tools:
|
|
|
9
9
|
- mcp__token-pilot__module_info
|
|
10
10
|
- Bash
|
|
11
11
|
model: sonnet
|
|
12
|
-
token_pilot_version: "0.
|
|
12
|
+
token_pilot_version: "0.36.0"
|
|
13
13
|
token_pilot_body_hash: 8ef3c3341cbfed4eb8dd130126a9683edc57e378c92ff0ca764d584fd941c55c
|
|
14
14
|
requiredMcpServers:
|
|
15
15
|
- "token-pilot"
|
package/agents/tp-run.md
CHANGED
package/agents/tp-spec-writer.md
CHANGED
|
@@ -10,7 +10,7 @@ tools:
|
|
|
10
10
|
- mcp__token-pilot__test_summary
|
|
11
11
|
- Glob
|
|
12
12
|
- Grep
|
|
13
|
-
token_pilot_version: "0.
|
|
13
|
+
token_pilot_version: "0.36.0"
|
|
14
14
|
token_pilot_body_hash: be81eed53a3720d146cf89e4a14a7a56577633f7c84c234c412ab70d64c05b11
|
|
15
15
|
requiredMcpServers:
|
|
16
16
|
- "token-pilot"
|
package/agents/tp-test-triage.md
CHANGED
|
@@ -8,7 +8,7 @@ tools:
|
|
|
8
8
|
- mcp__token-pilot__find_usages
|
|
9
9
|
- mcp__token-pilot__read_symbol
|
|
10
10
|
model: sonnet
|
|
11
|
-
token_pilot_version: "0.
|
|
11
|
+
token_pilot_version: "0.36.0"
|
|
12
12
|
token_pilot_body_hash: 362ecf4cb03b059421ea26933473700900073dc38b3a7fe271208dfb1ae14f90
|
|
13
13
|
requiredMcpServers:
|
|
14
14
|
- "token-pilot"
|
package/agents/tp-test-writer.md
CHANGED
|
@@ -274,11 +274,60 @@ export async function handleSessionStart(opts) {
|
|
|
274
274
|
".token-pilot/snapshots/latest.md",
|
|
275
275
|
".token-pilot/hook-events.jsonl",
|
|
276
276
|
];
|
|
277
|
+
// v0.36.0 — sessionTitle was added in Claude Code 2.1.152. We surface
|
|
278
|
+
// the cumulative saved-token count for this project so users see the
|
|
279
|
+
// payoff at a glance in their window/tab title. Best-effort — if the
|
|
280
|
+
// savings file is unreadable we fall back to a neutral title.
|
|
281
|
+
let sessionTitle;
|
|
282
|
+
try {
|
|
283
|
+
const { loadSessionStats } = await import("../core/session-savings.js");
|
|
284
|
+
// Sum savings across all sessions in this project, not just one.
|
|
285
|
+
const stats = loadSessionStats(opts.projectRoot, "");
|
|
286
|
+
// sessionId="" makes loadSessionStats short-circuit; use a tiny
|
|
287
|
+
// dedicated reader instead.
|
|
288
|
+
const { readFileSync } = await import("node:fs");
|
|
289
|
+
const { join } = await import("node:path");
|
|
290
|
+
let total = 0;
|
|
291
|
+
try {
|
|
292
|
+
const raw = readFileSync(join(opts.projectRoot, ".token-pilot", "hook-events.jsonl"), "utf-8");
|
|
293
|
+
for (const line of raw.split("\n")) {
|
|
294
|
+
if (!line)
|
|
295
|
+
continue;
|
|
296
|
+
try {
|
|
297
|
+
const ev = JSON.parse(line);
|
|
298
|
+
if (typeof ev.savedTokens === "number")
|
|
299
|
+
total += ev.savedTokens;
|
|
300
|
+
}
|
|
301
|
+
catch {
|
|
302
|
+
/* skip malformed line */
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
catch {
|
|
307
|
+
/* no log file yet */
|
|
308
|
+
}
|
|
309
|
+
// Use the larger of "single-session" (loadSessionStats fallback)
|
|
310
|
+
// and the all-sessions sum so an empty single-session number
|
|
311
|
+
// doesn't override the meaningful project-wide total.
|
|
312
|
+
const surfaced = Math.max(total, stats.savedTokens);
|
|
313
|
+
if (surfaced > 0) {
|
|
314
|
+
const human = surfaced >= 1_000_000
|
|
315
|
+
? `${(surfaced / 1_000_000).toFixed(1)}M`
|
|
316
|
+
: surfaced >= 1000
|
|
317
|
+
? `${Math.round(surfaced / 1000)}k`
|
|
318
|
+
: `${surfaced}`;
|
|
319
|
+
sessionTitle = `[TP] ${human} saved`;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
catch {
|
|
323
|
+
/* sessionTitle is best-effort decoration; never block startup */
|
|
324
|
+
}
|
|
277
325
|
const output = {
|
|
278
326
|
hookSpecificOutput: {
|
|
279
327
|
hookEventName: "SessionStart",
|
|
280
328
|
additionalContext: message,
|
|
281
329
|
watchPaths,
|
|
330
|
+
...(sessionTitle ? { sessionTitle } : {}),
|
|
282
331
|
},
|
|
283
332
|
};
|
|
284
333
|
return JSON.stringify(output);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "token-pilot",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.36.0",
|
|
4
4
|
"description": "Save up to 80% tokens when AI reads code — 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",
|
package/skills/guide/SKILL.md
CHANGED
|
@@ -3,6 +3,17 @@ name: guide
|
|
|
3
3
|
description: Show a quick-reference guide for all Token Pilot tools — when to use each one
|
|
4
4
|
command: guide
|
|
5
5
|
user_invocable: true
|
|
6
|
+
# v0.36.0 — disallowed-tools is a Claude Code 2.1.152+ field that
|
|
7
|
+
# strips the listed tools from the model's surface while this skill
|
|
8
|
+
# is active. The guide just renders Markdown; it never needs Edit /
|
|
9
|
+
# Write / Bash / Task. Defense-in-depth so a runaway model can't
|
|
10
|
+
# mutate the workspace while a help screen is on display.
|
|
11
|
+
disallowed-tools:
|
|
12
|
+
- Bash
|
|
13
|
+
- Edit
|
|
14
|
+
- MultiEdit
|
|
15
|
+
- Write
|
|
16
|
+
- Task
|
|
6
17
|
---
|
|
7
18
|
|
|
8
19
|
Display the following Token Pilot tool reference to the user. Show it exactly as formatted below.
|
package/skills/install/SKILL.md
CHANGED
|
@@ -3,6 +3,16 @@ name: install
|
|
|
3
3
|
description: Install or check ast-index binary (auto-downloads if missing)
|
|
4
4
|
command: install
|
|
5
5
|
user_invocable: true
|
|
6
|
+
# v0.36.0 — disallowed-tools (Claude Code 2.1.152+). The install
|
|
7
|
+
# skill drives one `npx token-pilot install-ast-index` Bash command;
|
|
8
|
+
# nothing else. Keep Bash, block all write/edit/delegation tools so
|
|
9
|
+
# a rogue interpretation can't extend the install into arbitrary
|
|
10
|
+
# workspace mutation.
|
|
11
|
+
disallowed-tools:
|
|
12
|
+
- Edit
|
|
13
|
+
- MultiEdit
|
|
14
|
+
- Write
|
|
15
|
+
- Task
|
|
6
16
|
---
|
|
7
17
|
|
|
8
18
|
Run the following command to install or verify the ast-index binary:
|
package/skills/stats/SKILL.md
CHANGED
|
@@ -3,6 +3,14 @@ name: stats
|
|
|
3
3
|
description: Show Token Pilot session analytics — token savings, per-tool breakdown, top files, per-agent grouping
|
|
4
4
|
command: stats
|
|
5
5
|
user_invocable: true
|
|
6
|
+
# v0.36.0 — disallowed-tools (Claude Code 2.1.152+). stats only reads
|
|
7
|
+
# the events log and runs `token-pilot stats` variants. No
|
|
8
|
+
# Edit/Write/Task ever — block them defensively.
|
|
9
|
+
disallowed-tools:
|
|
10
|
+
- Edit
|
|
11
|
+
- MultiEdit
|
|
12
|
+
- Write
|
|
13
|
+
- Task
|
|
6
14
|
---
|
|
7
15
|
|
|
8
16
|
Two entry points:
|