Docs menu

Chief routing

With Chief v2 on, Chief does not guess where a task goes or which model does it. It follows fixed rules, and it tells you which rule it used.

Auto

Auto is on unless you switch it off. You pick a goal, not a model, and Chief picks the model and effort for each task:

  • Cost: the cheapest model that lands this kind of task.
  • Balance (the default): strong where it matters, cheap where it doesn't.
  • Best: the strongest models, and a review on anything risky.

Set the goal in Settings › Chief, or with melta-chief goal cost. On the plan card in Ask Chief, tap Auto · Balance to pick another goal for one task, or Choose myself to pick the lane and model in the composer.

The task card. Before a task starts, Chief reads it: what kind of task it is (a question, a bug fix, a feature, a refactor, docs, tests, ops or a review), how much thinking, code and digging it needs, and how risky it is. In Chief's own chat, Chief reads the task itself. From the phone, one quick Haiku call reads it. Before any of that, code looks the task up in the repo's index of names and files: a small fix it finds in up to 3 files of one folder, none of them a much-edited file, is read by code with no Haiku call. When Chief or Haiku reads a task as touching payments, sign-in, secrets, migrations or deletes, production data or deploys, it is high risk: always reviewed and never built by Sonnet. If the Haiku call fails or takes over 20 seconds, the fixed rules read the task instead, and the task still starts. The rules count those words as medium risk only: the why line names them, the task is reviewed on Best, and on Cost or Balance Sonnet can still build it.

Why. Every plan card and task record says why in one line, for example Auto · Balance: bug fix, hard to find → Opus plans, Sonnet builds, reviewed (touches payments) · coding: Opus medium. The end of the line names the rule that set the model and effort, for example Auto · Balance: feature, small → Sonnet builds · card skipped: 1 file, no hotfiles · Sonnet medium: concrete pack.

Learning. Chief remembers which model landed each kind of task in each repo. When Sonnet has landed 9 of the last 10 bug fixes there, the next bug fix goes to Sonnet. When it lands only 1 of 3, the next one goes to Opus. When you pick a different lane than Auto's, Auto uses your pick for that kind of task in that repo for 30 days. Settings shows how Auto did over the last 30 days: tasks, how many landed first try, and how many you changed.

Manual. Switch Mode to Manual in Settings, or run melta-chief auto off, to use the lane table below exactly as before. Naming a model, an effort or a lane for one task is Manual for that task only. Auto needs melta-chief 0.1.19 or later; a computer with an older one keeps the lane table.

Where a task goes

The first rule that applies wins:

  1. The matching session is waiting on a question: Chief asks you to answer it first.
  2. The task changes files another open session owns: it goes to that session, now if it is idle, queued if it is working.
  3. The matching session is idle: Chief compares two costs and picks the cheaper one. Append adds the task there. Handoff has that session write a handoff and starts a new session from it. A session at 100K context or more always gets the handoff.
  4. The matching session is cold and over 100K: a new session starts from its handoff.
  5. Nothing matches: a new session, lean and read-only when the task only reads.
  6. A read-only task with a matching session: a subagent there answers it.

A correction you made in the last 30 days for the same kind of task wins over rules 3 to 6.

What a task costs

Each session row shows both costs, such as append 63k / handoff 101k. They count input-token equivalents: a cache read costs 0.1, a cache write 1.25 (5-minute cache) or 2 (1-hour cache), output 5. A cold cache means the whole context is written again.

The estimate is what starting the task costs: the session's start and the task read once, not the whole task, so cards and records say start est. It assumes a task takes 20 requests, a new session starts at 20K tokens, and a handoff is about 4K tokens. These are guesses, so Chief measures every finished task (see Records and the weekly review). Once 5 or more tasks are measured, Chief scales its estimates by how far off they were: the median of actual against estimate over the last 20 tasks, for appends and new sessions apart, and for the task's lane once that lane has 5 of its own. The reason then says so, for example append ~126k vs handoff ~101k (measured: 5 tasks, append x2).

Queued tasks

A task for a busy session waits in that session's queue. When the session is idle, Chief sends the whole queue as one turn: the session reads what it needs once, then does the tasks in order. A cold session that already has tasks queued gets the new one added to its queue. One read-only task on a cold session goes to a subagent there.

