ClaudeMods
☰
ZH-CN
● 0 人在线 · 浏览 0 次
赞助提交作品
GitHub 仓库 · 发布者 MohamedEmbarak

token-face

一个显示在提示列上方的 Claude Code mod。context window 越满,脸的样子就越诡异。

MohamedEmbarak@MohamedEmbarak

MohamedEmbarak/token-face/tree/main/plugins/token-face

已翻译

关于这个 mod

token-face

一个显示在提示列上方的 Claude Code mod。context window 越满,脸的样子就越诡异。

(•_•) Crowded  61% · 610.1k / 1M  ▁ ▂ ▃ ▄ ▅  ▲ +6.4k last turn

显示内容

  • 显示一张脸和一条说明,表示 context window 的占用程度:

    | 已使用 context | 说明 | 图片 | |---|---|---| | under 25% | Fresh | <img src="faces/1.png" width="64" alt="Stage 1 picture"> | | 25–39% | Fine | <img src="faces/1.png" width="64" alt="Stage 1 picture"> | | 40–64% | Crowded | <img src="faces/2.png" width="64" alt="Stage 2 picture"> | | 65–89% | Too much | <img src="faces/3.png" width="64" alt="Stage 3 picture"> | | 90% and up | COMPACT. NOW. | <img src="faces/4.png" width="64" alt="Stage 4 picture"> |

  • 显示百分比和已使用的 token,例如 134.4k / 200k。

  • 显示最近 12 个回合的图表,每根柱状条使用该回合所处阶段的颜色。

  • 显示上一个回合增加了多少内容,或者压缩移除了多少内容。

每个回合结束后都会更新,压缩完成后也会立即更新。

在桌面应用中,脸是一张图片。在终端中,它是类似 (•_•) 的文字脸。

安装

/plugin marketplace add MohamedEmbarak/token-face
/plugin install token-face@token-face

这个 mod 建立在 Claude Code 的 function hooks 上。如果安装后提示列上方没有显示任何内容,请把下面这一项加入 env 区块,再重新启动 Claude Code:

"CLAUDE_CODE_ENABLE_FUNCTION_HOOKS": "1"

使用自己的图片

外掛附带 4 张图片,每个阶段一张,位于插件的 faces/ 文件夹中。要使用自己的图片,请替换它们:

| 文件 | context 处于该范围时显示 | |---|---| | 1.png | under 40% | | 2.png | 40–64% | | 3.png | 65–89% | | 4.png | 90% and up |

png、jpg、jpeg、gif 或 webp,每张约低于 85 KB 即可(128×128 已足够)。没有图片的阶段会保留绘制的脸。只能使用你制作或有权使用的图片。

开发

在此文件夹执行:

claude plugin validate .
claude plugin test .

许可证

MIT

安装

请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。

claude plugin marketplace add MohamedEmbarak/token-face
claude plugin install token-face
原文 / README

token-face

A Claude Code mod that puts a face above the prompt. The fuller your context window gets, the worse the face looks.

(•_•) Crowded  61% · 610.1k / 1M  ▁ ▂ ▃ ▄ ▅  ▲ +6.4k last turn

What it shows

  • A face and a caption for how full the context window is:

    | Context used | Caption | Picture | |---|---|---| | under 25% | Fresh | <img src="faces/1.png" width="64" alt="Stage 1 picture"> | | 25–39% | Fine | <img src="faces/1.png" width="64" alt="Stage 1 picture"> | | 40–64% | Crowded | <img src="faces/2.png" width="64" alt="Stage 2 picture"> | | 65–89% | Too much | <img src="faces/3.png" width="64" alt="Stage 3 picture"> | | 90% and up | COMPACT. NOW. | <img src="faces/4.png" width="64" alt="Stage 4 picture"> |

  • The percentage and tokens used, like 134.4k / 200k.

  • A chart of the last 12 turns, each bar in the colour of the stage that turn was in.

  • How much the last turn added, or how much a compaction removed.

It updates after every turn, and straight after a compaction.

In the desktop app the face is a picture. In a terminal it is a text face such as (•_•).

Install

/plugin marketplace add MohamedEmbarak/token-face
/plugin install token-face@token-face

The mod is built on Claude Code's function hooks. If nothing shows above the prompt after installing, add this to the env block of ~/.claude/settings.json and restart Claude Code:

"CLAUDE_CODE_ENABLE_FUNCTION_HOOKS": "1"

Use your own pictures

The mod ships with four pictures, one per stage, in the plugin's faces/ folder. To use your own, replace them:

| File | Shown when context is | |---|---| | 1.png | under 40% | | 2.png | 40–64% | | 3.png | 65–89% | | 4.png | 90% and up |

png, jpg, jpeg, gif or webp, each under about 85 KB (128×128 is plenty). A stage without a picture keeps its drawn face. Only use pictures you made or have the right to use.

Develop

From this folder:

claude plugin validate .
claude plugin test .

Licence

MIT

更多类似作品