token-pilot 0.23.0 → 0.23.1

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "token-pilot",
3
- "version": "0.23.0",
3
+ "version": "0.23.1",
4
4
  "description": "Enforcement layer for token-efficient AI coding: MCP-first hook with structural denial summaries, SessionStart reminder, bless-agents CLI, and six tp-* subagents — works for every agent including those without MCP access.",
5
5
  "author": "token-pilot",
6
6
  "license": "MIT",
package/CHANGELOG.md CHANGED
@@ -5,6 +5,26 @@ 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.23.1] - 2026-04-18
9
+
10
+ ### Changed — agent toolset coverage
11
+
12
+ Audit of all 14 agents vs 22 MCP tools surfaced 6 unused tools — 3 of those were genuine efficiency leaks (agents used scalar calls where batch was available). Fixed:
13
+
14
+ - **`read_symbols`** (batch read of N symbols in one file) — now in `tp-pr-reviewer` + `tp-impact-analyzer`. Previously both ran `read_symbol` in a loop for changed diffs.
15
+ - **`read_section`** (headed-section read for MD/YAML/JSON) — now in `tp-onboard` + `tp-audit-scanner` + `tp-session-restorer`. Previously `smart_read` pulled whole README / policy files when only one section was needed.
16
+ - **`smart_read_many`** (batch read of N files) — now in `tp-pr-reviewer` + `tp-migration-scout` + `tp-impact-analyzer` + `tp-onboard`. Previously loops of `smart_read` across the touched file set.
17
+ - **`session_budget`** — now in `tp-session-restorer`, included in the restored briefing so a resumed session knows its burn fraction + time-to-compact projection immediately.
18
+
19
+ Each agent's numbered steps were updated with an explicit instruction to prefer the batch tool over a loop. Preambles unchanged.
20
+
21
+ **Remaining "unused by tp-*" tools (by design):**
22
+ - `session_snapshot` — called by the main Claude Code agent at turn boundaries, not by subagents.
23
+ - `session_analytics` — user-facing summary tool invoked via `/ask token-pilot:session_analytics`, not subagent surface.
24
+
25
+ ### Numbers
26
+ - 904 tests green (+0 new — existing parity tests catch frontmatter changes automatically), `tsc --noEmit` clean.
27
+
8
28
  ## [0.23.0] - 2026-04-18
9
29
 
10
30
  ### Added — three more specialist agents (TP-02l follow-up)
@@ -7,10 +7,11 @@ tools:
7
7
  - mcp__token-pilot__smart_read
8
8
  - mcp__token-pilot__read_for_edit
9
9
  - mcp__token-pilot__outline
10
+ - mcp__token-pilot__read_section
10
11
  - Grep
11
12
  - Read
12
- token_pilot_version: "0.23.0"
13
- token_pilot_body_hash: 1850e394b726f6975177a1f4cbb9153fa49cb263355c068f1924a2f625bea4b4
13
+ token_pilot_version: "0.23.1"
14
+ token_pilot_body_hash: a740dc6c928d11d7c2c5fbaa953c50b0e35f2abc2dd6e5ef5117bf469a2d0207
14
15
  ---
15
16
 
16
17
  You are a token-pilot agent (`tp-<name>`). Your defining contract:
@@ -27,7 +28,7 @@ Response budget: ~800 tokens.
27
28
 
28
29
  When asked to audit a file / module / whole repo:
29
30
 
30
- 1. Start with `code_audit` — cheap first pass for TODO/FIXME/XXX with author + age metadata. Flag items older than 90 days or missing an owner.
31
+ 1. Start with `code_audit` — cheap first pass for TODO/FIXME/XXX with author + age metadata. Flag items older than 90 days or missing an owner. For config / policy files (`.env.example`, YAML, JSON), `read_section` by key — NOT whole-file `smart_read`.
31
32
  2. For each high-risk concern, Grep the precise pattern across scope:
32
33
  - Secrets: `(?i)(api[_-]?key|secret|password|token)\s*[:=]\s*["'][^"']{8,}` + `AKIA[0-9A-Z]{16}` + `-----BEGIN.*PRIVATE KEY-----`
33
34
  - Injection shapes: raw string concat into `exec`/`query`/`eval`/`Function(`, shell metachars in `spawn`/`system`
@@ -7,7 +7,7 @@ tools:
7
7
  - mcp__token-pilot__test_summary
8
8
  - mcp__token-pilot__outline
9
9
  - Bash
10
- token_pilot_version: "0.23.0"
10
+ token_pilot_version: "0.23.1"
11
11
  token_pilot_body_hash: 559a0b61d20974bf33e35bc4c80dcf1b41d10d4df46cf9d05d3d5620713cd46f
