# A harness plugin that autoswitches to the appropriate model to save u tokens

> Source: <https://github.com/ilyesarf/autoswitch>
> Published: 2026-10-16 14:24:59+00:00

I keep forgetting to switch models. I don't need Opus 5.5 to write docs; Sonnet is good enough.

autoswitch is a Claude Code mod that picks the model for each prompt, so you don't have to `/model` by hand.

Requires Claude Code 2.1.299+ and a claude.ai or Anthropic API login (not Bedrock/Vertex/Foundry).

```
/plugin install autoswitch --marketplace ilyesarf/autoswitch
```

On older versions:

```
/plugin marketplace add ilyesarf/autoswitch
/plugin install autoswitch@autoswitch
```

Or run it from a local clone: `claude --plugin-dir /path/to/autoswitch`

Just prompt as usual. A toast shows when it switches.

- `!<model> prompt` forces a model:`!opus` ,`!sonnet-5` ,`!haiku-5-5`
- `/autoswitch` shows the model ladder,`/autoswitch refresh` rebuilds it
- `/config` has`compact_threshold` (default 100k tokens) and`max_model_age_days` (default 180)

1. **Discover** : lists your usable models (two newest per family, released in the last 180 days) and ranks them haiku < sonnet < opus < fable, then by version.
2. **Rate** : a cheap model scores each prompt 1-10, and the score picks a rung on the ladder.
3. **Switch** : before a switch, compacts the conversation if it's large. A model that fails is dropped and the turn retries one rung down. Models that need paid credits are skipped while your credits are off.
