digital-threads avatar

Token Pilot

digital-threads/token-pilot

Adds AST-aware file reading tools to cut context consumption by 80-90% when Claude works with code. Instead of loading entire files, you get `smart_read` for structural outlines, `read_symbol` to pull individual functions by name, and `read_for_edit` to see only what matters before a change. PreToolUse hooks intercept expensive native operations like recursive grep or large file reads and redirect them to token-efficient alternatives. Works across TypeScript, Python, Go, Rust, and ten other languages. Ships with 25 subagents for Claude Code that enforce response budgets and prefer MCP tools over heavy bash commands. Pairs well with caveman for output compression and context-mode for sandboxed execution. Best for large codebases where you hit context limits fast.

GitHub stars
5
tools
3
transport
STDIO
last updated
Nov 6, 2026

Tools

3 tools

Public tool metadata for what this MCP can expose to an agent.

smart_readAsk for an outline or load one function by name instead of the whole file.

Ask for an outline or load one function by name instead of the whole file.

No parameter schema in public metadata yet.

read_symbol

No parameter schema in public metadata yet.

read_for_edit

No parameter schema in public metadata yet.

Sponsors

Readme

Token Pilot

Token-efficient AI coding, enforced. Cuts context consumption in AI coding assistants by up to 90% without changing the way you work.

Why it matters more now: as frontier models move up in price, the tokens you don't spend reading code are worth more, not less. The savings are in tokens; the value is in tokens × price. Token Pilot keeps the expensive main thread lean so the premium model spends its budget on reasoning, not on re-reading files.

Two layers, each useful on its own, stronger together:

  1. MCP tools — structural reads (smart_read, read_symbol, read_for_edit, …). Ask for an outline or load one function by name instead of the whole file.
  2. PreToolUse hooks — intercept heavy native tool calls (Read on large files, recursive Grep, unbounded git diff) and redirect to token-efficient alternatives.

How It Works

Traditional:  Read("user-service.ts")  →  500 lines  →  ~3000 tokens
Token Pilot:  smart_read("user-service.ts")  →  15-line outline  →  ~200 tokens
              read_symbol("UserService.updateUser")  →  45 lines  →  ~350 tokens
              After edit: read_diff("user-service.ts")  →  ~20 tokens

View the full README on GitHub

Details

Repository
github.com/digital-threads/token-pilot
Package
token-pilot
Transport
STDIO
Registry
MCP registry, active