Skip to content
Skill

Optimize

Reviews Claude Code token metrics and applies approved settings that reduce waste

Optimize is an open-source agent skill for developer tools. It is available on Claude Code.

Scripts
None
Platforms
Claude Code
GitHub stars
186
Last commit
License
MIT
Listing updated

Similar skills

About Optimize

This skill looks at a Claude Code setup's token usage, covering session context, rate limits, cost shares, the largest context categories, daily totals and audit findings. It uses the tokendoctor tools to read the current settings and /config rows, then proposes at most five changes ordered by estimated saving, each with its evidence, trade-off and whether it takes effect immediately or at the next session.

Before recommending a setting it is unsure of, the skill reads the matching page in Claude Code's current documentation, which is published as Markdown. It can also run a longer usage report over 30 days and comments on how tools and subagent runs fill the context. Changes are only applied after the person selects them in a multi-choice prompt, using either a live config call or a settings-file write with a backup. Hooks, permissions and settings outside the tool's list are left alone.

It requires the tokendoctor MCP tools and command-line helpers, and it targets Claude Code users who want to cut token spend. Results are expressed as shares of usage first, since dollar figures are API list prices that do not map directly onto plan limits.

When your agent uses it

Look at token metrics, propose setting changes that cut waste, and apply the ones the person approves.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

Install

This skill ships in the tokendoctor plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add localixai/plugins
/plugin install tokendoctor@localix-lab

Or copy only this skill to ~/.claude/skills/optimize:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/localixai/plugins.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/optimize &&
cp -R "$tmp/plugins/tokendoctor/skills/optimize" ~/.claude/skills/optimize &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/optimize inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/optimize to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/localixai/plugins.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/optimize &&
cp -R "$tmp/plugins/tokendoctor/skills/optimize" ~/.agents/skills/optimize &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/optimize inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/optimize to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/localixai/plugins.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/optimize &&
cp -R "$tmp/plugins/tokendoctor/skills/optimize" ~/.cursor/skills/optimize &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/optimize inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/localixai/plugins.git --path plugins/tokendoctor/skills/optimize

Or copy the folder to ~/.gemini/skills/optimize yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/optimize:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/localixai/plugins.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/optimize &&
cp -R "$tmp/plugins/tokendoctor/skills/optimize" ~/.copilot/skills/optimize &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/optimize inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/localixai/plugins.git

Then copy plugins/plugins/tokendoctor/skills/optimize into your agent's skills folder as optimize. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Token usage measurement
Reads session context, rate limits, cost shares and the largest context categories.
Settings proposals
Suggests at most five setting changes ranked by estimated saving, with trade-offs.
Documentation lookup
Checks Claude Code's current docs before recommending settings it is unsure of.
Approval-based changes
Applies only the changes the person picks, with a backup for settings files.
Usage reporting
Runs a 30-day session report and comments on tool and subagent context growth.

Good for

  • Find out why my Claude Code sessions use so many tokens
  • Lower the context window size to reduce repeated re-reads
  • Enable a prompt cache keepalive when long pauses cause rewrites
  • Review which tools and subagents fill my context most

Optimize FAQ

What does Optimize need to run?

It calls the tokendoctor MCP tools (metrics, settings, config_list, config_set, set_setting) and the tokendoctor-sessions and tokendoctor-audit command-line helpers.

Does Optimize change my settings without asking?

No. It proposes up to five changes and uses a multi-choice prompt so the person picks which ones to apply. Each write asks again, and hooks and permissions are never changed.

Which Claude Code settings can Optimize modify?

Only the settings tokendoctor lists, such as the compaction window and the cache keepalive. Changes go through config_set for live /config rows or set_setting for settings files.

How do I install Optimize in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/optimize to use it in all your projects, or to .claude/skills/optimize in one project. Or install the tokendoctor plugin, which includes it: /plugin marketplace add localixai/plugins, then /plugin install tokendoctor@localix-lab.

Does Optimize run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Optimize?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

What are the best alternatives to Optimize?

The closest alternatives to Optimize are Sessions, Audit, Manage context, Dashboard and Cachewise.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from localixai/plugins

  1. Resumes a paused or stopped localix-loop with an answer or extra iterations

    • Open source
    • 186 GitHub stars
    • Developer tools
  2. Sets up a goal-driven loop where the agent proposes changes scored by a scorekeeper

    • Open source
    • 186 GitHub stars
    • Developer tools
  3. Reports where a localix-loop session stands: score, kept and rolled-back iterations

    • Open source
    • 186 GitHub stars
    • Developer tools
  4. Stops a running localix-loop session and leaves the best result in the working tree

    • Open source
    • 186 GitHub stars
    • Developer tools
  5. Applies one tokendoctor audit fix to settings after a dry-run preview and confirmation

    • Open source
    • 186 GitHub stars
    • Developer tools
  6. Audits a Claude Code setup for settings that waste tokens or silently do nothing

    • Open source
    • 186 GitHub stars
    • Developer tools