The anchor CLI
scripts/anchor.py (run as bin/anchor, or anchor once installed) scaffolds a project with Anchor doctrine for whichever model platform(s) you're targeting. It never overwrites: any destination file that already exists is reported as a conflict and nothing is written, so you can resolve it and re-run.
Hard rule (all projects): docs describe current shipped state, not plan backlog. Never document the contents of .plans/ as product docs or roadmap; when plan work ships, document the code. Documenting the .plans/ workflow is fine when it is a shipped feature. See doctrine and mythos-core rule 12.
The same binary also runs the .plans/ workflow. Day-to-day plan work lives on the verbs, not on this page:
anchor plans
anchor work --list --tier mid
anchor work # pick + execute (interactive and headless)
anchor work --no-run # claim only
anchor work --finish <slug>
anchor review # critic on the top review-needed/ plan
anchor review --promote # empty queue: integration → mainline (explicit)
anchor draft "a short brief"
anchor models list
anchor fleet-watch --status
Full contract (deterministic vs model vs operator, --no-finish, nicknames, JSON): Plan workflow verbs. anchor --help is the scaffolder; anchor work --help is the work verb. This page covers scaffolding.
Install
Easiest: run /install-anchor in a coding agent
session (Grok skill or Claude command). It detects OS/shell, finds the Anchor
checkout, and safely symlinks bin/anchor into ~/.local/bin (no sudo; confirms
before writing).
Manual options (same script):
- Symlink (preferred):
mkdir -p ~/.local/bin && ln -sfn "$(pwd)/bin/anchor" ~/.local/bin/anchor(ensure~/.local/binis onPATH), or callpython3 scripts/anchor.pydirectly. pip install -e .(orpipx install .) from the repo root gives a console-scriptanchor: the scaffolder plus the plan-workflow modules its verbs wrap. The rest of the fleet scripts (orchestrate.py,router.py, ...) stay copy-paste by design, since they're meant to be dropped standalone into other repos — soanchor work --run, which hands a plan toorchestrate.py, needs a checkout (bin/anchor).--delegatealso needsrequestsandpyyaml.
Set defaults (optional)
./config.sh (or /config in Claude Code / Grok Build) asks which platform(s), fleet tooling, default language/framework, model priority, and preferred orchestrator you want, and saves the answer to ~/.config/anchor/defaults (override with $ANCHOR_CONFIG_DIR). With saved defaults, anchor init (in the project folder) or anchor init <project-dir> scaffolds without any flags. Re-run ./config.sh any time to change your mind, or ./config.sh --show to print what's saved.
./config.sh --platform claude,grok --fleet --language node \
--model-priority nim,claude:sonnet,claude:opus \
--orchestrator claude:opus
Model priority by effort level
You can also save one ordered list for each reasoning-effort level: --model-priority-low, -medium, -high and -xhigh. They take the same tokens as --model-priority. For a level with no list of its own, --show-model-priority and the scaffolded conventions fall back to the flat list. Passing only these flags changes only these lists (no --platform needed); an omitted list is kept and "" clears one.
./config.sh --model-priority-low nim --model-priority-high local:qwen3,nim
anchor --show-model-priority # every level
anchor --show-model-priority --effort high # one level; none/minimal count as low
Scaffolding records the lists in the manifest and in .anchor/conventions.md.
The fleet reorders its endpoints by these lists:
- Which calls.
orchestrate.pyexecutor tasks, using the tier in the Steps table's last column,Route to(small→ low,mid→ low,reasoner→ high,frontier→ high). The critic and planner calls made byanchordelegation ask forhigh. A task with no tier there, and the orchestrator's own planner and review calls, use the registry's role order. Only thelowandhighlists affect fleet calls today;mediumandxhighare saved, shown and recorded. - When. Only for a level with its own saved list. For other levels, and with only
--model-priority, endpoint order is the registry's, as before: the flat list never reorders the fleet. - Which tokens.
nim[:<model>]matches registry endpoints on annvidia.comhost or serving annvidia/model;<model>must be the exact model, endpoint name or alias.local[:<family>]matches local registry endpoints (local:qwen3coversqwen3-32b, notqwen3.5). Other providers (claude,openai,gemini,grok,chat) name nothing the fleet can call: they are skipped with a[fleet]note. - Limits. A listed registry endpoint is used only if it is reachable and its tier already serves that role; otherwise the next token, then the role order, applies. One exception adds an endpoint to a role: when the registry has no NIM endpoint at all, a
nimtoken ranks hosted NVIDIA Build where your list puts it, for executor calls too, though never underANCHOR_PREFER_LOCAL. An explicit--endpointstill goes first.
Preferred orchestrator (per project)
Who should plan multi-step work and coordinate for this project (including cross-plan Depends on analysis). Written into .anchor/conventions.md so lesser models recommend it instead of attempting orchestration themselves.
# Trivial: existing project (no full re-scaffold); omit the path to use cwd
anchor --set-orchestrator claude:opus
anchor init <project-dir> --set-orchestrator claude:opus
# At scaffold time
anchor --platform claude,local:qwen3 --orchestrator claude:opus
anchor init <project-dir> --platform claude,local:qwen3 --orchestrator claude:opus
# Or hand-edit the bold line in .anchor/conventions.md:
# **Preferred orchestrator:** `claude:opus`
If unset: a frontier or near-frontier model in the current session may act as a temporary coordinator (inventory .plans/**, propose dependencies, draft under drafts/). It should announce TEMPORARY-COORDINATOR: <name> — Preferred orchestrator unset and still recommend setting a durable orchestrator. Mid/small/local models must escalate rather than self-appoint. A project MCP coordinator, when registered, is the durable machine-side coordinator; the dashboard monitors those servers only.
Scaffold a project
cd my-app && anchor init # scaffold the current directory
anchor init <project-dir> # or pass an explicit path
anchor init <project-dir> --platform claude,grok # platforms without survey
anchor init <project-dir> --platform local:qwen3,local:gemma3 --fleet
anchor init --framework rust # skip framework detection/prompt (cwd)
anchor init --orchestrator claude:opus # preferred planner/coordinator (cwd)
anchor init --list # show platform keys
anchor init --platform claude --dry-run # preview findings only
anchor init --platform claude --yes # write without confirmation prompt
anchor <project-dir> # still works (compat)
Platform keys: claude, grok, nemotron, aider, local:<model> (qwen3, gemma3, mistral-small, deepseek-r1-distill, llama33), chat. Add --fleet to also copy orchestrator/fleet tooling under .anchor/scripts/ and .anchor/mcp/ (never project-root scripts/ or mcp/).
Scaffold layout:
| Kind | Project path |
|---|---|
| Doctrine | .anchor/ANCHOR.md, .anchor/templates/…, … |
| Conventions | .anchor/conventions.md (not project root) |
Fleet (with --fleet) | .anchor/scripts/…, .anchor/mcp/… |
| Plans | project-root .plans/ (unchanged) |
| Manifest | .anchor-manifest.json |
Source of doctrine/fleet in this repo remains top-level anchor/, scripts/, mcp/.
When there are no overwrite conflicts, the CLI prints draft findings (target, framework, platforms, fleet, orchestrator, model priority, file list) and a recommended action, then asks Proceed with this plan? [y/N] before writing anything. Pass --yes / -y to skip the prompt (required for non-interactive terminals). --dry-run prints the same findings and exits without writing. Conflicts still abort with nothing written and no prompt.
Every run also detects the target project's language/framework from marker files (composer.json, package.json, Cargo.toml, go.mod, ...) and writes idiomatic-composition guidance to .anchor/conventions.md (including Preferred orchestrator, temporary coordinator fallback for frontier sessions when unset, and lesser-model deferral). When package.json coexists with a backend marker (e.g. composer.json on a Drupal/Laravel tree), the non-node language wins — root Node files are often frontend/test tooling. Pass --framework to override. If detection fails and the terminal is interactive, it asks — proposing your saved language default, if any.
Agent-assisted scaffold (/anchor)
Two skill variants share the slash name (see /anchor skill page):
| Variant | Default project | Source |
|---|---|---|
Project scaffold (--platform claude / grok) | Current tree (CWD / git root) | platforms/…/anchor → .grok/skills/anchor / .claude/commands/anchor.md |
| Anchor base | Path required (another project) | Anchor .grok/skills/anchor / .claude/commands/anchor.md |
Both locate a local Anchor checkout, dry-run first, classify conflicts with existing agent config (CLAUDE.md, .claude/, GROK.md, …), and propose merge / backup / skip. Already-scaffolded trees use --check / --diff / --upgrade. In a project, /anchor with no path means “update this project.”
Check, diff, and upgrade
Every scaffold writes .anchor-manifest.json, recording the anchor commit, platforms, and file hashes used. Use these modes on a project that already has a manifest:
anchor --check # short status per managed file (no writes)
anchor --diff # status + unified diffs (no writes)
anchor --upgrade # preview plan, confirm, apply
anchor --upgrade --yes # non-interactive: safe applies only
anchor --upgrade --yes --force # also overwrite locally modified managed files
anchor --upgrade --dry-run # print plan only
anchor --update … # alias for --upgrade
| State | Meaning | --upgrade --yes |
|---|---|---|
| unchanged | project == manifest == (or no) upstream change | skip |
| upstream updated | project still matches scaffold-time hash; source moved on | take upstream |
| locally modified | project hash ≠ manifest | keep (unless --force) |
| MISSING | managed file deleted | restore |
| new | current scaffold would add; not in manifest; path free | add |
| layout | legacy anchor/… doctrine → .anchor/… | move |
Locally modified files are never overwritten without --force. Unmanifested user files are never claimed. After a successful upgrade, the manifest hashes and anchor_commit refresh.
--check / --diff also list pending layout migrations and newly introduced scaffold files for the project’s recorded platforms.