プロトタイプ · プレビュー版:公式レジストリのすべてのサーバーを掲載し、30分ごとに同期しています。Google でログインするとレビューを書けます。プロトタイプ · 30分ごとに更新
PopNx MCPAIを使う人のためのMCPサーバー · やさしい言葉で解説

Token Savior

作者:Mibayyバージョン 4.13.0i★ 1,219iパソコンで動く
レジストリ名io.github.Mibayy/token-savior

インストール方法

What it does

Structural codebase MCP server with persistent memory: navigate by symbol, recall across sessions.

  • Connects パソコンで動く
  • Account or key Needs TOKEN_SAVIOR_PROFILE · 1 setting to fill in (WORKSPACE_ROOTS)
  • Category 検索・AIの記憶

インストール

使っているAIアプリを選んで、設定をコピーしてください。

チェック 3/3 合格 · あなたのパソコンで動きます · ✓ コマンド確認済み 2026年11月14日

まず:どの AI を使っていますか?

使っているアプリを選ぶと、下に手順が表示されます。

Claude につなげますが、先に準備が必要です

Token Savior のキーが必要です(提供元のサイトで作成) · 設定を 1 項目入力 (WORKSPACE_ROOTS) · 先にパソコンへ Python (uv) を入れてください(1 回だけ) · パソコン版 Claude アプリ(Windows または Mac)のみ。Web やスマホでは使えません

  1. Python (uv) を入れる

    1 回だけ。Python (uv) が必要なすべてのサーバーで使えます

    Python (uv) のダウンロードページを開く ↗

  2. Token Savior に登録してキーを作る

    提供元のサイトで登録し、次の手順で使う API キーを作ります。料金や無料プランは提供元のサイトで確認してください。

    キーの取り方は下の提供元 README にあります

  3. 設定を 1 項目入力

    これはプログラムの設定でキーではありません。登録は不要で、作者の説明どおりに入力します。

    • WORKSPACE_ROOTS インデックスを作成するプロジェクトルートの絶対パスのリスト(カンマ区切り)。
      英語の原文を見るComma-separated list of absolute paths to project roots to index.

    説明は自動翻訳です。変数名は原文のままです。迷ったら原文を確認してください。

  4. パソコン版 Claude アプリの設定ファイルを開く

    SettingsDeveloperEdit Config

  5. この設定を貼り付けて保存

    {
      "mcpServers": {
        "token-savior": {
          "command": "uvx",
          "args": [
            "token-savior-recall"
          ],
          "env": {
            "WORKSPACE_ROOTS": "your-value",
            "TOKEN_SAVIOR_PROFILE": "your-value"
          }
        }
      }
    }

    キーはアプリの入力欄にだけ貼り付け、チャットに貼ったり人に送ったりしないでください

  6. Claude を終了してもう一度開く

  7. 試してみる

    Token Savior を使って、私に何ができるか教えて、1 つやってみせて

    ✓ Claude が Token Savior を使っていると言うか、回答に Token Savior のツール名が出れば接続成功です

追加の設定 1 項目(入力しなくても使えます)

上のコマンドはこれらがなくても動きます。変えたいときだけ作者の説明に沿って追加してください。

  • TOKEN_SAVIOR_CLIENT 利用状況の帰属に使うオプションのクライアント識別子(例: 'claude-code'、'cursor'、'hermes')。
    英語の原文を見るOptional client identifier (e.g. 'claude-code', 'cursor', 'hermes') for usage attribution.

説明は自動翻訳です。変数名は原文のままです。迷ったら原文を確認してください。

メニュー名は 2026年11月11日 に Anthropic のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

ChatGPT はまだ Token Savior につなげません

Token Savior はパソコンに入れて使うものですが、ChatGPT は Web 上で動くサーバーにしかつなげません

代わりにできること

