token-pilot 0.23.2 → 0.23.3
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/CHANGELOG.md +21 -0
- package/dist/agents/tp-audit-scanner.md +2 -2
- package/dist/agents/tp-commit-writer.md +2 -2
- package/dist/agents/tp-dead-code-finder.md +2 -2
- package/dist/agents/tp-debugger.md +2 -2
- package/dist/agents/tp-history-explorer.md +2 -2
- package/dist/agents/tp-impact-analyzer.md +2 -2
- package/dist/agents/tp-migration-scout.md +2 -2
- package/dist/agents/tp-onboard.md +2 -2
- package/dist/agents/tp-pr-reviewer.md +2 -2
- package/dist/agents/tp-refactor-planner.md +2 -2
- package/dist/agents/tp-run.md +2 -2
- package/dist/agents/tp-session-restorer.md +2 -2
- package/dist/agents/tp-test-triage.md +2 -2
- package/dist/agents/tp-test-writer.md +2 -2
- package/dist/config/defaults.js +1 -1
- package/dist/hooks/session-start.js +14 -6
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "token-pilot",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.3",
|
|
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,27 @@ 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.3] - 2026-04-18
|
|
9
|
+
|
|
10
|
+
### Changed — PROACTIVELY triggers in every agent description + wider MANDATORY block
|
|
11
|
+
|
|
12
|
+
Live-testing on a real machine surfaced a concrete gap: Claude Code's main agent read the reminder, saw tool descriptions, but **systematically skipped tp-\* subagents** — no explicit `PROACTIVELY` trigger meant they sat unused even when the task fit. Also reported: "I see only 4 token-pilot tools in MANDATORY, not 14" — the agent didn't scan tool descriptions to discover the rest unless prompted.
|
|
13
|
+
|
|
14
|
+
Both fixes:
|
|
15
|
+
|
|
16
|
+
1. **Every `tp-*` description now carries `PROACTIVELY use this when …` or `Use this when …` plus concrete user-intent signals** ("when the user reports a bug", "when the user asks to review a diff"). Claude Code's auto-invocation heuristic looks for exactly these phrases. 14 agents rewritten.
|
|
17
|
+
|
|
18
|
+
2. **MANDATORY block expanded from 4 tools → 9 core tools** (smart_read, read_symbol, read_for_edit, outline, find_usages, smart_diff, smart_log, test_summary, project_overview) with `INSTEAD of` hints against raw Read/Grep/git. Still lists batch variants (read_symbols, smart_read_many, read_section) and names the remaining 10 under "Also available:" so the main agent sees the full surface even if it doesn't crawl descriptions.
|
|
19
|
+
|
|
20
|
+
3. **Default `sessionStart.maxReminderTokens` raised 250 → 500** to fit the expanded block without aggressive trimming. Token-wise: ~500 tokens is 0.3% of a 160K context window — the round-trip savings from one prevented raw Read pay it back ~5×.
|
|
21
|
+
|
|
22
|
+
### Updated
|
|
23
|
+
|
|
24
|
+
- `prompt-contract.test.ts` relaxed: descriptions may now be up to 350 chars and every agent is **required** to carry a trigger phrase (`PROACTIVELY …` or `Use this when …`). Old contract required "only tp-run uses PROACTIVELY" and ≤160 chars — removed.
|
|
25
|
+
|
|
26
|
+
### Numbers
|
|
27
|
+
- 906 tests green (+6 rewrites of contract + reminder tests; none removed), `tsc --noEmit` clean.
|
|
28
|
+
|
|
8
29
|
## [0.23.2] - 2026-04-18
|
|
9
30
|
|
|
10
31
|
### Changed — SessionStart reminder now carries a task→agent decision guide
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tp-audit-scanner
|
|
3
|
-
description:
|
|
3
|
+
description: Use this when the user asks for a security / quality audit, pre-release sweep, or "scan this for issues". Finds hardcoded secrets, injection shapes, unsafe casts, stale TODOs — classified Critical / Important / Minor. Read-only, NEVER edits, never quotes secrets in output.
|
|
4
4
|
tools:
|
|
5
5
|
- mcp__token-pilot__code_audit
|
|
6
6
|
- mcp__token-pilot__find_usages
|
|
@@ -10,7 +10,7 @@ tools:
|
|
|
10
10
|
- mcp__token-pilot__read_section
|
|
11
11
|
- Grep
|
|
12
12
|
- Read
|
|
13
|
-
token_pilot_version: "0.23.
|
|
13
|
+
token_pilot_version: "0.23.3"
|
|
14
14
|
token_pilot_body_hash: a740dc6c928d11d7c2c5fbaa953c50b0e35f2abc2dd6e5ef5117bf469a2d0207
|
|
15
15
|
---
|
|
16
16
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tp-commit-writer
|
|
3
|
-
description:
|
|
3
|
+
description: PROACTIVELY use this when the user is about to commit, asks "write a commit message", or says "commit this". Reads staged diff, verifies tests pass, drafts Conventional Commit. Refuses mixed diffs (asks to split), failing tests, or empty stage. Do NOT use to explain already-made commits.
|
|
4
4
|
tools:
|
|
5
5
|
- mcp__token-pilot__smart_diff
|
|
6
6
|
- mcp__token-pilot__smart_log
|
|
7
7
|
- mcp__token-pilot__test_summary
|
|
8
8
|
- mcp__token-pilot__outline
|
|
9
9
|
- Bash
|
|
10
|
-
token_pilot_version: "0.23.
|
|
10
|
+
token_pilot_version: "0.23.3"
|
|
11
11
|
token_pilot_body_hash: 559a0b61d20974bf33e35bc4c80dcf1b41d10d4df46cf9d05d3d5620713cd46f
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tp-dead-code-finder
|
|
3
|
-
description:
|
|
3
|
+
description: Use this when the user asks to find or remove dead / unused code ("clean up this file", "find unused exports", "pre-release cleanup"). Cross-checks find_unused with Grep, git history, and dynamic-lookup patterns before classifying. Output-only — NEVER deletes code itself.
|
|
4
4
|
tools:
|
|
5
5
|
- mcp__token-pilot__find_unused
|
|
6
6
|
- mcp__token-pilot__find_usages
|
|
@@ -9,7 +9,7 @@ tools:
|
|
|
9
9
|
- mcp__token-pilot__related_files
|
|
10
10
|
- Grep
|
|
11
11
|
- Read
|
|
12
|
-
token_pilot_version: "0.23.
|
|
12
|
+
token_pilot_version: "0.23.3"
|
|
13
13
|
token_pilot_body_hash: 482e33ba566dc75d87753d980267fb2e01763e5924612efd54ec89993b5e12fd
|
|
14
14
|
---
|
|
15
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tp-debugger
|
|
3
|
-
description:
|
|
3
|
+
description: PROACTIVELY use this when the user reports a bug, stack trace, error message, failing behaviour, or asks "why does X break / fail / throw". Traces root cause via call-tree without reading whole files first. Do NOT use for writing new features or planning changes.
|
|
4
4
|
tools:
|
|
5
5
|
- mcp__token-pilot__read_symbol
|
|
6
6
|
- mcp__token-pilot__find_usages
|
|
@@ -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.
|
|
14
|
+
token_pilot_version: "0.23.3"
|
|
15
15
|
token_pilot_body_hash: 04864ae0bf0689863d7de9f4c0b44b293087b34098ad2771837e491d37dab953
|
|
16
16
|
---
|
|
17
17
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tp-history-explorer
|
|
3
|
-
description:
|
|
3
|
+
description: PROACTIVELY use this when the user asks "why is this like this", "when was X added / changed", "who added Y", "what was the reason for this code". Returns the minimum commit chain that explains current state — no theorising beyond what commit messages say.
|
|
4
4
|
tools:
|
|
5
5
|
- mcp__token-pilot__smart_log
|
|
6
6
|
- mcp__token-pilot__smart_diff
|
|
@@ -9,7 +9,7 @@ tools:
|
|
|
9
9
|
- mcp__token-pilot__outline
|
|
10
10
|
- Bash
|
|
11
11
|
- Read
|
|
12
|
-
token_pilot_version: "0.23.
|
|
12
|
+
token_pilot_version: "0.23.3"
|
|
13
13
|
token_pilot_body_hash: b2daca007e959eaf26bf9a4d92ba36c3aa277a51de4ca4db674833d36acbe11b
|
|
14
14
|
---
|
|
15
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tp-impact-analyzer
|
|
3
|
-
description:
|
|
3
|
+
description: PROACTIVELY use this when the user asks "what will break if I change X", "who depends on this", or is about to modify a shared symbol / public API / widely-used function. Produces a blast-radius map of affected call sites. Does NOT propose fixes.
|
|
4
4
|
tools:
|
|
5
5
|
- mcp__token-pilot__read_symbol
|
|
6
6
|
- mcp__token-pilot__outline
|
|
@@ -11,7 +11,7 @@ tools:
|
|
|
11
11
|
- mcp__token-pilot__smart_read_many
|
|
12
12
|
- mcp__token-pilot__read_symbols
|
|
13
13
|
- Read
|
|
14
|
-
token_pilot_version: "0.23.
|
|
14
|
+
token_pilot_version: "0.23.3"
|
|
15
15
|
token_pilot_body_hash: 0be2620ce0303f912f6b3334f261d169f064970c0d16602fa1e76db4cb2ea441
|
|
16
16
|
---
|
|
17
17
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tp-migration-scout
|
|
3
|
-
description:
|
|
3
|
+
description: PROACTIVELY use this BEFORE the user starts any migration — replacing an API, upgrading a framework version, removing a deprecated symbol, switching libraries. Enumerates touch-points as an effort-classified checklist. Do NOT use during the migration itself (file-by-file edits).
|
|
4
4
|
tools:
|
|
5
5
|
- mcp__token-pilot__find_usages
|
|
6
6
|
- mcp__token-pilot__module_info
|
|
@@ -10,7 +10,7 @@ tools:
|
|
|
10
10
|
- mcp__token-pilot__smart_read_many
|
|
11
11
|
- Grep
|
|
12
12
|
- Glob
|
|
13
|
-
token_pilot_version: "0.23.
|
|
13
|
+
token_pilot_version: "0.23.3"
|
|
14
14
|
token_pilot_body_hash: cf32cdee777430ecc6732db32b3f883a685c8a02b6dc93379d71b15555e79b3e
|
|
15
15
|
---
|
|
16
16
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tp-onboard
|
|
3
|
-
description:
|
|
3
|
+
description: PROACTIVELY use this when the user is exploring an unfamiliar codebase — asks "how is this organised", "what does this project do", "where do I start reading", or starts any conversation in a repo the main agent doesn't know. Orientation map only (layout, entry points, modules); does NOT drill into implementation.
|
|
4
4
|
tools:
|
|
5
5
|
- mcp__token-pilot__project_overview
|
|
6
6
|
- mcp__token-pilot__explore_area
|
|
@@ -9,7 +9,7 @@ tools:
|
|
|
9
9
|
- mcp__token-pilot__smart_read
|
|
10
10
|
- mcp__token-pilot__smart_read_many
|
|
11
11
|
- mcp__token-pilot__read_section
|
|
12
|
-
token_pilot_version: "0.23.
|
|
12
|
+
token_pilot_version: "0.23.3"
|
|
13
13
|
token_pilot_body_hash: ae0b86eaffaf34bf283b94b5572481fa8c2d6a2a25193f1173b70bef0fbe1919
|
|
14
14
|
---
|
|
15
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tp-pr-reviewer
|
|
3
|
-
description:
|
|
3
|
+
description: PROACTIVELY use this when the user asks to review a diff, PR, commit range, or changeset ("review these changes", "look at my PR", "is this safe to merge"). Verdict-first output with Critical / Important findings. Do NOT use for writing code or planning.
|
|
4
4
|
tools:
|
|
5
5
|
- mcp__token-pilot__smart_diff
|
|
6
6
|
- mcp__token-pilot__outline
|
|
@@ -10,7 +10,7 @@ tools:
|
|
|
10
10
|
- mcp__token-pilot__smart_read_many
|
|
11
11
|
- mcp__token-pilot__read_for_edit
|
|
12
12
|
- Read
|
|
13
|
-
token_pilot_version: "0.23.
|
|
13
|
+
token_pilot_version: "0.23.3"
|
|
14
14
|
token_pilot_body_hash: eb9fb7f87d9ab61c5b18248a40b283008b5d73414ddb2e3094ff0826e7e463d0
|
|
15
15
|
---
|
|
16
16
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tp-refactor-planner
|
|
3
|
-
description:
|
|
3
|
+
description: PROACTIVELY use this when the user asks to "plan", "design", or "scope" a refactor, or says "I want to refactor X but need a plan first". Produces step-by-step plan with exact edit context; never applies changes itself.
|
|
4
4
|
tools:
|
|
5
5
|
- mcp__token-pilot__read_for_edit
|
|
6
6
|
- mcp__token-pilot__find_usages
|
|
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.
|
|
10
|
+
token_pilot_version: "0.23.3"
|
|
11
11
|
token_pilot_body_hash: a058518619fd6e2def0c9226f6c70438a5e0a80efe680c935414ecd7e1b14a4f
|
|
12
12
|
---
|
|
13
13
|
|
package/dist/agents/tp-run.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tp-run
|
|
3
|
-
description:
|
|
3
|
+
description: PROACTIVELY use this general-purpose token-pilot workhorse for ANY coding task (read / edit / search / explore) when no other tp-* specialist matches. Prefer token-pilot MCP tools over raw Read / Grep / git. Invoke when the user asks to touch code and no more specific specialist fits.
|
|
4
4
|
tools:
|
|
5
5
|
- mcp__token-pilot__smart_read
|
|
6
6
|
- mcp__token-pilot__read_symbol
|
|
@@ -15,7 +15,7 @@ tools:
|
|
|
15
15
|
- Grep
|
|
16
16
|
- Glob
|
|
17
17
|
- Bash
|
|
18
|
-
token_pilot_version: "0.23.
|
|
18
|
+
token_pilot_version: "0.23.3"
|
|
19
19
|
token_pilot_body_hash: d665d57085db38077d0eeab74bda8bdb84c9ad59688495486059af5d3fac67cf
|
|
20
20
|
---
|
|
21
21
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tp-session-restorer
|
|
3
|
-
description:
|
|
3
|
+
description: PROACTIVELY use this as the FIRST step after /clear, compaction, or a fresh window when a recent session_snapshot exists on disk. Reads snapshot + git status + saved docs, returns a ≤200-token briefing. Do NOT use mid-task.
|
|
4
4
|
tools:
|
|
5
5
|
- mcp__token-pilot__smart_read
|
|
6
6
|
- mcp__token-pilot__read_range
|
|
@@ -8,7 +8,7 @@ tools:
|
|
|
8
8
|
- mcp__token-pilot__session_budget
|
|
9
9
|
- Bash
|
|
10
10
|
- Read
|
|
11
|
-
token_pilot_version: "0.23.
|
|
11
|
+
token_pilot_version: "0.23.3"
|
|
12
12
|
token_pilot_body_hash: 35b7f333a28c94e7dc89fcc3171703c4b466225f55cd5c701b7592f4f6486440
|
|
13
13
|
---
|
|
14
14
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tp-test-triage
|
|
3
|
-
description:
|
|
3
|
+
description: PROACTIVELY use this when the user reports failing tests, asks to investigate a red CI, or says "these tests are broken / flaky". Identifies root cause and suggests minimal fix — no speculation. Do NOT use to write new tests (that's tp-test-writer).
|
|
4
4
|
tools:
|
|
5
5
|
- mcp__token-pilot__test_summary
|
|
6
6
|
- mcp__token-pilot__smart_read
|
|
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.
|
|
10
|
+
token_pilot_version: "0.23.3"
|
|
11
11
|
token_pilot_body_hash: 255912c47661d203c8f9a735237bc419f97e937f788a01811bbe126ee3dd5878
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tp-test-writer
|
|
3
|
-
description:
|
|
3
|
+
description: PROACTIVELY use this when the user asks to write, add, or cover a SPECIFIC function / method / class with tests ("add test for X", "cover Y"). Mirrors project's existing test style; runs the tests before declaring done. Do NOT use for diagnosing failures (that's tp-test-triage).
|
|
4
4
|
tools:
|
|
5
5
|
- mcp__token-pilot__read_symbol
|
|
6
6
|
- mcp__token-pilot__read_for_edit
|
|
@@ -12,7 +12,7 @@ tools:
|
|
|
12
12
|
- Write
|
|
13
13
|
- Edit
|
|
14
14
|
- Bash
|
|
15
|
-
token_pilot_version: "0.23.
|
|
15
|
+
token_pilot_version: "0.23.3"
|
|
16
16
|
token_pilot_body_hash: 533b3d2387e631a24291314b2b8ad8c3e01c19e0b9ec1d3fe08ae0011f0c73f9
|
|
17
17
|
---
|
|
18
18
|
|
package/dist/config/defaults.js
CHANGED
|
@@ -92,13 +92,21 @@ export async function scanAgents(projectRoot, homeDir) {
|
|
|
92
92
|
// ─── Message builder (subtask 2.3) ───────────────────────────────────────────
|
|
93
93
|
const MANDATORY_BLOCK = `[token-pilot active]
|
|
94
94
|
|
|
95
|
-
MANDATORY —
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
95
|
+
MANDATORY — use these BEFORE raw Read / Grep / git:
|
|
96
|
+
smart_read(path) — structural overview of a code file
|
|
97
|
+
read_symbol(path, sym) — one function / class body
|
|
98
|
+
read_for_edit(path, sym) — exact text for Edit's old_string
|
|
99
|
+
outline(path) — symbol list
|
|
100
|
+
find_usages(symbol) — who calls / uses a symbol (INSTEAD of Grep)
|
|
101
|
+
smart_diff — git diff structurally (INSTEAD of raw git diff)
|
|
102
|
+
smart_log(path?) — git log with symbol context (INSTEAD of raw git log)
|
|
103
|
+
test_summary(command) — test runs without dumping full output
|
|
104
|
+
project_overview — unfamiliar repo top-level map (first step)
|
|
100
105
|
Batch variants (prefer over loops): read_symbols, smart_read_many, read_section.
|
|
101
|
-
|
|
106
|
+
Also available: read_range, read_diff, module_info, related_files, explore_area,
|
|
107
|
+
code_audit, find_unused, session_snapshot, session_budget, session_analytics.
|
|
108
|
+
Raw Read/Grep allowed only with offset/limit / narrow regex / non-code files,
|
|
109
|
+
or TOKEN_PILOT_BYPASS=1.`;
|
|
102
110
|
const DECISION_GUIDE = `WHEN DELEGATING — if the task fits a specialist, use the Task tool:
|
|
103
111
|
bug / stack trace → tp-debugger
|
|
104
112
|
PR / diff review → tp-pr-reviewer
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "token-pilot",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.3",
|
|
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",
|