TokenPak

Release

TokenPak v1.18.3

v1.18.3 · Aug 7, 2026

This compatible patch reduces the token overhead the companion itself adds to agent sessions and makes the session label robust to host-side control-byte sanitization.

Changed

  • The lean companion profile now advertises only core MCP tools. Advertised tool schemas are re-sent to the model with every request, so under TOKENPAK_COMPANION_PROFILE=lean the MCP server's tools/list response includes only the recall, compression, and journal tools (load_pak, prune_context, journal_read, journal_write, vault_search, vault_retrieve). Accounting and diagnostic tools (estimate_tokens, check_budget, session_info) and the deprecated load_capsule alias remain fully callable — dispatch is not filtered — but their schemas no longer ride every request; hooks cover cost estimation and budget enforcement out-of-band in all profiles. The balanced (default) and verbose profiles are unchanged. Two verbose tool descriptions were also shortened.

  • Companion guidance no longer directs agents to spend model turns on accounting. Cost estimation and budget enforcement happen automatically in the pre-send hook, and session summaries in the stop hook, so the generated Codex AGENTS.md section, the Claude launcher system-prompt fragment, and the estimate_tokens / check_budget MCP tool descriptions now say to reserve explicit tool calls for genuine decisions instead of recommending them before reads and multi-step tasks. Each avoided call saves a full model round-trip that would re-send the whole conversation. The Codex AGENTS.md managed section also shrinks to roughly a third of its former size while keeping the complete tool inventory and behavioral rules.

  • estimate_tokens MCP results are compacted. The tool now returns tokens, chars, and a short estimator disclosure instead of echoing the full HTTP payload, because tool results persist in the conversation and are re-billed as input on every subsequent turn. The heuristic-fallback disclosure remains (as chars/4-approx plus a brief install hint), and the /tpk/v1/tokens/estimate HTTP response is unchanged.

  • Release-workflow and leak-gate hardening. The delta leak gate consults the canonical pattern-register set, the private-path scan exempts only the exact documented vault-index default segment, and the release workflow quotes its step-output sink and guards its checksum globs.

Fixed

  • The companion session label is plain text. The styled label embedded terminal escape bytes in a value rendered by the host CLI; a host update began sanitizing control bytes in that surface, displaying the sequences as literal text. A session name is data rendered by another program — styling now stays on the companion's own terminal streams.

Upgrade

python -m pip install --upgrade "tokenpak==1.18.3"

No data migration is required.

Rollback

python -m pip install --upgrade "tokenpak==1.18.2"

Compatibility

  • No breaking change. The Python public-symbol set gains one additive companion helper (active_tools); no symbol is removed or changed. HTTP contracts, TIP wire formats, and storage schemas are unchanged.
  • Configurations not opting into the lean companion profile see no behavioral change.