A · Token Savior につなげるアプリを使う

  • Token Savior のキーが必要です(提供元のサイトで作成) · 設定を 1 項目入力 (WORKSPACE_ROOTS) · 先にパソコンへ Python (uv) を入れてください(1 回だけ) · パソコン版 Claude アプリ(Windows または Mac)のみ。Web やスマホでは使えません
  • Token Savior のキーが必要です(提供元のサイトで作成) · 設定を 1 項目入力 (WORKSPACE_ROOTS) · 先にパソコンへ Python (uv) を入れてください(1 回だけ)
  • Token Savior のキーが必要です(提供元のサイトで作成) · 設定を 1 項目入力 (WORKSPACE_ROOTS) · 先にパソコンへ Python (uv) を入れてください(1 回だけ)
  • Token Savior のキーが必要です(提供元のサイトで作成) · 設定を 1 項目入力 (WORKSPACE_ROOTS) · 先にパソコンへ Python (uv) を入れてください(1 回だけ)

B · 検索・AIの記憶 の中で ChatGPT につなげる別のサーバー

同じカテゴリでよく使われているものから、キーなしでアドレスだけでつなげるものを選びました

Claude Code につなげますが、先に準備が必要です

Token Savior のキーが必要です(提供元のサイトで作成) · 設定を 1 項目入力 (WORKSPACE_ROOTS) · 先にパソコンへ Python (uv) を入れてください(1 回だけ)

  1. Python (uv) を入れる

    1 回だけ。Python (uv) が必要なすべてのサーバーで使えます

    Python (uv) のダウンロードページを開く ↗

  2. Token Savior に登録してキーを作る

    提供元のサイトで登録し、次の手順で使う API キーを作ります。料金や無料プランは提供元のサイトで確認してください。

    キーの取り方は下の提供元 README にあります

  3. 設定を 1 項目入力

    これはプログラムの設定でキーではありません。登録は不要で、作者の説明どおりに入力します。

    • WORKSPACE_ROOTS インデックスを作成するプロジェクトルートの絶対パスのリスト(カンマ区切り)。
      英語の原文を見るComma-separated list of absolute paths to project roots to index.

    説明は自動翻訳です。変数名は原文のままです。迷ったら原文を確認してください。

  4. ターミナルを開く

    Mac:Command+スペースで Terminal と入力 · Windows:PowerShell を開く

  5. このコマンドを貼り付けて Enter

    claude mcp add --scope user token-savior --env WORKSPACE_ROOTS=your-value --env TOKEN_SAVIOR_PROFILE=your-value -- uvx token-savior-recall

    Enter の前に「your-value」を自分のキーに書き換えてください

    キーはアプリの入力欄にだけ貼り付け、チャットに貼ったり人に送ったりしないでください

  6. Claude Code で /mcp と入力

    Token Savior が一覧にあり、接続済みと表示されれば OK です

  7. 試してみる

    Token Savior を使って、私に何ができるか教えて、1 つやってみせて

    ✓ Claude Code が Token Savior を使っていると言うか、回答に Token Savior のツール名が出れば接続成功です

追加の設定 1 項目(入力しなくても使えます)

上のコマンドはこれらがなくても動きます。変えたいときだけ作者の説明に沿って追加してください。

  • TOKEN_SAVIOR_CLIENT 利用状況の帰属に使うオプションのクライアント識別子(例: 'claude-code'、'cursor'、'hermes')。
    英語の原文を見るOptional client identifier (e.g. 'claude-code', 'cursor', 'hermes') for usage attribution.

説明は自動翻訳です。変数名は原文のままです。迷ったら原文を確認してください。

メニュー名は 2026年11月11日 に Anthropic のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

Cursor につなげますが、先に準備が必要です

