---
name: fnl-set-mode
description: Show or change Delegation mode and Routing with their effective sources and environment overrides. Run only when the user asks.
disable-model-invocation: true
argument-hint: "[manual|suggest|auto] [routing on|off] [auto-gate on|off]"
---

# Set delegation and routing preferences

The agent enforces the user's clear yes by judgment; the script enforces preview by default, atomic writes and symlink refusal. No network or model call is needed. `fnl-delegate` explains the delegation rules; this skill works alone to show or save preferences.

1. With no arguments run `python3 -I <this skill folder>/scripts/mode.py show` and report effective Delegation mode, Routing and Auto gate, each with its source: `FNL_DELEGATION_MODE` / `FNL_ROUTING`, host config, or default (`suggest` / `on` / `off`). Auto gate can be enabled only by `## Auto gate` set to `on` in the host config; `FNL_AUTO_GATE` values `off`, `0`, `false` and `no` (case-insensitive) override it to off, and no environment value enables it. For Delegation mode and Routing, environment values take precedence and invalid values use defaults. When `show` reports an environment override, say explicitly that it overrides the file and writing the file has no effect while it remains set. Change no environment or shared settings.
2. For a request such as `manual routing off`, run `python3 -I <this skill folder>/scripts/mode.py set --delegation-mode manual --routing off` without `--yes`. Include only the requested setting flags. Show the old and proposed values and any environment override; ask for a clear yes to the shown change, through the host's native question tool when the session has one. Manual means other-family handoffs only when asked; suggest offers and waits; auto follows the guideline. Own-kind sessions and authority limits follow `fnl-delegate`. Routing off removes this pack's session-start reminder on supported hosts, while named skills and stronger existing instructions still apply. Auto is never 100%. Offer neutral Yes and No choices with none preselected or marked recommended; a default, a timeout or an auto-selected option never counts as the yes.
   Offer `auto-gate on|off` only when effective Delegation mode is `auto`, using `set --auto-gate on` or `set --auto-gate off`. Enabling requires the same clear yes and neutral Yes and No choices above (enforcer: agent judgment). Explain before the yes: the Claude Code hook, where installed, may deny the first file write in a repository with no decision in the last 8 hours; a recorded decision or prior denial allows subsequent writes in that window. It does not cover shell commands and is not an approval or security control. Turn it off with `/fnl-set-mode auto-gate off` or `FNL_AUTO_GATE=off`; the off switch applies immediately. Other hosts use advisory agent judgment.
3. Only after that yes, repeat the same `set` command with `--yes`. It writes Routing and Auto gate only to `host.md` under the resolved data root. Delegation mode uses `ORCHESTRATION_HOST_CONFIG` when set, otherwise the same canonical file; legacy files are not used. When requested settings target different files, the script refuses before writing: set Delegation mode in a separate confirmed command. It replaces only the requested `## Delegation mode` / `## Routing` / `## Auto gate` sections; other bytes stay intact. Every symlinked path component is refused. Read the result: exit 0 alone does not prove a write.
4. Report the result and the effective values from `show`, including any override that still wins. A refusal leaves the change pending; do not bypass it.