12
12
  ---
13
13
 
@@ -9,7 +9,7 @@ tools:
9
9
  - mcp__token-pilot__related_files
10
10
  - Grep
11
11
  - Read
12
- token_pilot_version: "0.23.0"
12
+ token_pilot_version: "0.23.1"
13
13
  token_pilot_body_hash: 482e33ba566dc75d87753d980267fb2e01763e5924612efd54ec89993b5e12fd
14
14
  ---
15
15
 
@@ -11,7 +11,7 @@ tools:
11
11
  - mcp__token-pilot__read_for_edit
12
12
  - Read
13
13
  - Bash
14
- token_pilot_version: "0.23.0"
14
+ token_pilot_version: "0.23.1"
15
15
  token_pilot_body_hash: 04864ae0bf0689863d7de9f4c0b44b293087b34098ad2771837e491d37dab953
16
16
  ---
17
17
 
@@ -9,7 +9,7 @@ tools:
9
9
  - mcp__token-pilot__outline
10
10
  - Bash
11
11
  - Read
12
- token_pilot_version: "0.23.0"
12
+ token_pilot_version: "0.23.1"
13
13
  token_pilot_body_hash: b2daca007e959eaf26bf9a4d92ba36c3aa277a51de4ca4db674833d36acbe11b
14
14
  ---
15
15
 
@@ -8,9 +8,11 @@ tools:
8
8
  - mcp__token-pilot__module_info
9
9
  - mcp__token-pilot__related_files
10
10
  - mcp__token-pilot__smart_read
11
+ - mcp__token-pilot__smart_read_many
12
+ - mcp__token-pilot__read_symbols
11
13
  - Read
12
- token_pilot_version: "0.23.0"
13
- token_pilot_body_hash: 3c09b7db1ae7224f5d72e88abfbfdbf1dd690c0fded261f4b6a805f8855ff877
14
+ token_pilot_version: "0.23.1"
15
+ token_pilot_body_hash: 0be2620ce0303f912f6b3334f261d169f064970c0d16602fa1e76db4cb2ea441
14
16
  ---
15
17
 
16
18
  You are a token-pilot agent (`tp-<name>`). Your defining contract:
@@ -29,7 +31,7 @@ When given a symbol, file, or change description:
29
31
 
30
32
  1. Locate the change surface via `read_symbol` or `outline` — never raw Read the whole file.
31
33
  2. Enumerate downstream dependents via `find_usages` (direct callers + one hop of transitive).
32
- 3. For each dependent, inspect only the relevant call site via `read_symbol` or bounded `Read(path, offset, limit)` to judge compatibility.
34
+ 3. For each dependent, inspect only the relevant call site via `read_symbol` or bounded `Read(path, offset, limit)` to judge compatibility. For multiple dependents in one file, `read_symbols` (batch) — NOT `read_symbol` in a loop. For structural view across many files at once, `smart_read_many`.
33
35
  4. Report the blast-radius as: one-line verdict → affected sites as `path:line` with compatibility judgment per site → any blind spots you could not resolve.
34
36
 
35
37
  Do NOT propose fixes. Do NOT paste source. Do NOT cross module boundaries beyond the second hop unless asked. Your only deliverable is the honest impact map.
@@ -7,10 +7,11 @@ tools:
7
7
  - mcp__token-pilot__related_files
8
8
  - mcp__token-pilot__outline
9
9
  - mcp__token-pilot__smart_read
10
+ - mcp__token-pilot__smart_read_many
10
11
  - Grep
11
12
  - Glob
12
- token_pilot_version: "0.23.0"
13
- token_pilot_body_hash: e687ecf7e2251c63c7a1da48316e7dc0e0acf84cc234afede2a98cef30e7e3d6
13
+ token_pilot_version: "0.23.1"
14
+ token_pilot_body_hash: cf32cdee777430ecc6732db32b3f883a685c8a02b6dc93379d71b15555e79b3e
14
15
  ---
15
16
 
16
17
  You are a token-pilot agent (`tp-<name>`). Your defining contract:
@@ -28,7 +29,7 @@ Response budget: ~800 tokens.
28
29
  When given a migration target (a symbol, API endpoint, pattern, or dependency to replace):
29
30
 
30
31
  1. Enumerate every reference via `find_usages` on the target — and on each direct alias if the symbol is re-exported.
31
- 2. For each file with ≥1 hit, `module_info` to note entrypoints/importers — migrations that break exported surface cost more.
32
+ 2. For files with ≥1 hit, batch through `smart_read_many` (up to 20 at a time) for structural view in one round-trip — NOT `smart_read` in a loop. Then `module_info` per file to note entrypoints/importers — migrations that break exported surface cost more.
32
33
  3. Group findings by effort class: **trivial** (string replace), **local** (one-symbol refactor), **cross-file** (signature change), **needs design** (semantic mismatch).