Token Savior のキーが必要です(提供元のサイトで作成) · 設定を 1 項目入力 (WORKSPACE_ROOTS) · 先にパソコンへ Python (uv) を入れてください(1 回だけ)

  1. Python (uv) を入れる

    1 回だけ。Python (uv) が必要なすべてのサーバーで使えます

    Python (uv) のダウンロードページを開く ↗

  2. Token Savior に登録してキーを作る

    提供元のサイトで登録し、次の手順で使う API キーを作ります。料金や無料プランは提供元のサイトで確認してください。

    キーの取り方は下の提供元 README にあります

  3. 設定を 1 項目入力

    これはプログラムの設定でキーではありません。登録は不要で、作者の説明どおりに入力します。

    • WORKSPACE_ROOTS インデックスを作成するプロジェクトルートの絶対パスのリスト(カンマ区切り)。
      英語の原文を見るComma-separated list of absolute paths to project roots to index.

    説明は自動翻訳です。変数名は原文のままです。迷ったら原文を確認してください。

  4. このボタンで Cursor を開く

    Cursor で開く

    Cursor がインストールの確認をするので Install を押します

  5. キーを入力

    Token Savior の設定で TOKEN_SAVIOR_PROFILE, WORKSPACE_ROOTS が空です。自分のキーを入れて保存します

    キーはアプリの入力欄にだけ貼り付け、チャットに貼ったり人に送ったりしないでください

  6. Cursor の AI チャットを Agent モードで開く

  7. 試してみる

    Token Savior を使って、私に何ができるか教えて、1 つやってみせて

    ✓ Cursor が Token Savior を使っていると言うか、回答に Token Savior のツール名が出れば接続成功です

追加の設定 1 項目(入力しなくても使えます)

上のコマンドはこれらがなくても動きます。変えたいときだけ作者の説明に沿って追加してください。

  • TOKEN_SAVIOR_CLIENT 利用状況の帰属に使うオプションのクライアント識別子(例: 'claude-code'、'cursor'、'hermes')。
    英語の原文を見るOptional client identifier (e.g. 'claude-code', 'cursor', 'hermes') for usage attribution.

説明は自動翻訳です。変数名は原文のままです。迷ったら原文を確認してください。

メニュー名は 2026年11月11日 に Cursor のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

VS Code につなげますが、先に準備が必要です

Token Savior のキーが必要です(提供元のサイトで作成) · 設定を 1 項目入力 (WORKSPACE_ROOTS) · 先にパソコンへ Python (uv) を入れてください(1 回だけ)

  1. Python (uv) を入れる

    1 回だけ。Python (uv) が必要なすべてのサーバーで使えます

    Python (uv) のダウンロードページを開く ↗

  2. Token Savior に登録してキーを作る

    提供元のサイトで登録し、次の手順で使う API キーを作ります。料金や無料プランは提供元のサイトで確認してください。

    キーの取り方は下の提供元 README にあります

  3. 設定を 1 項目入力

    これはプログラムの設定でキーではありません。登録は不要で、作者の説明どおりに入力します。

    • WORKSPACE_ROOTS インデックスを作成するプロジェクトルートの絶対パスのリスト(カンマ区切り)。
      英語の原文を見るComma-separated list of absolute paths to project roots to index.

    説明は自動翻訳です。変数名は原文のままです。迷ったら原文を確認してください。

  4. このボタンで VS Code を開く

    VS Code で開く

    VS Code がインストールの確認をするので Install を押します

  5. キーを入力

    Token Savior の設定で TOKEN_SAVIOR_PROFILE, WORKSPACE_ROOTS が空です。自分のキーを入れて保存します

    キーはアプリの入力欄にだけ貼り付け、チャットに貼ったり人に送ったりしないでください

  6. VS Code の AI チャットを Agent モードで開く

  7. 試してみる

    Token Savior を使って、私に何ができるか教えて、1 つやってみせて

    ✓ VS Code が Token Savior を使っていると言うか、回答に Token Savior のツール名が出れば接続成功です

追加の設定 1 項目(入力しなくても使えます)

上のコマンドはこれらがなくても動きます。変えたいときだけ作者の説明に沿って追加してください。

  • TOKEN_SAVIOR_CLIENT 利用状況の帰属に使うオプションのクライアント識別子(例: 'claude-code'、'cursor'、'hermes')。
    英語の原文を見るOptional client identifier (e.g. 'claude-code', 'cursor', 'hermes') for usage attribution.

説明は自動翻訳です。変数名は原文のままです。迷ったら原文を確認してください。

メニュー名は 2026年11月11日 に VS Code のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

