Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
},
"metadata": {
"description": "Token Pilot — save 60-90% tokens when AI reads code",
"version": "0.53.0"
"version": "0.53.1"
},
"plugins": [
{
"name": "token-pilot",
"source": "./",
"description": "Reduces token consumption by 60-90% via AST-aware lazy file reading, structural symbol navigation, and cross-session tool-usage analytics. 25 MCP tools + 25 subagents + budget watchdog hooks.",
"version": "0.53.0",
"version": "0.53.1",
"author": {
"name": "Digital-Threads"
},
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "token-pilot",
"version": "0.53.0",
"version": "0.53.1",
"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.",
"author": {
"name": "Digital-Threads",
Expand Down
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,58 @@ All notable changes to Token Pilot will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.53.1] - 2026-09-29

### Fixed — in a git worktree, relative paths read the main checkout's file

The MCP server fixes its project root once, at start-up (`CLAUDE_PROJECT_DIR`).
A session that then moves into a git worktree — `cd .worktrees/feature`, the
layout superpowers, keel and Claude Code's own worktrees use — kept having
relative paths resolved against the main checkout. token-pilot returned the same
file from a different branch, and the header printed the path as given, so
nothing showed it. Reported from a real session on a payment code path during a
rebase; reproduced on a throwaway repository, where after `cd .worktrees/wt`
`smart_read("a.ts")` returned the main checkout's line.

Claude Code runs hooks in the session's current directory and applies a
PreToolUse `updatedInput` to MCP calls — both verified live on 2.1.281. A new
PreToolUse hook on token-pilot's own tools uses that: when the session is in a
different checkout from the server, relative `path` / `paths` arguments are
resolved against the checkout the session is in. In the server's own checkout
it prints nothing, so ordinary sessions do not change. It runs from its own
small entry point — 23 ms per call instead of the ~200 ms that loading the whole
CLI would cost, which matters for a hook that fires on every token-pilot call.

Tools that look past one file — the symbol index behind `find_usages`,
`project_overview` and the like, git history and diffs, test runs — still answer
from the server's checkout. In a worktree session they now arrive with a note
saying so, instead of passing for the worktree's answer. Following the worktree
fully, with a per-worktree index, is the next step.

Verified live: in a nested worktree `smart_read("a.ts")` returns the worktree's
file, and `project_overview` arrives with the note.

### Fixed — files in a sibling worktree were rejected as outside the project

A worktree checked out beside the main one (`git worktree add ../feature`) is
the same repository, but the project-root guard rejected every absolute path
into it — including the absolute-path workaround for the bug above. Other
worktrees of the same repository are allowed now, read from `git worktree list`
and re-read when one appears mid-session. The session's own checkout keeps its
old boundary, so a sub-project root does not gain the rest of the repository.
Verified live: the same absolute read fails on 0.53.0 with "resolves outside
project root" and returns the file on this build.

Claude Code resets a Bash `cd` that leaves the project directory, so a session
does not move into a sibling worktree that way; absolute paths or `--add-dir`
are how it gets there, and both work now.

### Fixed — two new production advisories

`fast-uri` 4.1.3 (GHSA-qw65-cvwx-89v3, high) and `ip-address` 10.3.1
(GHSA-rpw4-54j3-4h4q, moderate), both pulled in by the MCP SDK. Pinned to
`^4.2.1` and `^10.7.2` through `overrides`.

## [0.53.0] - 2026-09-24

### Added — Codex CLI runs token-pilot's hooks
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-api-surface-tracker.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ tools:
- mcp__plugin_token-pilot_token-pilot__read_symbol
- Bash
model: sonnet
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: f20579d4721dbb9211ea94adcb6262e76d36750e9d9c2eec83d198db98e1d8f7
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-audit-scanner.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tools:
- Grep
- Read
model: sonnet
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: 31bc131ec88a40f94f20b545ac4e5c5559d37e6d81f5e768c481769a49f3a28b
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-commit-writer.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tools:
- mcp__token-pilot__outline
- mcp__plugin_token-pilot_token-pilot__outline
- Bash
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: f0fdec971f1fc12d774a74e757acb7831a0385762f9714309479ab9a44d9aa24
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-context-engineer.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tools:
- Edit
- Glob
model: sonnet
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: 19a193b8202865c99eb4d54dba0cf5c8afb99df77fc74f991495a3ff68c4cf27
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-dead-code-finder.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tools:
- Grep
- Read
model: sonnet
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: 72c51f526484ace08be2c79c44450d5de9d0f51d99ffde0ce0ccce6f14fa0415
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-debugger.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tools:
- Read
- Bash
model: sonnet
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: 5cec1bb0ff6a28e996614d9e319560391f4c139f2753b2ee45467a0289a13d8d
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-dep-health.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tools:
- Bash
- Read
model: sonnet
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: 5533ec3366065d5656dc460b25eaf4e39fe8b7804d7e2770540be9b3f6fdfae5
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-doc-writer.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tools:
- Edit
- Glob
model: sonnet
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: bbe89cc465fc628031b9001b5a3548bd4e95c7cbaf013ee1496e3cc3b0511c7b
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-history-explorer.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tools:
- Bash
- Read
model: haiku
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: 90d6b77e94dad6e624f8b8e3c4f2b14b2112860a571fd0f889a58ee247fcbde8
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-impact-analyzer.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tools:
- mcp__plugin_token-pilot_token-pilot__read_symbols
- Read
model: sonnet
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: 302cb6d4458c652327da21d86b87c204ed55287a4e52df82afc43cbbde263132
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-incident-timeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tools:
- mcp__plugin_token-pilot_token-pilot__read_symbol
- Bash
model: sonnet
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: a9a77ecb395c3e450dc576a5dedc251403a9286ef65a3c35f6fd563890e6b9d6
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-incremental-builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tools:
- Edit
- Bash
model: sonnet
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: 42994592e976d289e6fcfdc63f6b8927b8da687ffff3019f7d84ad199d34ef37
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-migration-scout.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tools:
- Grep
- Glob
model: sonnet
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: 803f29087c516d7609036e7932876904d05aa38b3d0e5d52831497ec4bc0d25d
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-onboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tools:
- mcp__plugin_token-pilot_token-pilot__smart_read_many
- mcp__token-pilot__read_section
- mcp__plugin_token-pilot_token-pilot__read_section
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: 71c58863be8bbf987898b65848f1ec48e4ae8d15d852ae477fba3297a7da2e43
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-performance-profiler.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tools:
- Bash
- Read
model: sonnet
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: 51b53ae4989c66e648d4928bdbd6fa3c63e803e2119692d6dc880aad2d1f5d67
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-pr-reviewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tools:
- mcp__plugin_token-pilot_token-pilot__read_for_edit
- Read
model: sonnet
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: 8d63ae4af07d84fa35d096e39c1221be5e1cce640db81da703d29d68ff437ba6
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-refactor-planner.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tools:
- mcp__token-pilot__read_symbol
- mcp__plugin_token-pilot_token-pilot__read_symbol
model: sonnet
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: c446649eb78a57bfd7803db7022f7335f8d18f5f3629bab7389974b957c416df
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-review-impact.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ tools:
- mcp__plugin_token-pilot_token-pilot__module_info
- Bash
model: sonnet
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: f61b8570d8a04393a0dc9e38fccbf30ab2ecdb1a05c819dd3a69730e2bf8a24c
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ tools:
- WebSearch
- Bash
model: sonnet
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: 4d62b5ef6fb0a466dda5a6dcb82f0c189ad0f9338211397897d1b94a0f33910f
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-session-restorer.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tools:
- mcp__plugin_token-pilot_token-pilot__session_budget
- Bash
- Read
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: bd214ebbf0cdf47f7bab17fbaf269b39bc71aaa2f67c8b81c27571893cd03bbf
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-ship-coordinator.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tools:
- Read
- Grep
model: sonnet
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: 97555d5815dd5af2b7e25867ae437b91bec8af01c461a96c4a143cb2bfc18fae
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-spec-writer.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tools:
- Read
- Write
model: sonnet
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: c3d2ea33ecc7fc5f054e40d4e5bffb505584bdd9e2c921689de39b8385341ca0
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-test-coverage-gapper.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tools:
- mcp__plugin_token-pilot_token-pilot__test_summary
- Glob
- Grep
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: 02a4d1eada766d3a088f61cbc3d47dff234cef24a821c2c0038df443b7370bee
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-test-triage.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ tools:
- mcp__token-pilot__read_symbol
- mcp__plugin_token-pilot_token-pilot__read_symbol
model: sonnet
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: 75416eb77005c13b8811bd254cab9330ea85ec5833a15c065ba1789952356ac7
requiredMcpServers:
- "token-pilot"
Expand Down
2 changes: 1 addition & 1 deletion agents/tp-test-writer.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tools:
- Edit
- Bash
model: sonnet
token_pilot_version: "0.53.0"
token_pilot_version: "0.53.1"
token_pilot_body_hash: af29103c16cf852b9fb70b06a373575104e59782d2ea03584cb6a077c972cc90
requiredMcpServers:
- "token-pilot"
Expand Down
19 changes: 19 additions & 0 deletions docs/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,22 @@ shell, which the `Bash` rules already cover), and both `apply_patch` and
`spawn_agent` carry payloads that differ from Claude Code's `Edit` and `Agent`
— the read-gate and the routing hook would be reasoning about fields that are
not there.

## Git worktrees

The MCP server resolves relative paths against the project root it started
with. When a session moves into a git worktree (`cd .worktrees/feature`), a
PreToolUse hook on token-pilot's own tools resolves relative `path` / `paths`
arguments against the checkout the session is actually in, so reads return the
worktree's file rather than the same file from the main checkout. In the
server's own checkout the hook prints nothing.

Tools that look past a single file — the symbol index behind `find_usages`,
`project_overview` and similar, git history and diffs, test runs — still answer
from the server's checkout. In a worktree session they arrive with a note
saying so.

Absolute paths into another worktree of the same repository are accepted, so a
sibling checkout (`git worktree add ../feature`) can be read directly. Claude
Code resets a Bash `cd` that leaves the project directory, so absolute paths or
`--add-dir` are how a session reaches a sibling worktree.
9 changes: 9 additions & 0 deletions hooks/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@
"command": "sh \"${CLAUDE_PLUGIN_ROOT}/hooks/run.sh\" hook-pre-task"
}
]
},
{
"matcher": "mcp__(plugin_token-pilot_)?token-pilot__.*",
"hooks": [
{
"type": "command",
"command": "node \"${CLAUDE_PLUGIN_ROOT}/dist/hooks/hook-mcp-path.js\""
}
]
}
],
"SessionStart": [
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading