Zoria-Lind

Cc Token Optimizer — AI skill for Claude Code

AI community

Cut your Claude Code token bill: tool-output trimming, read dedup, model-tier discipline, and live cost + cache-hit stats.

How to install Cc Token Optimizer

This entry records only its repository, not the path inside it, so there is no exact command to give. Open Zoria-Lind/cc-token-optimizer and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Cc Token Optimizer does

Cut your Claude Code token bill: tool-output trimming, read dedup, model-tier discipline, and live cost + cache-hit stats.

Alternatives in AI

  • Squeez — Hook-based token compressor for 5 AI CLI hosts (Claude Code, Copilot CLI, OpenCode, Gemini CLI, Codex CLI) 188 ★
  • GPT 6 Astra Skill — Astra Skill Optimizer for GPT-6/Astra project Skill and workflow adaptation 117 ★
  • Coding Agent Account Manager — Sub-100ms auth switching for AI coding CLIs (Claude Code, Codex, Gemini): swap subscription accounts instantly 111 ★

README

cc-token-optimizer

**English** · [中文](README.zh-CN.md)

[![Listed on ClaudePluginHub](https://www.claudepluginhub.com/badge/zoria-lind-cc-token-optimizer-plugin)](https://www.claudepluginhub.com/plugins/zoria-lind-cc-token-optimizer-plugin)

A Claude Code plugin that cuts what a session actually burns — read de-duplication, output trimming, cache-stall nudges, and a live **token** / cache-hit bar above the prompt. It reports **tokens only**: no cost estimate, deliberately (see *What the numbers mean*).

/plugin install cc-token-optimizer --marketplace Zoria-Lind/cc-token-optimizer

One command to install: no `settings.json` edits, no Node. Claude Code 2.1.275+ (developed and tested against **2.1.296**).

Install

It asks whether to add the marketplace (`y`), then for a scope — `user` applies it to every session. Nothing else to set up:

  • The eight hook registrations live in the plugin itself (plugin/hooks/tokenGuard.ts; the status bar and /token-status are registered in plugin/hooks/register.tsx), and load with it.
  • There are two stores, with different lifetimes:
    • The hook layer's guard-state (read records, trim counters, tier facts) lives in the host's plugin KV — /plugins/store/cc-token-optimizer*.json — so it survives across sessions and hot reloads. It is not $.state (v0.2.0 shipped that mistake; fixed in 0.2.1).
    • The token ledger behind the status bar and /token-status (rounds, tokens, the last turn's growth) lives in $.state, which is session-scoped by design: it survives a hot reload, but a new session or /clear starts from zero. Its figures mean this session, not a lifetime total.
  • Config is read from the plugin's own config.json; a missing or corrupt file falls back to built-in defaults instead of erroring.

Update:

/plugin marketplace update zoria-plugins
/plugin update cc-token-optimizer@zoria-plugins

Turning it off — the `/plugin` manager (disable or uninstall), or from a shel