Windsurf、Zed、Gemini CLI など MCP を使える他のアプリは追加方法がそれぞれ違います。アプリ一覧で確認してください

MCP を使えるアプリをすべて見る →

JSON 設定は下の「開発者向け」にあります

つまずいたら?Token Savior を使っている人に聞いてみましょう💬 ディスカッション →
開発者向け:ターミナルのコマンドと JSON 設定

パソコンにインストール

Claude Code

claude mcp add --scope user token-savior --env WORKSPACE_ROOTS=your-value --env TOKEN_SAVIOR_PROFILE=your-value -- uvx token-savior-recall

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "token-savior": {
      "command": "uvx",
      "args": [
        "token-savior-recall"
      ],
      "env": {
        "WORKSPACE_ROOTS": "your-value",
        "TOKEN_SAVIOR_PROFILE": "your-value"
      }
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "token-savior": {
      "command": "uvx",
      "args": [
        "token-savior-recall"
      ],
      "env": {
        "WORKSPACE_ROOTS": "your-value",
        "TOKEN_SAVIOR_PROFILE": "your-value"
      }
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "token-savior": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "token-savior-recall"
      ],
      "env": {
        "WORKSPACE_ROOTS": "your-value",
        "TOKEN_SAVIOR_PROFILE": "your-value"
      }
    }
  }
}

自分で入力する値

  • WORKSPACE_ROOTS 必須 env
    インデックスを作成するプロジェクトルートの絶対パスのリスト(カンマ区切り)。
    英語の原文を見るComma-separated list of absolute paths to project roots to index.
  • TOKEN_SAVIOR_CLIENT 秘密 env
    利用状況の帰属に使うオプションのクライアント識別子(例: 'claude-code'、'cursor'、'hermes')。
    英語の原文を見るOptional client identifier (e.g. 'claude-code', 'cursor', 'hermes') for usage attribution.
  • TOKEN_SAVIOR_PROFILE 秘密 必須 env
    Manifest size. 'optimized' (recommended) advertises the Pareto-optimal 15-tool set; 'auto' sizes it from your own usage; 'full' advertises every tool; 'compact-only' if you already run symbol navigat…

説明は自動翻訳です。変数名は原文のままです。迷ったら原文を確認してください。

この設定は、作者のレジストリ登録情報から作成しています。READMEと違う場合は、READMEに従ってください。

ひと目でわかる

週あたりのダウンロードi
585/週
接続方法
パソコンで動く
最新バージョンi
4.13.0
レジストリ公開日i
2026年7月26日
コードの最終更新i
2026年10月15日
作者
Mibayy
パッケージ
pypi: token-savior-recall
レジストリでの状態
有効

使えるアプリ

このサーバーのつなぎ方と、各アプリの公式ドキュメントに基づきます。2026年11月10日に確認。

パソコン上で動かせるアプリ

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

すべてのアプリと長所・短所 →

できること

パソコンで動くサーバーです。インストールすると、ツール一覧がAIアプリに表示されます。

基本チェックi

誰でも見られる情報をチェックしており、コードは読んでいません。当てはまらない項目は数に入れていません。 · 2026年11月14日にチェック

  • ✓ 合格

    作者とリポジトリが一致

    レジストリ名は、リポジトリを所有するGitHubアカウント Mibayy で確認済みです

  • ✓ 合格

    今もメンテナンスされている

    コードの最終更新:30 日前

  • ✓ 合格

    ライセンスがある

    MITを使用

  • – 対象外

    エンドポイントが応答する

    これはパソコンで動くため、インターネット上のエンドポイントはありません

  • – 対象外

    OAuthでサインイン

    パソコンで動き、代わりにローカルの設定を使います

  • … 未チェック

    ツールの説明に隠れた指示がない

    パソコンで動くサーバーです。ツール一覧を読み取れるのは、インターネット上のエンドポイントがある場合だけです

話し合い

質問、コツの共有、使えないことの報告ができます。「役に立った」の多い順です。

まだ投稿はありません。最初の質問や共有をどうぞ。

ここの投稿は利用者によるもので、PopNx チームのものではありません。