Warm, compact, hand off

  • Warm. Chief warms a session only when a task waits for it and its cache ends within 5 minutes. It warms at most twice while the session is idle, then hands it off. A session with nothing queued is never warmed. You can still warm one yourself from the app.
  • Compact. /compact empties the cache too, so Chief compacts only a session that has queued work. A session that will sit idle gets a handoff instead. The row then shows the context after the compact.
  • Hand off. A handoff has six parts: goal, state, files touched, commands run with their results, open questions, next step. It must stay under 10K tokens. Chief checks it before it starts the new session. If a part is missing or the file is too big, Chief keeps the old session.
  • Same account. A new session that continues or sits next to a warm session starts under that session's account, so Smart switch does not throw the warm cache away.

Which model

  • Fable plans architecture and new projects, and reviews. Its sessions get only read tools: it never edits and never runs commands.
  • Opus writes the plan for every other task, and builds complex work. A planner session only plans: it reads the repo, runs read-only checks and writes its plan. It cannot edit files, merge, push, check out branches, run migrations, touch a database or deploy; to do any of that it asks you on its card. Chief then starts the builder from its plan.
  • Sonnet builds only when the plan passes the gate: a list of files to change, an exact command to check the work, 1 to 8 numbered steps, no hotfile, and a low complexity score. It runs at medium effort when the plan names the exact lines to change, high when the cause is hard to find or the change spans several files, and xhigh only without a plan or for hard design work.
  • Haiku runs the check commands after a build, without MCP servers, and writes a short receipt into the task's record.

Fable reviews a build only for architecture work, a hotfile or shared code, or a second failed round. After a first failed round the same session gets a critique and tries again.

At a usage limit. When a review or a check run stops at its model's usage limit (for example "You've reached your Fable limit"), Chief starts it again at once on the next model: Fable, then Opus, then Sonnet. The task's timeline and Chief's chat say so, for example Fable limit, reviewed on Opus.

Effort. Opus runs at medium effort for coding work in every lane: UI copy, everyday features, tests, docs and chores. Riskier kinds of change get more: high for race conditions and locks, for schema migrations, and for sign-in and security; xhigh for one change across the backend and the mobile app, or the protocol between them. They raise Sonnet the same way. The why line ends with the rule it used, for example · coding: Opus medium or · domain auth-security: high. An effort you set for a lane under Routing wins, and Chief never picks max by itself.

After the plan. Chief picks the builder before anyone has read the code, so it checks again once the plan is written. A plan that changes one file in 1 to 3 steps, names the exact lines and has an exact check command moves an Opus build to Sonnet at medium effort, or to Haiku for a trivial change. A plan that touches a hotfile or more than 4 files moves a Sonnet build to Opus. A high-risk task, a riskier kind of change, a second failed round, the Best goal or a lane you picked never moves down. The why line says so, for example · recalibrated after pack: Opus → Sonnet medium.

Budgets. Every task has a budget: yours from the composer, else chief.json's for its lane, else the lane's default: planner $2 or 2M tokens, architect $4 or 3M, Opus builds $5 or 3M, Sonnet builds $2 or 2M, Haiku builds $0.50 or 500K, check runs $1 or 500K, reviews $4 or 2M (list prices, fresh tokens). At 80% Chief tells you; at 100% the task pauses with Continue or Stop on its card. "budgets": false in chief.json turns the defaults off.

Long planner sessions. A planner session past 150K tokens of context is checkpointed once it is idle and carries on from its handoff, so it stops rereading a huge context on every turn. Set it in chief.json "rotGuard" (false, or { "context": 150000, "lanes": ["planner"] }); it is off on a Raspberry Pi unless set there.

A lane overrides the default model for new sessions; the default applies only where no lane picks a model.

Change models, efforts and limits under Routing on the host screen, or with melta-chief routing.

Common questions

Can Fable edit files?

Never. Its sessions start with read tools only.

Why did Opus build a small task?

The plan missed one of the gate's checks. Chief says which one.

Can I pick the lane myself?

Yes. Tell Chief, tap Choose myself on the plan card, or pass --lane to melta-chief new. With Auto on, Chief remembers your pick for that kind of task in that repo.

Does Auto cost tokens?

A task from the phone costs one short Haiku call to read it, or nothing when code finds it as a small fix in the repo's index. A task you give Chief in its chat costs nothing extra: Chief reads it as it routes it. Auto saves more than that by sending small, clear tasks straight to Sonnet without a planning turn.

Why didn't Chief keep my session warm?

Nothing was queued for it. Warming costs tokens, so Chief warms a session only when a task waits there. It also stops after two keep-alives and hands off instead. Warm it yourself from the app if you will be back soon.

Why did Chief start a new session when the old one was warm?

The handoff estimate was cheaper. A big context costs a cache read on every request of the task, so a short handoff into a new session can cost less. Both numbers are on the session row.

What is a hotfile?

A file many tasks touch, from the project map. Changes there get Opus and a review.