[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-115799":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":15,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":22,"topics":23,"createdAt":10,"pushedAt":40,"updatedAt":41,"readmeContent":42,"aiSummary":43,"trendingCount":16,"starSnapshotCount":16,"syncStatus":15,"lastSyncTime":44,"discoverSource":45},115799,"AutoMode","mralexivy\u002FAutoMode","mralexivy","Self-tuning model and effort router for Claude Code. Picks Haiku, Sonnet or Opus per prompt, learns from your own sessions, keeps long chats cache-warm, adds risk floors and a review workflow. No key, no server.","https:\u002F\u002Fmralexivy.github.io\u002FAutoMode\u002F",null,"TypeScript",79,1,74,2,0,7,45.1,"MIT License",false,"main",true,[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39],"agent-orchestration","ai-tools","anthropic","claude","claude-code","claude-code-mod","claude-code-plugin","claude-code-plugins","claude-code-router","context-management","cost-optimization","developer-tools","model-router","model-routing","prompt-caching","reasoning-effort","2026-11-21 05:53:54","2026-11-22 09:01:38","\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Freadme\u002Fbanner.svg\" alt=\"AutoMode for Claude Code: the right model and the right effort for every prompt\" width=\"100%\">\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmralexivy\u002FAutoMode\u002Fstargazers\">\u003Cimg alt=\"GitHub stars\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fmralexivy\u002FAutoMode?style=flat&color=fbbf24\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmralexivy\u002FAutoMode\u002Factions\u002Fworkflows\u002Ftest.yml\">\u003Cimg alt=\"Test status\" src=\"https:\u002F\u002Fgithub.com\u002Fmralexivy\u002FAutoMode\u002Factions\u002Fworkflows\u002Ftest.yml\u002Fbadge.svg\">\u003C\u002Fa>\n  \u003Ca href=\"LICENSE\">\u003Cimg alt=\"MIT license\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-22d3ee\">\u003C\u002Fa>\n  \u003Ca href=\"CONTRIBUTING.md\">\u003Cimg alt=\"PRs welcome\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPRs-welcome-34d399\">\u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmralexivy\u002FAutoMode\u002Fissues?q=is%3Aopen+label%3A%22good+first+issue%22\">\u003Cimg alt=\"Good first issues\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fgood%20first-issues-8b5cf6\">\u003C\u002Fa>\n  \u003Cimg alt=\"Version 0.11.0\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fversion-0.11.0-fbbf24\">\n  \u003Cimg alt=\"Claude Code 2.1.287 or later\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FClaude%20Code-2.1.287%2B-38bdf8\">\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fmralexivy.github.io\u002FAutoMode\u002F\">\u003Cb>Website\u003C\u002Fb>\u003C\u002Fa> ·\n  \u003Ca href=\"https:\u002F\u002Fmralexivy.github.io\u002FAutoMode\u002Fdocs\u002F\">\u003Cb>Docs\u003C\u002Fb>\u003C\u002Fa> ·\n  \u003Ca href=\"#install\">\u003Cb>Install\u003C\u002Fb>\u003C\u002Fa> ·\n  \u003Ca href=\"#what-the-bar-shows\">\u003Cb>The bar\u003C\u002Fb>\u003C\u002Fa> ·\n  \u003Ca href=\"#how-it-works\">\u003Cb>How it works\u003C\u002Fb>\u003C\u002Fa> ·\n  \u003Ca href=\"#contribute\">\u003Cb>Contribute\u003C\u002Fb>\u003C\u002Fa> ·\n  \u003Ca href=\"#open-source\">\u003Cb>Open source\u003C\u002Fb>\u003C\u002Fa>\n\u003C\u002Fp>\n\n# AutoMode for Claude Code\n\n**A free, open source model router for Claude Code. It picks the right model and the right effort for every prompt.**\n\n**On the website:** [the docs](https:\u002F\u002Fmralexivy.github.io\u002FAutoMode\u002Fdocs\u002F) · [the benchmark](https:\u002F\u002Fmralexivy.github.io\u002FAutoMode\u002Fdocs\u002Fbenchmarks\u002Fresults\u002F) · [how to reduce Claude Code costs](https:\u002F\u002Fmralexivy.github.io\u002FAutoMode\u002Fdocs\u002Fguides\u002Freduce-claude-code-costs\u002F) · [install guide](https:\u002F\u002Fmralexivy.github.io\u002FAutoMode\u002Fdocs\u002Fgetting-started\u002Finstall\u002F) · [Claude Code routers compared](https:\u002F\u002Fmralexivy.github.io\u002FAutoMode\u002Fdocs\u002Fcompare\u002F) · [AutoMode vs effortless](https:\u002F\u002Fmralexivy.github.io\u002FAutoMode\u002Fdocs\u002Fguides\u002Fautomode-vs-effortless\u002F) · [AutoMode vs Claude Code Router](https:\u002F\u002Fmralexivy.github.io\u002FAutoMode\u002Fdocs\u002Fguides\u002Fautomode-vs-claude-code-router\u002F) · [does switching models waste the cache?](https:\u002F\u002Fmralexivy.github.io\u002FAutoMode\u002Fdocs\u002Fconcepts\u002Fprompt-cache\u002F)\n\nQuick questions stay cheap. Hard jobs get the strongest model. Risky changes always get a review.\nInstall it and it starts. You never touch the model or the Effort control again.\n\n\u003Csub>A community project. It is not Claude Code's built-in auto permission mode, and Anthropic does not make it. [See the difference](https:\u002F\u002Fmralexivy.github.io\u002FAutoMode\u002Fdocs\u002Fguides\u002Fauto-mode-vs-automode\u002F).\u003C\u002Fsub>\n\n**Paste these into Claude Code, one at a time, then run `\u002Freload-plugins`:**\n\n```text\n\u002Fplugin marketplace add mralexivy\u002FAutoMode\n```\n\n```text\n\u002Fplugin install automode@automode\n```\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Freadme\u002Fdemo.gif\" alt=\"A real session: a quick question runs on Haiku at Low, then a JWT migration moves up to Opus because the risk floor rules out Haiku\" width=\"100%\">\n  \u003Cbr>\u003Csub>A real session on Claude Code 2.1.308, sped up 1.6 times. A quick question runs on Haiku at Low. A JWT migration moves up to Opus, because the risk floor rules out Haiku.\u003C\u002Fsub>\n\u003C\u002Fp>\n\n\u003Ctable>\n\u003Ctr>\n\u003Ctd width=\"33%\" valign=\"top\">\u003Cb>No key. No server.\u003C\u002Fb>\u003Cbr>It runs on the Claude login you already have. There is nothing to host, and your data stays on your machine.\u003C\u002Ftd>\n\u003Ctd width=\"33%\" valign=\"top\">\u003Cb>Six small agents.\u003C\u002Fb>\u003Cbr>Open-ended work runs through plan, build, verify and review. Risky work always gets an independent review.\u003C\u002Ftd>\n\u003Ctd width=\"33%\" valign=\"top\">\u003Cb>Half the cost of Opus.\u003C\u002Fb>\u003Cbr>51% cheaper than plain Claude Code on Opus in mixed sessions, and 45% on 30 coding tasks, at the same pass rate. \u003Ca href=\"#benchmarks\">See the benchmark\u003C\u002Fa>.\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftable>\n\n## What AutoMode does, in one minute\n\n|  | Without AutoMode | With AutoMode |\n|---|---|---|\n| **Model** | One model for every prompt | Haiku for a quick fact, Sonnet for an edit, Opus for design and risk |\n| **Effort** | You set it, and you forget to change it | Two short Haiku judges set it for each prompt, in about a second |\n| **Risky changes** | The same checks as a typo fix | Security, migrations and payments always get an independent review, on Opus when the diff shows critical risk |\n| **Big jobs** | One long chat that does everything | A plan, build, verify and review workflow with six small agents |\n| **Prompt cache** | A cold cache is a surprise bill | A countdown on the bar shows when the cache goes cold |\n| **Your setup** | | A login you already have. No key. No server. |\n\n## Install\n\nThree ways. Each takes about a minute.\n\n**1. Ask Claude** (easiest). Paste this into Claude Code and press Enter:\n\n```text\nInstall the AutoMode plugin for me: run `claude plugin marketplace add mralexivy\u002FAutoMode` and then `claude plugin install automode@automode`. When both succeed, tell me to run \u002Freload-plugins.\n```\n\n**2. Two commands.** Type these in the Claude Code chat box:\n\n```text\n\u002Fplugin marketplace add mralexivy\u002FAutoMode\n```\n\n```text\n\u002Fplugin install automode@automode\n```\n\n**3. One line in a terminal:**\n\n```bash\nclaude plugin marketplace add mralexivy\u002FAutoMode; claude plugin install automode@automode\n```\n\nThen run `\u002Freload-plugins`, or restart Claude Code.\n\n### It starts on its own\n\nThere is nothing to turn on. AutoMode starts with every session after you install it and run `\u002Freload-plugins`. It routes on whatever model the session uses, so you do not pick a special model.\n\n- **Stop it for one session:** `\u002Fautomode off`. Start it again with `\u002Fautomode on`.\n- **Stop it everywhere:** set `\"mode\": \"off\"` in your `config.json`, or set `AUTOMODE_ROUTER=off`.\n- **Check it is running:** `\u002Fautomode setup`.\n\n**It can change the model in the middle of a chat.** AutoMode may move the main session to another model, or to another effort, when the next prompt needs it. To keep a model or an effort, pin it:\n\n- Pick one with `\u002Fmodel` or `\u002Feffort`. A pin holds until you type `am:reset`.\n- Type `am:opus`, `am:sonnet`, `am:haiku` or `am:high` at the start of a prompt, or write \"use opus\" or \"effort: high\".\n- Turn routing off with `\u002Fautomode off`, `\"mode\": \"off\"` or `AUTOMODE_ROUTER=off`.\n\n**Requires** Claude Code **2.1.287 or later** in the terminal. Mods are on by default from that version. The Desktop app needs 2.1.286 or later, and the VS Code extension needs 2.1.299 or later. Tested with Claude Code 2.1.318.\n\nIf you set `CLAUDE_CODE_ENABLE_FUNCTION_HOOKS` in an early build, remove it. Claude Code 2.1.287 and later ignores it.\n\nIf the mod does not load, Claude Code runs as usual and nothing breaks. To check that it loaded, run `\u002Fplugin`. A line under the tabs reads `1 mod active · automode`.\n\n> **Why no special model?** AutoMode used to start only when the model ID ended in `[1m]`. Claude Code 2.1.311 removes that suffix before a mod sees the model, so the rule never fired. The old rule is still there as `\"activation\": \"picker\"` in `config.json`, for builds that keep the suffix.\n\n### Remove\n\n```bash\nclaude plugin uninstall automode@automode\n```\n\nState lives in `~\u002F.claude\u002Fplugins\u002Fdata\u002Fautomode\u002F`. Delete that folder to remove it.\n\n### Turn it off\n\n- **AutoMode only:** run `\u002Fplugin` and disable it in the **Installed** tab. Or run `\u002Fautomode off` for one session.\n- **Every mod, one session:** start Claude Code with `--safe-mode`.\n- **Every mod, every session:** set `\"disableAllHooks\": true` in `~\u002F.claude\u002Fsettings.json`.\n\n## The ladder\n\nEvery prompt takes the cheapest route that is still adequate. Code sets a floor for risky work, and the judge never lowers it.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Freadme\u002Fladder.svg\" alt=\"The ladder: T0 Haiku low, T1 Sonnet medium, T2 Sonnet high, T3 Opus high, T4 Opus max\" width=\"100%\">\n\u003C\u002Fp>\n\n## What the bar shows\n\nOne quiet line above the prompt, in your theme's colors. It reports what actually ran.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Freadme\u002Fsession.png\" alt=\"Two prompts in a real session, with the bar under each: Haiku Low, then Opus High\" width=\"100%\">\n  \u003Cbr>\u003Csub>A real session on Claude Code 2.1.314. Each prompt shows the route it took.\u003C\u002Fsub>\n\u003C\u002Fp>\n\n| On the bar | Means |\n|---|---|\n| **High · Opus** | The effort and the model for this prompt. `Deciding…` while the judge thinks. |\n| **◔ 38%** | How full the chat's context is. |\n| **cache 58:12** | Time until the prompt cache goes cold. After that, the next message pays full price to re-read the chat. |\n| **saved ~$0.38** | The estimated saving against the model the session started on. Right after a switch it reads **↺ $0.07 to pay back**, until cheaper requests pay off the new model's cache rewrite. |\n| *a refactor across modules* | Why the route was chosen. |\n| **Auto** | Switches routing on or off for this session. |\n| **⚙** | Settings. |\n\n`AUTOMODE_UI=off` hides the bar. `\u002Fautomode details` prints the same facts as text, and `\u002Fautomode help` lists the commands.\n\n## Where AutoMode runs\n\nAutoMode's hooks run in every session that loads the plugin. What AutoMode draws depends on the app:\n\n| Where you run Claude Code | Routing and guardian | The bar above the prompt | `\u002Fautomode` text |\n|---|---|---|---|\n| `claude` in a terminal, including an editor's terminal | Yes | Yes | Yes |\n| The Code tab of the Desktop app (not a WSL session) | Yes | Yes | Yes |\n| The VS Code extension chat panel (2.1.299 or later) | Yes | **No.** Claude Code does not draw the band above the prompt there. | Yes. Use `\u002Fautomode` for the same facts. |\n| `claude -p` and the Agent SDK | Yes | No | Yes |\n| A WSL session in the Desktop app | No. Plugins are not available there. | No | No |\n\nSource: [Mods overview, where mods run](https:\u002F\u002Fcode.claude.com\u002Fdocs\u002Fen\u002Fplugins\u002Fmods\u002Foverview#where-mods-run).\n\n## How it works\n\nEach prompt takes one of four paths:\n\n- **Chat and non-code requests:** answered directly.\n- **Code changes with a clear goal:** Sonnet does them itself and must show a passing test or build before it says done.\n- **High-risk changes:** after the checks pass, one independent reviewer checks the diff. It runs on Opus when the diff shows critical risk, and on Sonnet otherwise.\n- **Open-ended work:** run `am:run \u003Crequest>` for the `automode:run` workflow. Automatic entry is off by default (`autoWorkflow`).\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Freadme\u002Fworkflow.svg\" alt=\"The workflow: risk band, discover, plan, build, verify, review\" width=\"100%\">\n\u003C\u002Fp>\n\n| Stage | What runs |\n|---|---|\n| **Risk band** | Code, not a model. It sets S0 to S3 from the task text, the planned and changed files, and blocking unknowns. The band only goes up. |\n| **Discover** | Haiku. One agent for S1. Three agents with separate scopes for S2 and S3. |\n| **Plan** | Opus. Workstreams, acceptance criteria and risks. |\n| **Build** | Sonnet. Workstreams that share files never run together. `maxConcurrency` defaults to 1. |\n| **Verify** | Sonnet runs the commands. Code decides pass or fail from the exit codes. At most 2 rounds. |\n| **Review** | Opus reads the diff. It is mandatory for S2 and S3, failed checks, unfinished work and incomplete evidence. If the router leaves review out, size alone does not force it. Sonnet fixes blockers and major correctness or security defects. The verifier checks evidence gaps. |\n\n**The S3 rule.** If a prompt matches security or credentials, migrations or destructive operations, concurrency, external contracts, or payments and sensitive data, the review is mandatory. It runs on Opus when the diff shows critical risk.\n\n**One-prompt overrides:** `am:direct \u003Crequest>` skips the workflow. `am:run \u003Crequest>` forces it. `am:opus`, `am:high` and `am:reset` set or clear the route.\n\n### The six agents\n\n| Agent | Model | Tools | Job |\n|---|---|---|---|\n| `explorer` | Haiku | Read, Grep, Glob | Finds files, interfaces and tests. Read only. |\n| `architect` | Opus | Read, Grep, Glob | One bounded planning pass. Read only. |\n| `implementer` | Sonnet | Read, Edit, Write, Grep, Glob, Bash | Builds one workstream. Edits only the files it owns. |\n| `verifier` | Sonnet | Read, Edit, Write, Grep, Glob, Bash | Runs tests, type check and build. Fixes defects the change introduced. |\n| `reviewer` | Opus | Read, Grep, Glob, Bash (git diff only) | Evidence-first review against the task. |\n| `diagnoser` | Haiku, Sonnet when the task carries risk | Read, Grep, Glob | Reads a failing run and finds the cause. Changes nothing. |\n\n## Guardian\n\nThe guardian watches the session. Modes: `off`, `observe`, `recommend`, `assist`, `auto`.\n\nThe shipped `config.json` sets the mode to `auto` and turns on every action below. The guardian runs in every session, not only in AutoMode sessions.\n\n- Redacts secret-shaped text before it is stored.\n- **Shortens large tool results** (`reduceOutputs`, on). A Bash result, or a text-only MCP result, over 12,000 characters is cut to a short form. The full text is saved in the data folder. Errors are not cut.\n- **Can end a turn** (`hardPause`, on). A risky or non-converging turn is stopped between requests, never right after a write. You continue with `am:continue`.\n- **Compacts by itself** (`autoCompact`, on). When a compaction pays for itself, the guardian queues one after the turn. Haiku writes the summary. Otherwise it shows a toast.\n- Saves a task checkpoint, and restores it after `\u002Fclear` with `am:handoff`.\n- Denies git writes and `rm -rf` from subagents. The main session can still commit when you ask.\n\nTurn them off in `\u002Fplugin configure automode@automode` (`reduceOutputs`, `hardPause`, `autoCompact`, `guardianEverySession`, `guardianMode`), or set `AUTOMODE_GUARDIAN=off` to switch the guardian off.\n\n## Settings\n\nDefaults live in [`config.json`](config.json). To override them, put a `config.json` in the plugin data directory, or run `\u002Fplugin configure automode@automode`.\n\n| Key | Default | Meaning |\n|---|---|---|\n| `activation` | `always` | `always`: AutoMode starts with every session. `picker`: only when the model ID is `pickerModel` |\n| `pickerModel` | `claude-sonnet-5-5[1m]` | The model ID for `activation: picker`. Claude Code 2.1.311 strips the suffix, so use `always` |\n| `policy` | `auto` | The routing policy |\n| `defaultPath` | `direct` | `workflow` sends every standard task through the workflow |\n| `autoWorkflow` | `false` | `true` lets the router enter the workflow by itself. `am:run` works either way. Decision records show what entry would have done |\n| `reachHaiku` | `true` | T0 to T2 work without critical risk can run on Haiku. `false`: Haiku needs T0 and a Haiku verdict |\n| `learning` | `true` | A kind of task that needed rescue in this project starts on Opus next time. It only raises a route |\n| `reviewPolicy` | `risk` | `always` adds a review to every change |\n| `maxConcurrency` | `1` | Workstreams built at once (maximum 2) |\n| `blockGitWritesWhenActive` | `true` | Deny git writes from subagents |\n| `delegation` | `off` | `on`: a full read of a large file stops once, with an outline and a cheap `extract` tool. `shadow`: records what the gate would do |\n| `debugLog` | `false` | Write decisions to the data directory |\n\nEnvironment switches: `AUTOMODE_ROUTER=off`, `AUTOMODE_UI=off`, `AUTOMODE_GUARDIAN=off`, `AUTOMODE_SIGNALS=off`.\n\n## Commands\n\nType `\u002Fautomode` and a subcommand. With no subcommand, you get the bar as text.\n\n| Command | What it does |\n|---|---|\n| `\u002Fautomode` or `\u002Fautomode status` | The bar as text: model, effort, context, cache time left, cost, and why the route was chosen. |\n| `\u002Fautomode details` (or `stats`) | Routing, workflow stages, guardian and usage as text. |\n| `\u002Fautomode on` | Turn routing on for this session. |\n| `\u002Fautomode off` | Turn routing off for this session. Your own model and effort run as set. Nothing is written to your settings. |\n| `\u002Fautomode setup` | A live checklist: mod loaded, router on, activation, routing mode, bar shown. It ends with the one next step. |\n| `\u002Fautomode settings` | The settings in force, and where to change each one. |\n| `\u002Fautomode debug` | A report to paste into a bug issue. It holds no prompt text, and it masks your home folder. |\n| `\u002Fautomode help` | The subcommands, the `am:` prompt commands and tips. |\n| `\u002Fautomode:usage [--trace]` | Model calls, tokens, cache use and estimated API cost for the session. `--trace` adds one row per stage. |\n\n**Prompt commands.** Start a prompt with `am:` to steer one prompt: `am:haiku`, `am:sonnet`, `am:opus`, `am:low` to `am:max`, `am:direct`, `am:run`, `am:explore`, `am:new` and `am:reset`. When the guardian pauses a turn, reply `am:continue`. After `\u002Fclear`, `am:handoff` restores the task checkpoint.\n\n**Benchmarks run from a terminal,** not from the chat: `node bench\u002Fjudge-bench-effortless.mts` and `node bench\u002Fstyle-check.mts --dry`. See [Benchmarks](#benchmarks).\n\nFiling a bug? Run `\u002Fautomode debug` and paste the result.\n\n## The Concise output style\n\nAn optional output style, `automode:Concise`. Switch to it with `\u002Foutput-style automode:Concise`. It writes prose at 80% of the way to ASD-STE100 Simplified Technical English: short sentences, active voice, the answer first. It keeps code, commands, file paths and quoted text exactly as they are. It has nothing to do with routing.\n\nWe checked that it saves output tokens without damaging anything that is not prose. [`bench\u002Fstyle-check.mts`](bench\u002Fstyle-check.mts) runs 20 prompts three times each, with and without the style, on Sonnet 5.5, and checks the answers with code. The reports are [`run 1`](bench\u002Fresults\u002Fstyle-check-2026-10-27-run1.md) and [`the rerun of three cases`](bench\u002Fresults\u002Fstyle-check-2026-10-27-rerun.md).\n\n| What we checked | Result |\n|---|---|\n| **Code and commands stay exact.** Six prompts. Two answers were run in a sandbox. | Same as without the style. |\n| **Verbatim text stays verbatim.** A sentence with em dashes, a Spanish reply, a warm customer email. | Same as without the style. |\n| **Warnings and honesty survive.** `rm` and force push keep their warnings. When a file is missing or the question can't be answered, the model says so. | Same as without the style. |\n| **Facts stay in explanations.** Six prompts, 3 to 5 required facts each. | 99% against 100% without the style. |\n| **Output tokens.** | **10% fewer in total.** Shorter on 11 prompts, the same on 7, longer on 2. |\n\nWhat it does not show:\n\n- **The saving is modest.** Explanations get up to 30% shorter. Short writing tasks can get longer: a commit message took 179% of the tokens, and a customer email 124%, because the style splits ideas into more sentences.\n- It covers short single-turn prompts with no tools, one model, and 20 cases. Long agentic sessions are not covered.\n- Three cases failed in the first run because of our own test setup, not the style: the model tried to call tools that were off, and one warning pattern was too narrow. We fixed both and reran those three cases. Both reports are linked above.\n\n## Benchmarks\n\n**In a typical session, AutoMode costs half as much as Claude Code on Opus, 48% less than effortless, and less than Sonnet high, at the same quality.**\n\nA typical session mixes quick questions with real coding work. Each of the 5 sessions below runs in one continuing conversation, on a real repository: a question, a task, another question, then a harder task. Every task is graded by its own hidden tests, and every answer by the facts it must name.\n\n| 5 mixed sessions, 20 steps | Passed | Questions | Coding tasks | **Total** | vs Opus |\n|---|---|---|---|---|---|\n| **AutoMode** | **20\u002F20** | **$0.08** | $1.93 | **$2.01** | **−51%** |\n| Plain Sonnet high | 20\u002F20 | $0.24 | $1.90 | $2.14 | −48% |\n| [effortless](https:\u002F\u002Fgithub.com\u002FHeyCubit\u002Feffortless), on Opus | 20\u002F20 | $0.43 | $3.44 | $3.87 | −7% |\n| Plain Opus (Claude Code default) | 20\u002F20 | $0.50 | $3.64 | $4.14 | — |\n\nQuestions are where AutoMode pulls ahead. Haiku answers them for a third of Sonnet's cost and a sixth of Opus's, and the session stays warm for the next task. Coding tasks run on Sonnet at the effort a judge picks, at Sonnet's own price.\n\n**On single coding tasks, AutoMode is 45% cheaper than Opus and passes one more task.**\n\n| 30 real coding tasks | Passed | Cost per passed task |\n|---|---|---|\n| **AutoMode** | **29\u002F30** | **$0.275** |\n| Plain Opus | 28\u002F30 | $0.499 |\n| Plain Sonnet high | 30\u002F30 | $0.240 |\n\nThe cost ratio against Opus is 0.551, with a 90% interval of 0.511 to 0.591. That clears the ship rule fixed before the run: no task lost and a ratio of 0.85 or less. The one task AutoMode missed, sqlglot, plain Sonnet high passed only 1 time in 3, and plain Opus failed it too. Against Sonnet high, AutoMode costs about 15% more on single coding tasks. The Sonnet high rows come from an earlier run on the same tasks and tests.\n\n**Where AutoMode does not win.** No router wins every workload, so here is ours:\n\n- **Long single coding tasks with no questions.** AutoMode runs them on Sonnet, so it costs about what Sonnet high costs, plus its judges and checks. If all you ever do is long coding tasks, and you already run Sonnet high, AutoMode saves you little.\n- **Haiku on hard work.** A Haiku-first mode (`haikuFirst: t3`, with `recovery: rescue` and `review: observed`) cost 44% less than Sonnet high on 14 tasks: $1.74 against $3.09. It failed 1 of them, mathjs-nullish, which Sonnet high passed. So it ships off. Turn it on if your work is mostly small and well tested.\n\n**How the numbers were made.** Costs are list-price equivalents of every paid request, judges and subagents included. Each arm ran the same tasks and hidden tests, in sessions launched on Opus, as most people run Claude Code. Every decision rule was committed before the first row of its run. One repetition per arm makes this a release signal, not a general law. Read the [v6 report](bench\u002Fexperiments\u002FV6.md), the [rows](bench\u002Fresults\u002F) and the [harness guide](bench\u002FREADME.md). Reproduce the decision with no model call: `node bench\u002Fdecide.mts bench\u002Fresults\u002Fv6-s2-release.jsonl --policy bench\u002Fexperiments\u002Fpolicies\u002Fv6c-opus-vs-opus.json`.\n\nThe harness is in [`bench\u002F`](bench\u002F). A task names a public repository, a pinned base commit and a pinned reference commit, plus hidden tests and a test command. Other tools:\n\n- `node bench\u002Fstyle-check.mts`: the output style check, with [its results](#the-concise-output-style).\n- `node bench\u002Fjudge-bench-effortless.mts`: how often the judge picks a sensible effort, on [labeled cases](bench\u002Fjudge-cases.json). [One run](bench\u002Fresults\u002Fjudge-bench-effortless-2026-10-30.json) got 74 of 75 cases right, and 20 of 20 held-out cases. It measures the effort label only.\n- `bench\u002Freplay.mts`, `bench\u002Fspend-audit.mts` and the other offline tools read your own Claude Code transcripts and cost nothing to run.\n\nWant to help? [Add a benchmark task](#contribute).\n\n## How it compares\n\nAutoMode is not the only router for Claude Code. [effortless](https:\u002F\u002Fgithub.com\u002FHeyCubit\u002Feffortless) sets the effort, and AutoMode's effort rules are ported from it. [jev-router](https:\u002F\u002Fgithub.com\u002Fgargpratyush\u002Fjev-router) and [claude-router](https:\u002F\u002Fgithub.com\u002Falexei-led\u002Fclaude-router) route the model. AutoMode adds Haiku for questions and bounded work, a risk floor, a mandatory review for risky work, a fresh rescue builder instead of a costly mid-task model switch, and a plan, build, verify and review workflow. On the same five mixed sessions, AutoMode cost $2.01 and effortless $3.87, both 20 of 20: effortless keeps Opus and sets the effort, and AutoMode also moves questions to Haiku and coding to Sonnet. jev-router and claude-router were audited from source, not run ([method](bench\u002Fexternal\u002FMETHODOLOGY.md)). [See the full comparison](docs\u002Fcompare.md), including how AutoMode decides when a model switch is worth a cache rewrite.\n\n## Contribute\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Freadme\u002Fcontribute.svg\" alt=\"Five ways to contribute: a benchmark task, a judge case, a risk rule, docs and images, a bug report\" width=\"100%\">\n\u003C\u002Fp>\n\nAutoMode gets better when more people use it on more kinds of work. It is MIT licensed, every line is in this repository, and you can add a benchmark task, a judge case or a risk rule in under ten minutes. No contribution is too small. A fixed sentence counts.\n\n| You want to | Do this | Time |\n|---|---|---|\n| Report a bug | Open an issue. Say what the bar showed and what you expected. | 2 min |\n| Add a judge case | Add a prompt and the efforts a careful person accepts to `bench\u002Fjudge-cases.json`. | 10 min |\n| Add a risk rule | Add a pattern to `hooks\u002Flib\u002Frisk.ts` and a test in `tests\u002F`. | 30 min |\n| Add a benchmark task | Pick a public MIT or Apache-2.0 repository, pin two commits, and add a task file. See [`bench\u002Ftasks\u002FREADME.md`](bench\u002Ftasks\u002FREADME.md). Run `node bench\u002Fvalidate-fixture.mts`. | 1 to 2 hours |\n| Improve the docs | Fix a sentence, or add a real screenshot or GIF to `docs\u002Freadme\u002F`. | 5 min |\n\n**Your first contribution:**\n\n1. Fork this repository and clone your fork.\n2. Run `npm install`, then `npm run check`. Every check passes on `main`.\n3. Make one small change, and add or update a test.\n4. Open a pull request. Say what changed and why.\n\nRead [CONTRIBUTING.md](CONTRIBUTING.md) for the rules. Look for issues labeled [good first issue](https:\u002F\u002Fgithub.com\u002Fmralexivy\u002FAutoMode\u002Fissues?q=is%3Aopen+label%3A%22good+first+issue%22). Ask questions in [Discussions](https:\u002F\u002Fgithub.com\u002Fmralexivy\u002FAutoMode\u002Fdiscussions).\n\n**Star the repository** if AutoMode saves you time. It helps other people find it.\n\n## Open source\n\nAutoMode is MIT licensed. A Claude Code mod is code that runs with your permissions. It is not sandboxed. So the whole mod is here to read: [`hooks\u002F`](hooks\u002F). Install mods only from authors you trust, and review them first.\n\n### Review it before you install it\n\nYou can list what AutoMode does without running it. Clone the repository, then run:\n\n```bash\nclaude plugin validate .\u002FAutoMode\n```\n\nThe `hooks:` line lists the events AutoMode handles. The `calls:` line lists the mods API methods it uses. Here is what they mean, checked on Claude Code 2.1.311:\n\n| AutoMode calls | Why |\n|---|---|\n| `$.model.complete` | Haiku calls, on your own Claude login. Each sends the text of the prompt or session it judges or summarises to Anthropic, as a Claude Code request does. A new prompt makes 2 to 4 calls: the AutoMode judge, 1 or 2 effortless judge calls, and sometimes 1 more. A pinned model makes 2. A short follow-up, or a prompt whose verdict is cached, makes none. A subagent spawn makes 1. A plan-mode change makes 2 to 4. Every compaction of the main session, `\u002Fcompact` included, is written by Haiku. A failed call can be retried once or twice. With `delegation: on`, each `extract` is 1 more call and sends the named files. |\n| `$.fs.read`, `$.fs.write`, `$.fs.exists`, `$.fs.list` | Reads `config.json` and your settings file. Writes its records, checkpoints and caches to its own data folder, `~\u002F.claude\u002Fplugins\u002Fdata\u002Fautomode\u002F`. With `debugLog` on, it also writes a log in the plugin folder. |\n| `$.process.run` | Four commands. `chmod` and `rm -f` on its own data files. `git rev-parse` and `git status`, both read only, for the task checkpoint. |\n| `$.env.get` | Reads `AUTOMODE_*` switches, your provider variables, and `HOME`. It reads `ANTHROPIC_API_KEY` only to test whether it is set, so it can tell a plan from an API key. It never stores or sends the value. |\n| `$.store.get`, `$.store.set` | Keeps small settings that Claude Code refused to keep. |\n| `$.session.*`, `$.agent.*`, `$.prompt.*`, `$.tool.list`, `$.turn.abort`, `$.config.list`, `$.clock.*` | Reads the session's model, usage and messages, and lists agents and tools. `$.agent.spawn` runs the six agents. `$.prompt.compose` and `$.session.compact` support handoff and compaction. `$.turn.abort` stops a turn when the guardian pauses it. |\n| `$.ui.*`, `$.command.register` | Draws the bar and adds `\u002Fautomode`. |\n\n**What it writes.** Only files in its own data folder, plus `judge-log.jsonl` in the plugin folder with `debugLog` on. It never edits a build, start-up, settings or instructions file. Paths are computed from those two folders, so the directory cannot read them as fixed text.\n\n**Subagents.** The `agent.spawn` hook sets a subagent's model and effort. It does not change a permission mode.\n\n**Commands.** AutoMode rewrites one kind of Bash command. When a test, lint, build or type-check command has a pipe, such as `go test .\u002F... | tail`, it prepends `set -o pipefail; ` so a failing check is not hidden by the pipe (without it, the pipe reports the last command's exit code). It matches common runners, among them `go test`, `npm test`, `pnpm`, `yarn`, `pytest`, `jest`, `vitest`, `tsc`, `eslint`, `cargo test`, `mvn`, `gradle`, `make test`, `dotnet test`, `swift test` and `node --test`, and skips `--help` and `--version` calls. It leaves a command alone when it already says `pipefail`, or ends the pipe on purpose with `|| true`, `; true` or `exit 0`. It runs only while a task is active. The command's output stays the same. It needs a shell that accepts `set -o pipefail`, such as bash or zsh.\n\nAutoMode does **not** call `$.http.fetch`, `$.mcp.*`, `$.env.set`, `$.prompt.submit` or `$.session.send`. It has no network code of its own: `grep -rnE \"fetch\\(|https?:\u002F\u002F\" hooks scripts workflows` finds only two comments that credit effortless. It sees every prompt and tool call, because it hooks `prompt.submit` and `tool.call`. That is how routing works. Nothing leaves your machine except through Claude Code.\n\n- **No key.** It runs on your own Claude login.\n- **No server.** There is nothing to host and no account to make.\n- **Your data stays local.** See [PRIVACY.md](PRIVACY.md) for what AutoMode stores and for how long.\n\n### Where an organization manages Claude Code\n\nOn a machine with managed settings, or in a Team or Enterprise login, Claude Code runs a built-in guard, `cc-plugin-sec-default`, ahead of every mod a user installs. The guard skips some hooks of a user-installed mod. Two of them matter here: `prompt.attachment` and `session.compact`, plus the compaction rows of `session.append`. Plan mode detection and Haiku compaction are then limited. Routing, the judge and the bar still work.\n\nAn administrator can run AutoMode as an organization mod, so these hooks run. See [Manage mods for your organization](https:\u002F\u002Fcode.claude.com\u002Fdocs\u002Fen\u002Fplugins\u002Fmods\u002Fadmin#install-your-organizations-mods). If the administrator sets `allowManagedModsOnly`, a user-installed AutoMode does not load, and the debug log says so.\n\n## Troubleshooting\n\n| Symptom | Check |\n|---|---|\n| Nothing changes after install | Run `\u002Freload-plugins`. Then run `\u002Fplugin` and look for `1 mod active · automode`. |\n| The mod is not listed | Check `claude --version` is 2.1.287 or later. Run `claude plugin test` in a folder that holds no mod: the message says whether mods can load. |\n| The bar says AutoMode is idle | You set `\"activation\": \"picker\"` and the model ID does not match. Use `\"always\"`, or run `\u002Fautomode setup`. |\n| The bar is missing in VS Code | Expected. Use `\u002Fautomode`. |\n| A hook seems skipped | Start with `claude --debug` and search the log for `automode`. See [Troubleshoot a mod](https:\u002F\u002Fcode.claude.com\u002Fdocs\u002Fen\u002Fplugins\u002Fmods\u002Ftroubleshoot). |\n| Filing a bug | Run `\u002Fautomode debug` and paste the result. |\n\n## Develop\n\n```bash\nnpm install                          # TypeScript and Node types, for the checks only\nnpm run check                        # type check, then the Node tests\nclaude plugin validate . --strict\nclaude plugin test .\nclaude --plugin-dir .\n```\n\nThe mod itself has no install step and no build step. Node 23.6 or later runs the tests and bench scripts as TypeScript. [CONTRIBUTING.md](CONTRIBUTING.md) explains which files are JavaScript and why.\n\nThe mod is a function-hooks module. [`hooks\u002Fhooks.json`](hooks\u002Fhooks.json) names one file, [`hooks\u002Fregister.ts`](hooks\u002Fregister.ts), and that file exports `register`. Develop with `--plugin-dir`, not an installed copy: Claude Code caches an installed plugin by version, so raise `version` in [`.claude-plugin\u002Fplugin.json`](.claude-plugin\u002Fplugin.json) before you release a change. Read the [mods overview](https:\u002F\u002Fcode.claude.com\u002Fdocs\u002Fen\u002Fplugins\u002Fmods\u002Foverview) first if mods are new to you.\n\n## Contributors\n\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmralexivy\u002FAutoMode\u002Fgraphs\u002Fcontributors\">\n  \u003Cimg alt=\"Contributors\" src=\"docs\u002Freadme\u002Fcontributors.svg\" width=\"64\" height=\"64\">\n\u003C\u002Fa>\n\n## Credits\n\nAutoMode stands on open source work. All of it is MIT licensed.\n\n- **Effort rules** in `hooks\u002Flib\u002Feffort.ts` and the bar techniques in `hooks\u002Fui\u002F` are ported from [effortless](https:\u002F\u002Fgithub.com\u002FHeyCubit\u002Feffortless) by HeyCubit.\n- **Classifier contract and switch payback** are adapted from [claude-router](https:\u002F\u002Fgithub.com\u002Falexei-led\u002Fclaude-router) by Alexei Ledenev and from [jev-router](https:\u002F\u002Fgithub.com\u002Fgargpratyush\u002Fjev-router).\n- Upstream copies and checksums are in [`bench\u002Fexternal\u002F`](bench\u002Fexternal\u002F).\n\n## License\n\n[MIT](LICENSE)\n","AutoMode 是一个专为 Claude Code 设计的开源模型与推理努力度自动路由插件。它根据提示词复杂度、风险等级和上下文状态，动态选择 Haiku\u002FSonnet\u002FOpus 模型，并自动配置 Effort 参数、设置风险拦截阈值、启用提示缓存与审查工作流，全程无需 API 密钥或后端服务。核心特点包括零配置启动、实时上下文与缓存状态可视化、成本感知的模型降级策略，以及对 Claude Code 原生插件机制的深度适配。适用于希望在保持开发体验流畅的同时，系统性降低调用成本、提升响应合理性与变更安全性的 AI 辅助编程场景。","2026-11-24 04:52:11","CREATED_QUERY"]