Google でログインして投稿

ユーザーレビュー

まだレビューはありません

Google でログインしてレビューを書く

検索・AIの記憶のほかのサーバーとの比較i

  • このカテゴリのほかの6096件のうち99%よりスターが多い
  • このカテゴリのほかの6096件のうち23%より最近レジストリに公開
  • 基本チェックの結果が、このカテゴリのほかの6096件のうち100%と同じかそれ以上

レジストリでこのカテゴリにある有効なすべてのサーバーと比較しています。スターは、公開者がリポジトリの所有者である場合だけ数えます。

よくある質問

Token Saviorは安全ですか?

当てはまる基本チェック3項目のうち3項目に合格しました。コードは読んでいません。キーやトークンを追加する前に、サーバーがどんなアクセスを求めているかを確認し、必要な権限だけを持つキーを使ってください。

どんなキーやコードが必要ですか?

入力が必要なもの:TOKEN_SAVIOR_PROFILE

パソコンで動きますか、それともクラウドですか?

あなたのパソコンで動きます。必要なときにAIアプリが起動し、データは作者のサーバーを通りません(サーバー自体がオンラインサービスを呼び出す場合を除きます)。

今もメンテナンスされていますか?

GitHubリポジトリの最終更新は30 日前、最新バージョン(4.13.0)がレジストリに届いたのは4 か月前です。

どのアプリで使えますか?

Claude Desktop、Claude Code、Cursor、VS CodeなどのMCP対応アプリで使えます。パソコンにPython (uv)も必要です。

代わりに使えるものは?

同じカテゴリには:Context7, Codebase Memory, OpenSEO

同じカテゴリのほかの候補

同じカテゴリで、ほかの作者が作ったサーバー。スターの多い順。

カードの見方:↓ 週あたりのダウンロードi★ GitHubスターi3つの柱:レビュー · チェック · 利用状況i更新=最新バージョンをレジストリに公開した日i

Context7

Up-to-date docs for AI agents

作者:upstash広く使われている↓ 125万/週★ 6.5万一昨日更新

パソコンでもクラウドでも

Codebase Memory

Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.

作者:DeusData広く使われている↓ 1.7万/週★ 4.9万28 日前更新

パソコンで動く

OpenSEO

Keyword research, site audits, rank tracking and AI visibility for your AI agent.

作者:every-app広く使われている★ 2.8万今日更新

クラウドで動く✓ everyapp.com

作者のREADME

READMEを開く

作者のリポジトリから書かれたとおりにコピーしたものです。PopNx MCPは内容を確認・推奨していません。HTML、画像、スクリプトは取り除いています。リンクはこのサイトの外へ移動します。

Token Savior

One MCP server. One profile. 97.9% on tsbench at -80% tokens.

Structural code navigation, persistent memory, and Bash command rewriting for AI coding agents.

