---
title: "token-optimizer"
url: "https://claudemods.dev/zh-cn/builds/token-optimizer-063691"
source: "https://github.com/alexgreensh/token-optimizer/tree/main/desktop/token-optimizer-desktop"
source_type: "github"
repo: "https://github.com/alexgreensh/token-optimizer/tree/main/desktop/token-optimizer-desktop"
author: "alexgreensh"
author_handle: "alexgreensh"
stars: 3193
category: "仪表盘与 HUD"
categories: ["hud"]
tags: ["claude-code", "context-management", "desktop", "hooks", "status-bar", "token-optimizer"]
permission_level: 3
scan_complete: true
install: "claude plugin marketplace add alexgreensh/token-optimizer\nclaude plugin install token-optimizer"
added: "2026-10-05T17:30:15.722Z"
updated: "2026-11-29T05:54:28Z"
locale: "zh-cn"
content_locale: "zh-cn"
---

# token-optimizer

Claude 桌面应用的状态栏。它显示在提示符上方，展示会话质量、上下文填充量、缓存倒计时，以及 5 小时和每周限额，并让 Clawd 演示会话正在进行的操作。

## Description

# Token Optimizer Desktop

Claude 桌面应用的状态栏。它显示在提示符上方，展示会话质量、上下文填充量、缓存倒计时，以及 5 小时和每周限额，并让 Clawd 演示会话正在进行的操作。

## Install

它随 Token Optimizer plugin 一起提供（`hooks/hooks.json` 会在 `modules` 下指定此文件夹的 `hooks/register.tsx`），因此无需额外安装。此文件夹保留自己的 manifest，只是为了让测试可以通过 `claude plugin test` 独立运行。

需要 Claude Code 2.1.287 或更高版本，以及 Anthropic 的 mods 功能。Anthropic 可以远程关闭 mods；关闭时不会出现故障，只是状态栏不显示。终端会保留现有状态列。不支持 VS Code。

## What you get

- 一句话说明最紧急的事情，最多带一个按钮。
- 五个带悬停卡片的标记：质量等级、上下文填充量、缓存倒计时、5 小时限额、每周限额。
- **Clawd 旁边的箭头**会展开另一行：分支、会话时间、工具调用、压缩次数（有的话）、上一个检查点保存的时间（任何类型，或更早会话中的相关检查点），以及 Token Optimizer 在最近 30 天为你节省的 token 数量，也就是仪表板显示的同一总数。
- 按钮：**Clean up**（按照 Token Optimizer 的指导进行压缩）、**Start fresh**（第二次点击会保存检查点、清除内容，并将它交给你的第一条消息）、**Keep warm**（手动一键刷新缓存，仅在缓存处于 warm 状态时可用，从不自动执行，会消耗少量用量）。

缓存倒计时只是估算值：Claude 套餐为 1 小时，API 为 5 分钟；如果可能，会从会话本身开始计时。

## Settings

在 `~/.claude/settings.json` 的 `env` 区块中设置 `TOKEN_OPTIMIZER_STATUS_BAR=0` 可隐藏状态栏，设置 `TOKEN_OPTIMIZER_STATUS_BAR_ANIMATE=0` 可让 Clawd 保持静止。

## Full docs

请参阅 [Token Optimizer README](../../README.md#desktop-status-bar) 和文档站页面「Claude desktop app」。

## Install

```
claude plugin marketplace add alexgreensh/token-optimizer
claude plugin install token-optimizer
```

## Original README

# Token Optimizer Desktop

A status bar for the Claude desktop app. It draws above your prompt and shows session quality, context fill, cache countdown, and your 5-hour and weekly limits, with Clawd acting out what the session is doing.

## Install

It ships inside the Token Optimizer plugin (`hooks/hooks.json` names this folder's `hooks/register.tsx` under `modules`), so there is nothing extra to install. This folder keeps its own manifest only so its tests run on their own with `claude plugin test`.

Needs Claude Code 2.1.287 or newer and Anthropic's mods feature. Anthropic can switch mods off remotely; when off, nothing breaks and the bar just does not appear. The terminal keeps its existing status line. VS Code is not supported.

## What you get

- One sentence about the most urgent thing, with at most one button.
- Five marks with hover cards: quality grade, context fill, cache countdown, 5-hour limit, weekly limit.
- The **arrow beside Clawd** unfolds one more line: branch, session time, tool calls, compactions (when any), when the last checkpoint was saved (any kind, or a relevant one from an earlier session), and the tokens Token Optimizer saved you in the last 30 days, the same total the dashboard shows.
- Buttons: **Clean up** (compacts with Token Optimizer's guidance), **Start fresh** (second click saves a checkpoint, clears, and hands it to your first message), **Keep warm** (manual one-click cache refresh, only while the cache is warm, never automatic, uses a small amount of usage).

The cache countdown is an estimate: 1 hour on Claude plans, 5 minutes on the API, measured from the session itself when possible.

## Settings

`TOKEN_OPTIMIZER_STATUS_BAR=0` hides the bar and `TOKEN_OPTIMIZER_STATUS_BAR_ANIMATE=0` keeps Clawd still, set in the `env` block of `~/.claude/settings.json`.

## Full docs

See the [Token Optimizer README](../../README.md#desktop-status-bar) and the docs site page "Claude desktop app".