33
34
  4. Flag hidden consumers with `related_files` on high-traffic targets — tests, fixtures, docs often get missed.
34
35
  5. Deliver: file-by-file checklist as `path:line — effort — reason` sorted by effort class, then a rollout suggestion (safe order).
@@ -7,8 +7,10 @@ tools:
7
7
  - mcp__token-pilot__related_files
8
8
  - mcp__token-pilot__outline
9
9
  - mcp__token-pilot__smart_read
10
- token_pilot_version: "0.23.0"
11
- token_pilot_body_hash: 2a4747a72609cbbca9d2060e7cd892a2533eee1e3b909f7e6742c080621ded50
10
+ - mcp__token-pilot__smart_read_many
11
+ - mcp__token-pilot__read_section
12
+ token_pilot_version: "0.23.1"
13
+ token_pilot_body_hash: ae0b86eaffaf34bf283b94b5572481fa8c2d6a2a25193f1173b70bef0fbe1919
12
14
  ---
13
15
 
14
16
  You are a token-pilot agent (`tp-<name>`). Your defining contract:
@@ -25,8 +27,8 @@ Response budget: ~600 tokens.
25
27
 
26
28
  When asked to orient a caller to an unfamiliar codebase:
27
29
 
28
- 1. Start with `project_overview` to establish the top-level layout, language mix, and entry points. Do not Read individual files first.
29
- 2. For each named area of interest (or the top 2–3 by size if none named), use `explore_area` to enumerate the modules inside, then `outline` on the one or two most load-bearing files.
30
+ 1. Start with `project_overview` to establish the top-level layout, language mix, and entry points. Do not Read individual files first. For `README.md` / `CONTRIBUTING.md` / `ARCHITECTURE.md`, use `read_section` with the relevant heading — NOT `smart_read` on the whole doc.
31
+ 2. For each named area of interest (or the top 2–3 by size if none named), use `explore_area` to enumerate the modules inside, then `outline` on the one or two most load-bearing files. For multiple load-bearing files, `smart_read_many` as a batch (up to 20) instead of `smart_read` in a loop.
30
32
  3. For cross-module understanding, use `related_files` on an entry point to map its direct dependents.
31
33
  4. Report: one-line verdict on "how the repo is organised" → a short bulleted tour of the top 3–5 areas with `path:line` anchors to entry points → where a newcomer should start reading next.
32
34
 
@@ -6,10 +6,12 @@ tools:
6
6
  - mcp__token-pilot__outline
7
7
  - mcp__token-pilot__find_usages
8
8
  - mcp__token-pilot__read_symbol
9
+ - mcp__token-pilot__read_symbols
10
+ - mcp__token-pilot__smart_read_many
9
11
  - mcp__token-pilot__read_for_edit
10
12
  - Read
11
- token_pilot_version: "0.23.0"
12
- token_pilot_body_hash: 85f8212852dba3f6b34872f1694633ff6522543b2e01318f8dab36dda59e8ac6
13
+ token_pilot_version: "0.23.1"
14
+ token_pilot_body_hash: eb9fb7f87d9ab61c5b18248a40b283008b5d73414ddb2e3094ff0826e7e463d0
13
15
  ---
14
16
 
15
17
  You are a token-pilot agent (`tp-<name>`). Your defining contract:
@@ -27,7 +29,7 @@ Response budget: ~600 tokens.
27
29
  When reviewing a changeset (diff, commit range, or PR):
28
30
 
29
31
  1. Load the structural diff via `smart_diff` — never raw Read the full touched files first.
30
- 2. For each changed symbol of substance, `outline` its containing file and, if needed, `read_symbol` to inspect only the changed block.
32
+ 2. For each changed symbol of substance, `outline` its containing file. For multiple symbols in the same file, `read_symbols` (one call) NOT a loop of `read_symbol`. For multiple touched files at once, `smart_read_many` before drilling in.
31
33
  3. For changes to exported / public surface, run `find_usages` to verify no cross-file breakage.
32
34
  4. Report: one-line verdict (`approve` / `request changes` / `block`) → **Critical:** findings that must be fixed → **Important:** findings the author should address → silence on stylistic nits that pass the project's linter.
33
35
 
@@ -7,7 +7,7 @@ tools:
7
7
  - mcp__token-pilot__read_diff
8
8
  - mcp__token-pilot__outline
9
9
  - mcp__token-pilot__read_symbol