[mibayy.github.io/token-savior](https://mibayy.github.io/token-savior/) -- project site + benchmark landing Benchmark source + fixtures: not currently published (see *Reproducing the score* below)

v4.23 in 31 seconds, measured on 2026-10-07 · watch the full video (MP4, sound on)


Benchmark -- 96 real coding tasks (Claude Opus 4.7, May 2026)
Plain Claude CodeWith Token Savior
Score141 / 180 (78.3%)188 / 192 (97.9%)
Active tokens / task17 2213 395 (-80%)
Wall time / task110.6 s18.9 s (-83%)

Reproduces with the optimized profile (single env var). The harness that produced these numbers is described below; its repository is not public at the moment, so take the figures as reported rather than as independently verifiable.

A re-measurement was published here on 2026-08-09 and has been withdrawn on 2026-08-10. It reported new-token savings from a small replacement harness. Those numbers did not measure this server at all: across 143 benchmark sessions, exactly one called a Token Savior tool. The client running the harness had MCP deferred-tool loading enabled, so all 18 tools sat behind a ToolSearch lookup instead of appearing in the model's manifest. The model never saw them and fell back to Grep and Read — 66 greps, 30 reads, one MCP call. What varied between the "profiles" was the size of the cached prefix, not what the agent did.

The lesson is worth more than the numbers were: a benchmark of an MCP server must assert that its tools were actually called. Ours did not, so it happily compared two identical agents. That assertion now exists in the harness.

The headline figures above therefore stand as reported and unverified, as stated in the previous paragraph.

Re-measured on 2026-10-07, with the tools actually called. Same 8 tasks on a frozen copy of this repo (commit 9d15a1e, no CLAUDE.md), Claude Haiku 4.5, plain Claude Code against the auto profile with alwaysLoad. The harness checks that the Token Savior sessions really called the server.

3 passes, mean ± sdPlain Claude Codev4.23.0 `auto`
Cost, 8 tasks$0.226 ± 0.011$0.123 ± 0.020 (-45%, range -39% to -53%)
New tokens92 609 ± 6 73138 150 ± 7 618 (-59%)
Sessions that used TS—23 / 24
Wall time, 8 tasks157 ± 26 s216 ± 9 s (+40%)

All 48 sessions succeeded. v4.22.0, measured once, saved 14% and used the tools in 5 sessions out of 8. Editing, measured on 2026-10-08 on the same repository (3 tasks in files of 1 900 to 3 700 lines, graded by running the code and the module's tests, 4 passes): every session of both arms succeeded, and cost is too noisy to call a gain (from -54% to +16% per pass). Native Edit only needs a partial Read, so there is little left to remove there.

Wall time is worse because each benchmark session starts a fresh server that indexes the repo first; a long-lived session pays that once. What moved from v4.22.0 to v4.23.0 is mostly wording: search_codebase now names the function holding each hit, and the tool descriptions say plainly which native call they replace.


Who starred this repo?

On June 30, 2026 GitHub restricted stargazer and watcher lists to repo admins and collaborators, which broke every "who starred my repo" tool at once. I rebuilt one that still works, precisely because it only reads repos you own or can push to: [starscope](https://starscope.duckdns.org) ranks the people who starred or forked your repo by influence, and surfaces their social accounts when their GitHub profile declares them.

Numbers on this very repo, computed with it: 1,147 people, 27% with a public social account, and the most followed carries 18,922 followers. The named list is visible to the repo owner and to nobody else — the public page shows aggregates only.


What's new

Release notes live where they can't drift out of sync with the code:


Quick start

pip install "token-savior-recall[mcp]"

Add to your MCP config (e.g. Claude Code):

{

"mcpServers": { "token-savior-recall": { "command": "/path/to/venv/bin/token-savior", "alwaysLoad": true, "env": { "WORKSPACE_ROOTS": "/path/to/project1,/path/to/project2", "TOKEN_SAVIOR_CLIENT": "claude-code", "TOKEN_SAVIOR_PROFILE": "optimized" } } } }

`"alwaysLoad": true` matters on Claude Code (2.1.28x and later): without it, every tool of the server sits behind ToolSearch and the model reaches for Read and Grep, which are already loaded. Measured on this project's benchmark before the option existed: one session in 143 called a Token Savior tool. With it, the manifest costs a few thousand cached tokens per session.

That's it. `TOKEN_SAVIOR_PROFILE=optimized` ships the Pareto-optimum config that wins tsbench. It bundles:

  • tiny_plus (15 hot tools manifest)
  • thin inputSchema (-44% manifest)
  • capture sandbox disabled
  • memory hooks gated for cross-project safety

No other tuning needed.


Activation (Bash compaction + rewriting)

Bash compaction and the PreToolUse rewriter are opt-in. Two env vars and one CLI call:

export TS_BASH_COMPACT=1       # PostToolUse output compactors (34 of them)

export TS_BASH_REWRITE=1 # PreToolUse command rewriter (10 rules)

ts init --agent claude --yes # auto-merge hooks into ~/.claude/settings.json

ts init is idempotent. It detects existing hook entries, dedups by (matcher, command), prints a unified diff, and backs up settings.json to .bak-YYYYMMDD-HHMMSS (UTC) before writing. Supported agents: claude, cursor, gemini, codex, openclaw. Pass --dry-run to preview, or --global to write the user-level config.

Optional audit log of every rewrite:

export TS_BASH_REWRITE_LOG=$HOME/.local/state/token-savior/rewrites.jsonl

Compactor catalog (34)

FamilyCompactors
gitstatus, diff, log, push/pull, commit, add, fetch, checkout, branch, worktree list, stash list
ghrun list, run view, pr diff, pr view, issue view, repo view
test/lintpytest, jest, vitest, eslint, biome, cargo test, cargo build/clippy, tsc
cloudkubectl get, kubectl logs, aws sts, aws ec2, aws lambda, aws logs, aws iam, aws dynamodb, aws s3
dockerdocker ps, docker logs
packagingnpm/yarn/pnpm list, pip list/show
shell catch-allsgrep, find, cat, curl

Each compactor is a pure function (no I/O, no globals) returning a token-efficient rendering. The dispatcher returns None when no matcher fires, leaving the existing sandbox path untouched. Compound commands (cd ... && cmd) fall through to the last meaningful segment.

These run in PostToolUse, so they do not shrink the current turn. The

hook fires after the tool has returned; it can add context, not remove it.

The compact rendering is appended below the raw output, which stays. What

you gain is persistence: the full output goes to the capture sandbox and

outlives a context compaction. For an actual reduction of what reaches the

model, use the PreToolUse rewriter (TS_BASH_REWRITE=1) — it edits the

command before it runs.


ts_discover -- find missed TS opportunities

New MCP tool that scans your Claude Code transcripts for patterns where TS tools would have been cheaper than what the agent actually did.

ts_discover()                       # active project, last 30 days

ts_discover(project=None) # ALL transcript projects ts_discover(format="adoption") # TS vs native ratio per session ts_discover(format="adoption_json") # same, JSON

Findings: Read->Grep->Read chains, sequential find_symbol, edits without get_edit_context, memory_search without memory_index, native shell on code files. Args are pruned to load-bearing keys (PII-safe). Streams JSONL with mtime fast-skip.


ts init CLI

ts init --agent claude [--global] [--dry-run] [--yes]

ts init --agent cursor ts init --agent gemini ts init --agent codex ts init --agent openclaw

Detects the target agent's settings location, deep-merges the Token Savior hook config (PostToolUse + PreToolUse), preserves existing hooks, dedups, prints a unified diff. Backs up to settings.json.bak-YYYYMMDD-HHMMSS (UTC). Re-running is a no-op.


What it does

Claude Code reads whole files to answer questions about three lines, and forgets everything the moment a session ends. Token Savior fixes both, plus a third axis: it bounds the noisy Bash output that bloats turn budgets between code reads — by rewriting the command before it runs.

It indexes your codebase by symbol -- functions, classes, imports, call graph -- so the model navigates by pointer instead of by cat. Measured reduction: 97% fewer chars injected across 170+ real sessions.

On top of that sits a persistent memory engine. Every decision, bugfix, convention, guardrail and session rollup is stored in SQLite WAL + FTS5

  • vector embeddings, ranked by Bayesian validity and ROI, and

re-injected as a compact delta at the start of the next session.

And on top of *that*, since v4.1, sit the Bash compactors and the PreToolUse rewriter. Bench numbers above.

Which of those two actually shrinks a turn, and which does not. Measured 2026-08-09, and worth stating plainly because the distinction is not obvious:

  • The PreToolUse rewriter changes the command *before* it runs, so a smaller output is produced and a smaller output reaches the model. This is a real reduction in the current turn.
  • The PostToolUse compactors run *after* the tool has returned. A PostToolUse hook can only *add* context; by the time it fires, the raw output has already been sent. The compact rendering is appended, it does not replace anything. What the compactors genuinely buy you is different and still valuable: the full output is preserved in the capture sandbox and survives a context compaction, so it can be queried later instead of being re-run.

If your goal is a smaller turn, TS_BASH_REWRITE=1 is the switch that does it. If your goal is to stop losing command o

冒頭だけを表示しています。続きはリポジトリで読めます