# Getting started

Install the plugin in Claude Code, see your own number before anything changes, then fix what you pick. Everything runs on your machine.

## Install

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

Restart Claude Code, or start a new session, and the commands are there.

To try it without installing, clone the repository and start Claude Code with it:

```sh
git clone https://github.com/localixai/plugins
claude --plugin-dir /path/to/plugins/plugins/tokendoctor
```

## Your number first

```text
/tokendoctor:sessions
```

It replays your own sessions of the last 30 days at smaller windows and says what each would have saved, then where the tokens went: main thread against subagents, spend with a very full context, subagent types, cache rebuilds. It is read-only. [What it reports](https://plugins.localix.ai/docs/tokendoctor/sessions).

There is no one pill. If your sessions rarely pass 400K tokens, a smaller window changes nothing for you; a summary that lands just before you finish can cost more than it saves; your models, effort and work all move the number. That is why the replay comes first.

## Then fix what you pick

- `/tokendoctor:optimize` proposes up to five changes from your numbers and applies the ones you pick, each shown first. Nothing is written until you say so.
- `/tokendoctor:audit` lists [the setting checks](https://plugins.localix.ai/docs/tokendoctor/audit) by severity, each linked to the documentation page it rests on.
- `/tokendoctor` shows [the main settings](https://plugins.localix.ai/docs/tokendoctor/settings) and the audit's fixes, and changes one as you type it. It costs no tokens.
- `/tokendoctor slide on` [slides the window](https://plugins.localix.ai/docs/tokendoctor/slide) instead of summarizing it.
- `/tokendoctor undo` [puts any change back](https://plugins.localix.ai/docs/tokendoctor/undo).

## Update

```sh
claude plugin marketplace update localix-lab
claude plugin update tokendoctor@localix-lab
```

Then restart Claude Code. Installed before tokendoctor moved into the localix-lab marketplace? Your marketplace kept its old name: `claude plugin marketplace update tokendoctor` and `claude plugin update tokendoctor@tokendoctor` bring the same version.

## What it costs to keep installed

The skills are user-invoked only (`disable-model-invocation`). `claude plugin details tokendoctor@localix-lab` estimates about 235 tokens of always-on cost for the five of them. The plugin has no MCP server. Its hooks module adds the optimize tools (`mcp__tokendoctor__*`) behind ToolSearch, so only their names are listed until `/tokendoctor:optimize` loads them.

`/tokendoctor` and the slide run in the hooks module too, with no model call, so they add no tokens. Its one command hook runs `tokendoctor-record` in the background when a session starts. The hook is `async` and prints nothing, so it adds no tokens. It appends each finished day's totals to `~/.claude/tokendoctor/history.jsonl`, so the trend outlives Claude Code's transcript cleanup.
