Agent skill

Token Optimizer

by alexgreensh in alexgreensh/token-optimizer

Audit a Claude Code or Codex setup for context-window waste, then fix it and measure the savings.

Custom licenceAuto-check passedAgent Workflows

Install Token Optimizer

skills CLI
$ npx skills add alexgreensh/token-optimizer --skill token-optimizer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install alexgreensh/token-optimizer token-optimizer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/alexgreensh/token-optimizer.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/token-optimizer .claude/skills/token-optimizer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
token-optimizer
GitHub stars
2.5k
Token cost
~3.6k tokens
SKILL.md length
1,468 words
Files
134 (incl. scripts, references, assets)
Skills in repo
6
Repo updated
First seen
Licence
Custom licence

At a glance

Audit a Claude Code or Codex setup for context-window waste, then fix it and measure the savings.

  • Works in 8 steps: Resolve measure.py, then gate on runtime… → Initialize (Claude Code) → 5: Keep-Warm Consent (first run only,… → …
  • Context feels tight
  • SKILL.md covers Step 0: Resolve measure.py,…, Phase 0: Initialize (Claude…, Phase 0.5: Keep-Warm Consent… and Phase 1: Quick Audit (Parallel…, plus 7 more sections
  • Calls python3, node and claude

What it does

Token Optimizer is an agent skill from alexgreensh/token-optimizer. Audit a Claude Code or Codex setup for context-window waste, then fix it and measure the savings. Use when context feels tight.

Its SKILL.md is about 3.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 134 other files, including scripts, reference files and assets.

It sits in Agent Workflows, covering Context engineering. The repository describes itself as: Find the ghost tokens. Fix them. Survive compaction. Avoid context quality decay.

When your agent uses it

  • Context feels tight
  • Tasks that involve Context engineering

Example prompts

  • “/token-optimizer”

Requirements

  • Python 3

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Resolve measure.py, then gate on runtime (run this first)
  2. Initialize (Claude Code)
  3. 5: Keep-Warm Consent (first run only, Claude Code)
  4. Quick Audit (Parallel Agents)
  5. Analysis
  6. Present Findings
  7. Implementation
  8. Verification

What it can do on your machine

Read from SKILL.md and the folder at commit 7c05b70. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/, which the agent can run.

    Shell commands in SKILL.md call:

    • python3
    • node
    • claude

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Token Optimizer loads about 3.6k tokens when it runs, and up to ~38k if it reads all its reference files. Until then it costs about 36 tokens; SKILL.md has 1,468 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~36
When it runs · the whole SKILL.md, loaded when a task matches
~3.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~38k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 1,468 words (~3,579 tokens).

“Audits a Claude Code or Codex setup, identifies context window waste, implements fixes, and measures savings.”

— opening of SKILL.md by alexgreensh, Custom licence
name
token-optimizer
effort
high

Read the full SKILL.md on GitHub

Files

SKILL.md and 133 other files (scripts, references, assets) in skills/token-optimizer of alexgreensh/token-optimizer.

  • SKILL.md
  • assets/active-compression-hero.svg
  • assets/automated-flow.svg
  • assets/bash-compression.svg
  • assets/before-after.svg
  • assets/dashboard-demo.gif
  • assets/dashboard-demo.mp4
  • assets/dashboard-overview.png
  • assets/dashboard.html
  • assets/delta-mode.svg
  • assets/fleet-demo.html
  • assets/hero-terminal.svg
  • assets/how-it-works.svg
  • assets/logo.svg
  • assets/logo.txt
  • assets/quality-example.svg
  • assets/quality-nudges-loops.svg
  • assets/real-savings.svg
  • assets/session-database-flow.svg
  • assets/status-bar.svg
  • … and 114 more

Open the folder on GitHubat commit 7c05b70

Compare with similar skills

Token Optimizer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Token Optimizer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Token Optimizer this skillalexgreensh/token-optimizer2.5k—~3.6kAutomated safety check: PassCustom licence
Context Mode Output Sandboxmksglu/context-mode26k—~4.1kAutomated safety check: PassCustom licence
Memori Long-Term MemoryMemoriLabs/Memori17k—~2kAutomated safety check: NotesCustom licence
Picoclaw Skill Creatorsipeed/picoclaw30k—~4.4kAutomated safety check: PassMIT
ccc Semantic Code Searchcocoindex-io/cocoindex-code2.8k—~938Automated safety check: PassApache-2.0
Context Mode for Antigravity CLImksglu/context-mode26k—~850Automated safety check: PassCustom licence

Similar skills

  • Context Mode Output Sandbox

    mksglu/context-mode

    Routes large command, file, API and browser output through context-mode tools so only the needed result enters the agent's context, instead of dumping it via Bash.

    26k GitHub stars~4.1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Memori Long-Term Memory

    MemoriLabs/Memori

    Connects Claude Code to Memori Cloud for long-term memory, recalling stored context before substantive replies and saving new context afterward.

    17k GitHub stars~2k tokensUpdated 7 days ago
    Agent WorkflowsAuto-check: notes
  • Picoclaw Skill Creator

    sipeed/picoclaw

    Guidance for creating, updating and reviewing Picoclaw skills, from the SKILL.md structure to organizing bundled scripts, references and assets.

    30k GitHub stars~4.4k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • ccc Semantic Code Search

    cocoindex-io/cocoindex-code

    Semantic code search and index management with the ccc CLI: the agent initializes, indexes and queries the project by concept, filtering by language or path.

    2.8k GitHub stars~938 tokensUpdated 3 days ago
    Agent WorkflowsAuto-check passed
  • Routing rules for using context-mode MCP tools in Antigravity CLI: sandboxed code runs, file analysis, indexed search and web fetches that keep large output out of the conversation.

    26k GitHub stars~850 tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Context Engineering

    abashev/vfs-s3

    Optimizes agent context setup. An agent skill from abashev/vfs-s3.

    106 GitHub starsUsed in 9 repos~2.6k tokens
    Agent WorkflowsAuto-check: notes

More from alexgreensh/token-optimizer

  • Resume Checkpoint

    alexgreensh/token-optimizer

    Pull a prior session's checkpoint on demand when the user is continuing prior work.

    2.5k GitHub stars~826 tokensUpdated yesterday
    Auto-check passed
  • Token Coach

    alexgreensh/token-optimizer

    Plan a token-efficient Claude Code or Codex setup, or get a quick health check.

    2.5k GitHub stars~3.2k tokensUpdated yesterday
    Auto-check passed
  • Fleet Auditor

    alexgreensh/token-optimizer

    Cross-system agent token/cost audit (Claude Code, Codex, OpenClaw, Hermes, OpenCode): idle burns, model misrouting, config bloat, with dollar savings.

    2.5k GitHub stars~1.7k tokensUpdated yesterday
    Auto-check passed
  • Token Dashboard

    alexgreensh/token-optimizer

    Open the Token Optimizer dashboard in your browser (context usage, quality, savings).

    2.5k GitHub stars~946 tokensUpdated yesterday
    Auto-check passed
  • Token Optimizer

    alexgreensh/token-optimizer

    Audit your OpenClaw setup for token waste, context bloat, and cost optimization opportunities

    2.5k GitHub stars~481 tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Token Optimizer

What does Token Optimizer do?

Audit a Claude Code or Codex setup for context-window waste, then fix it and measure the savings. Token Optimizer is an agent skill from alexgreensh/token-optimizer. Audit a Claude Code or Codex setup for context-window waste, then fix it and measure the savings.

When should I use Token Optimizer?

Token Optimizer fits situations like: context feels tight; tasks that involve Context engineering.

How do I install Token Optimizer in Claude Code?

Run `npx skills add alexgreensh/token-optimizer --skill token-optimizer -a claude-code`. Or copy the skill folder (skills/token-optimizer in alexgreensh/token-optimizer) into .claude/skills/token-optimizer in your project. Claude Code loads it when a task matches its description.

How do I install Token Optimizer in Codex?

Run `npx skills add alexgreensh/token-optimizer --skill token-optimizer -a codex`. Or copy the skill folder (skills/token-optimizer in alexgreensh/token-optimizer) into .agents/skills/token-optimizer in your project. Codex loads it when a task matches its description.

Can I use Token Optimizer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add alexgreensh/token-optimizer --skill token-optimizer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/token-optimizer, .gemini/skills/token-optimizer, .github/skills/token-optimizer and .opencode/skills/token-optimizer in your project.

What does Token Optimizer need to run?

Going by SKILL.md and its folder, Token Optimizer needs the command-line tools its instructions call (python3, node and claude). Our summary lists: Python 3.

Does Token Optimizer access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Token Optimizer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Token Optimizer use?

Token Optimizer has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does Token Optimizer use?

About 3.6k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 35k tokens, read only when the agent opens those files.

What are the alternatives to Token Optimizer?

Skills that share tags, products or a category with Token Optimizer: Context Mode Output Sandbox (mksglu/context-mode, 26k stars), Memori Long-Term Memory (MemoriLabs/Memori, 17k stars), Picoclaw Skill Creator (sipeed/picoclaw, 30k stars) and ccc Semantic Code Search (cocoindex-io/cocoindex-code, 2.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Token Optimizer?

alexgreensh (a GitHub user) maintains it in alexgreensh/token-optimizer, which has 2,527 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on October 8, 2026.

Source: alexgreensh/token-optimizer on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.