# Optimize

> Optimize is an open-source agent skill for developer tools. Reviews Claude Code token metrics and applies approved settings that reduce waste. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/localixai/plugins/tree/main/plugins/tokendoctor/skills/optimize
- **Repository:** https://github.com/localixai/plugins
- **GitHub stars:** 186
- **License:** MIT
- **Skill name:** optimize
- **Collection:** https://github.com/localixai/plugins
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-04

## About

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.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/localixai/plugins/tree/HEAD/plugins/tokendoctor/skills/optimize)
- [Asks for: mcp__tokendoctor__metrics, mcp__tokendoctor__settings, mcp__tokendoctor__config_list, Bash(tokendoctor-sessions *), Bash(tokendoctor-audit *), WebFetch(domain:code.claude.com)](https://github.com/localixai/plugins/blob/HEAD/plugins/tokendoctor/skills/optimize/SKILL.md)
- [License: MIT](https://github.com/localixai/plugins/tree/HEAD/plugins/tokendoctor/skills/optimize)

## Features

- **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

## Install

### Claude Code

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

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

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

```sh
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.

### Codex

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

```sh
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.

### Cursor

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

```sh
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.

### Gemini CLI

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

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

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

### VS Code

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

```sh
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.

### Other agents

Get the folder:

```sh
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.

## 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.

## Alternatives

- [Sessions](https://ai-powered.com/skills/sessions): Sessions is an open-source agent skill for developer tools.
- [Audit](https://ai-powered.com/skills/audit-localixai): Audit is an open-source agent skill for developer tools.
- [Manage context](https://ai-powered.com/skills/manage-context): Manage context is an open-source agent skill for developer tools.
- [Dashboard](https://ai-powered.com/skills/dashboard-localixai): Dashboard is an open-source agent skill for developer tools.
- [Cachewise](https://ai-powered.com/skills/cachewise): Cachewise is an open-source agent skill for developer tools.
- [Token saver config](https://ai-powered.com/skills/token-saver-config): Token saver config is an open-source agent skill for developer tools.
- [Config hygiene edho ferdian](https://ai-powered.com/skills/config-hygiene-edho-ferdian): Config hygiene edho ferdian is an open-source agent skill for developer tools.
- [Session waste report](https://ai-powered.com/skills/session-waste-report): Session waste report is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/optimize-localixai
