AutoMode(https://github.com/mralexivy/AutoMode)是面向 A free, open-source model and Effort router for Claude Code. It selects Haiku, Sonnet, or Opus for each prompt and adjusts Effort, so simple questions take a low-cost path, difficult tasks use stronger models, and high-risk changes enter a review process. The project emphasizes no API keys, no servers, and automatic startup with the session after installation.
Main capabilities
- Automatic routing: selects the model and Effort per prompt; the code sets a floor for risky work, and reviews do not lower that floor.
- Learning: by default, learns from the user's own sessions. Route memory makes a type of task start from a stronger model next time after it required rescue in the project; Adaptive routing tries a cheaper starting point on a small subset of tasks and, by task type, decides whether to adopt or revert based on actual results; reflect, when the user has been away for 20 minutes, at least 3 new tasks have accumulated, and it has not run for 6 hours, summarizes cost and rescue situations and has Haiku rank the next experiments. This Haiku step costs about $0.001, capped at $0.02 per run and $0.20 per week; the model only sees numbers, not task text.
- Cache management: cacheKeeper measures cache lifetime, asks before rewriting a large context after the cache expires, and provides keepWarm to keep the cache warm for long conversations.
- Review workflow: chat/non-code requests are answered directly; code changes with a clear goal are executed by Sonnet and require passing tests or builds before completion is declared; high-risk changes are viewed as a diff by an independent reviewer after checks pass, with Opus used for critical risks and Sonnet otherwise; open-ended work can use am:run to enter the automode:run workflow.
- S3 rules: prompts involving security or credentials, migrations or destructive operations, concurrency, external contracts, payments, or sensitive data must be reviewed; Opus is used when the diff shows critical risk.
- Guardian mechanism guardian: defaults to auto, performs secret text redaction, shortens oversized tool results, pauses the turn when necessary, auto-compacts, saves/restores checkpoints, and prevents subagents from performing git writes and rm -rf, etc.
Usage
- Installation: three methods (have Claude install it, enter two commands in the Claude Code chat box, or a one-line terminal command), but the material does not provide the specific command text. After installation, run /reload-plugins or restart Claude Code. Requires Claude Code 2.1.287+ (terminal), desktop 2.1.286+, VS Code extension 2.1.299+; tested on version 2.1.318.
- Start/stop: starts automatically after installation and reload, no need to select a special model; /automode off disables the current session, /automode on re-enables it; set "mode": "off" in config.json or the environment variable AUTOMODE_ROUTER=off to disable globally; /automode setup checks running status.
- Fixed model/Effort: select with /model or /effort, fixed until you enter am:reset; you can also write am:opus, am:sonnet, am:haiku, am:high at the start of a prompt, or write "use opus", "effort: high".
- Single-prompt control: am:direct <request> skips the workflow, am:run <request> forces the workflow; am:explore, am:new, am:reset etc. are available.
- Check/manage: /plugin to see whether it is loaded (1 mod active · automode); /automode details outputs text details, /automode help lists commands; state is in ~/.claude/plugins/data/automode/, deleting that directory removes the state.
- Disable: disable in the Installed tab of /plugin; for all mods in a single session start with --safe-mode; for all mods in all sessions set "disableAllHooks": true in ~/.claude/settings.json.
- Configuration: by default in config.json, you can place a config.json in the plugin data directory to override, or run /plugin configure automode@automode. Environment switches: AUTOMODE_ROUTER=off, AUTOMODE_UI=off, AUTOMODE_GUARDIAN=off, AUTOMODE_SIGNALS=off.
- Learning management: /automode learned to view what has been learned, /automode learned reset to clear it; /automode learned import to import past records after consent; /automode learn to run a learning pass immediately, /automode learn status to view cost and ratings.
- Benchmarks: run node bench/judge-bench-effortless.mts and node bench/style-check.mts --dry in the terminal.
Use cases Suitable for developers who want to automatically select model/Effort by task difficulty in Claude Code, reduce the cost of simple requests, enforce review for high-risk code changes, and manage long-conversation caching; also suitable for users who need local learned routing and do not want to introduce keys or servers.
Limitations and notes
- Community project, not the built-in automatic permission mode of Claude Code, not made by Anthropic.
- If the mod is not loaded, Claude Code runs as usual and will not break. Early builds that set CLAUDE_CODE_ENABLE_FUNCTION_HOOKS should remove it; Claude Code 2.1.287 and later will ignore it.
- Automatic routing may switch model or Effort during a conversation; to fix it you need to pin.
- Learning is enabled by default, but will not read past transcripts unless the user consents; learning data stays on the local machine.
- The materials do not provide the specific installation command text, the list of supported operating systems, specific savings percentages, or comparison results with other routers.
- The old AutoMode activation rule requires the model ID to end with [1m]; Claude Code 2.1.311 removes that suffix, and the old rule is still kept in config.json as "activation": "picker" for builds that retain the suffix.