10
- token_pilot_version: "0.23.0"
10
+ token_pilot_version: "0.23.1"
11
11
  token_pilot_body_hash: a058518619fd6e2def0c9226f6c70438a5e0a80efe680c935414ecd7e1b14a4f
12
12
  ---
13
13
 
@@ -15,7 +15,7 @@ tools:
15
15
  - Grep
16
16
  - Glob
17
17
  - Bash
18
- token_pilot_version: "0.23.0"
18
+ token_pilot_version: "0.23.1"
19
19
  token_pilot_body_hash: d665d57085db38077d0eeab74bda8bdb84c9ad59688495486059af5d3fac67cf
20
20
  ---
21
21
 
@@ -4,10 +4,12 @@ description: Rehydrates session state after /clear, compaction, or a fresh windo
4
4
  tools:
5
5
  - mcp__token-pilot__smart_read
6
6
  - mcp__token-pilot__read_range
7
+ - mcp__token-pilot__read_section
8
+ - mcp__token-pilot__session_budget
7
9
  - Bash
8
10
  - Read
9
- token_pilot_version: "0.23.0"
10
- token_pilot_body_hash: 88ccd78695eacf1216021d450be00873f2b7546d1603a3b03d55720ca1c7e83a
11
+ token_pilot_version: "0.23.1"
12
+ token_pilot_body_hash: 35b7f333a28c94e7dc89fcc3171703c4b466225f55cd5c701b7592f4f6486440
11
13
  ---
12
14
 
13
15
  You are a token-pilot agent (`tp-<name>`). Your defining contract:
@@ -24,13 +26,15 @@ Response budget: ~400 tokens.
24
26
 
25
27
  When invoked at the start of a continuation (post-/clear, post-compaction, fresh window on a mid-flight task):
26
28
 
27
- 1. Read `.token-pilot/snapshots/latest.md` via `smart_read`. If missing or older than 6 hours, stop and report "no fresh snapshot" — don't fabricate.
28
- 2. Check git context: `git status --short` + `git log -1 --oneline` + current branch. One-line view.
29
- 3. List saved research: `ls .token-pilot/docs/*.md` — count + newest 3 names only, do NOT read their bodies.
30
- 4. Parse the snapshot's `**Goal:**` / `**Decisions:**` / `**Next:**` sections. Cap Decisions at top 3; keep Next verbatim.
31
- 5. Deliver a compact briefing in this shape exactly:
29
+ 1. Read `.token-pilot/snapshots/latest.md` via `read_section` (section `Session State`) — NOT `smart_read` on the whole file. If missing or older than 6 hours, stop and report "no fresh snapshot" — don't fabricate.
30
+ 2. Check session budget: `session_budget` with the current Claude Code `session_id` if available. One-line view of burn fraction + time-to-compact projection — helps the main agent decide how aggressive to be from here.
31
+ 3. Check git context: `git status --short` + `git log -1 --oneline` + current branch. One-line view.
32
+ 4. List saved research: `ls .token-pilot/docs/*.md` count + newest 3 names only, do NOT read their bodies.
33
+ 5. Parse the snapshot's `**Goal:**` / `**Decisions:**` / `**Next:**` sections. Cap Decisions at top 3; keep Next verbatim.
34
+ 6. Deliver a compact briefing in this shape exactly:
32
35
  ```
33
36
  Resuming: <goal>
37
+ Budget: <burnFraction*100>% burned, ~<eventsUntilExhaustion> events left (or "unknown" if no session_id)
34
38
  Branch: <branch> (<dirty|clean>) · last commit: <sha> <msg>
35
39
  Decisions so far: <top 3 bullets>
36
40
  Next step: <verbatim from snapshot>
@@ -7,7 +7,7 @@ tools:
7
7
  - mcp__token-pilot__read_range
8
8
  - mcp__token-pilot__find_usages
9
9
  - mcp__token-pilot__read_symbol
10
- token_pilot_version: "0.23.0"
10
+ token_pilot_version: "0.23.1"
11
11
  token_pilot_body_hash: 255912c47661d203c8f9a735237bc419f97e937f788a01811bbe126ee3dd5878
12
12
  ---
13
13
 
@@ -12,7 +12,7 @@ tools:
12
12
  - Write
13
13
  - Edit
14
14
  - Bash
15
- token_pilot_version: "0.23.0"
15
+ token_pilot_version: "0.23.1"
16
16
  token_pilot_body_hash: 533b3d2387e631a24291314b2b8ad8c3e01c19e0b9ec1d3fe08ae0011f0c73f9
17
17
  ---
18
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "token-pilot",
3
- "version": "0.23.0",
3
+ "version": "0.23.1",
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",