0xdarkmatter/claude-mods/fleet-worker

Claude Code and agent skill by 0xdarkmatter/claude-mods

Trust tier 2
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

One cheap headless Claude Code worker on a cheaper brain (GLM via z.ai, or Sonnet/Haiku) - full tool harness, isolated git worktree + CLAUDE_CONFIG_DIR - fanned out and gated by an Opus orchestrator. Triggers: fleet-worker, GLM worker, grunt worker, cheap parallel agent, offload to GLM, sonnet worker, haiku worker.

Install

npx vskill@latest install 0xdarkmatter/claude-mods/fleet-worker

SKILL.md

The same SKILL.md was published earlier as 0xdarkmatter/claude-mods/fleet-worker.

fleet-worker

Run a cheap headless Claude Code worker on a cheaper model and let an Opus orchestrator (this session) fan workers out in parallel, then verify and land their work. The worker keeps Claude Code's entire tool harness (Read/Write/Edit/Bash/Glob/Grep/Task/MCP/hooks) — only the brain is swapped to a cheaper model via env — a cheaper Anthropic model (Sonnet/Haiku) or a non-Anthropic endpoint. GLM-5.3 (glm-5.3) on z.ai is the default worked example; the mechanism is provider- and model-agnostic (any Anthropic-compatible endpoint).

Want to offload to Grok (xAI's `grok` CLI)? That's not this skill. Every
fleet-worker brain is a claude -p process pointed at an Anthropic-compatible
endpoint. Grok Build CLI is its own binary and protocol (grok -p, auth via
GROK_DEPLOYMENT_KEY), not a claude -p wrapper — so it can't ride fleet-worker's
launcher. Grok is a first-class worker in fleetflow instead (alongside
Codex), which spawns heterogeneous OS-process workers of different binaries —
now its own repo at 0xDarkMatter/fleetflow,
mounted as the /fleetflow skill.
Use fleetflow for a Grok lane or any mixed-provider fan-out.

This is the spawning layer. [`fleet-ops`](../fleet-ops/) is the landing layer. fleet-worker produces branches cheaply; fleet-ops lands them through a test gate with your review. See references/fleet-ops-handoff.md.

The architecture crux: per-agent model = process isolation

ANTHROPIC_BASE_URL and the ANTHROPIC_DEFAULT_*_MODEL mapping vars are process-global — read once per claude process, applied to every model call it makes (including in-process Task subagents). There is no per-agent override. So you cannot keep one Opus session and have its subagents secretly run on GLM. The only way to pair a GLM-brained agent with an Opus orchestrator is a separate OS process with its own env block. That process is fleet-worker.

The load-bearing rule: auth isolation (do not skip)

On any machine also logged into a Claude.ai/Anthropic subscription, the naïve "just set ANTHROPIC_AUTH_TOKEN" launcher fails with `401 token expired or incorrect` — the host's stored subscription OAuth token (~/.claude.json oauthAccount + forceLoginMethod) takes precedence and gets sent to the non-Anthropic endpoint, which rejects it. --settings overrides do not fix it. The fix is a dedicated, empty config dir:

bash
export CLAUDE_CONFIG_DIR="$HOME/.fleet-worker/cfg" # no inherited OAuth/hooks

The launcher sets this automatically. It also gives each worker a clean hook/permission/MCP profile so it can't trip the host's hooks. Full analysis in references/fleet-worker-spec.md §4.

Giving a worker skills

The isolated config dir starts clean — the worker inherits none of the host's skills, MCP servers, or hooks (that isolation is what keeps it off your credentials). So provision what a worker should have: drop skill dirs into the worker's own config ($FLEET_WORKER_CONFIG_DIR/skills/<name>/) or commit them to the project's .claude/skills/ in the worktree. The cheap brain then loads the same on-demand, progressively-disclosed procedural knowledge your orchestrator has — often the cheapest way to lift a weak model's output on a specialized task.

Setup

  1. Install — these scripts ship with the skill. After scripts/install.sh

they live at ~/.claude/skills/fleet-worker/scripts/. Either call them by that path, or symlink onto PATH for convenience: ``bash ln -s ~/.claude/skills/fleet-worker/scripts/fleet-worker ~/.local/bin/fleet-worker ln -s ~/.claude/skills/fleet-worker/scripts/fleet-collect.sh ~/.local/bin/fleet-collect.sh ``

  1. Provide the key (the launcher never prints it; resolution order):
  • export ANTHROPIC_AUTH_TOKEN=<key>, or
  • export FLEET_WORKER_KEYRING_SERVICE=<svc> FLEET_WORKER_KEYRING_KEY=<name> (uses keyring get), or
  • export ZHIPU_API_KEY=<key> (or GLM_API_KEY).
  1. Preflight — bash scripts/fleet-doctor.sh --offline (structural) or

--live (pings the endpoint, then runs one real claude turn through the launcher — the endpoint can accept a model id the CLI refuses; warns about the §4 oauth trap). The doctor and the launcher share one key resolver (scripts/fleet-lib.sh), so --live resolves exactly the key a lane would.

Config knobs (env, all optional)
VarDefaultPurpose
FLEET_WORKER_BASE_URLhttps://api.z.ai/api/anthropicAnthropic-compatible endpoint
FLEET_WORKER_MODELglm-5.3main model (opus+sonnet mapping); 5.3 reasoning levels are low/high/max via FLEET_WORKER_EFFORT (thinking cannot be disabled on 5.3)
FLEET_WORKER_SMALL_MODELglm-4.5-airbackground/cheap model (haiku mapping)
FLEET_WORKER_CONFIG_DIR~/.fleet-worker/cfgisolated config dir — one per parallel worker
FLEET_WORKER_EFFORThighseeded effortLevel in the worker's settings
FLEET_WORKER_PERMISSION_MODEbypassPermissionsworker --permission-mode; use dontAsk + an allowlist to spawn from an auto-mode orchestrator (see Permission posture)
FLEET_WORKER_CLAUDE_BINclaudeclaude binary to exec; callers that preflight-validated an override (fleetflow's FLEETFLOW_CLAUDE_BIN) forward it here so the validated binary is the one that runs

Point FLEET_WORKER_BASE_URL/FLEET_WORKER_MODEL at any other Anthropic-compatible gateway (this is the documented Claude Code custom-endpoint mechanism) to drive a different cheap model.

Staying all-Anthropic? The same separate-process trick runs a cheaper Claude model as the worker — an Opus orchestrator with Sonnet/Haiku workers, no third-party account. Point FLEET_WORKER_BASE_URL at Anthropic's API and set FLEET_WORKER_MODEL/ FLEET_WORKER_SMALL_MODEL to a Claude model, authenticating with an Anthropic API key. The defaults target z.ai/GLM only because that's the cheapest brain; the mechanism doesn't care which model answers.

When to delegate (and when not)

Delegate to a workerKeep on the orchestrator
Independent, well-scoped, tool-using subtasksTasks needing this conversation's context
Refactors, test-writing, doc edits, mechanical multi-file changesJudgment calls, architecture, ambiguous specs
Work where Opus-quality isn't required and a wrong edit is cheap to discardAnything expensive-if-wrong and unreviewed

The safety comes from the cage, not the model: isolated worktree (blast radius), isolated config dir (no host creds/hooks), and the orchestrator's merge gate (nothing lands without review).

Model routing convention (hybrid: in-process tiers + provider workers)

"Delegate or not" has a third axis: which model, and where. One taxonomy answers both — for the in-process Workflow-tool agents and the fleet-worker provider workers — so a fan-out routes models intentionally instead of defaulting every agent to the orchestrator's model.

It rests on the architecture crux above: model alias slots (opus|sonnet|haiku) vary per agent within one process (set via a Workflow agent()'s opts.model), but the provider (ANTHROPIC_BASE_URL) is process-global — so cross-provider routing needs a separate process, which is fleet-worker. Hence two loci:

Work classLocusModelEffort
mechanicalfleet-worker (GLM) or in-prochaiku / glm-4.5-airlow
scoutin-proc (fleet-worker if wide)sonnet / glm-5.3low
buildin-procsonnet→opusmedium
synthesizein-proc onlyinherit (session = Fable/Opus)high
judgein-proc onlyinherit (session = Fable/Opus)high–max

Locus rule: shell out to fleet-worker only for a large (≈12+), independent, file-mutating, cost-dominant fan-out you can gate before landing; everything else — and always synthesize/judge — stays in-process. Two guardrails: never under-power a judge (a cheap rubber-stamp verifier is worse than none), and reach for the `effort` lever before the `model` lever (it's finer-grained, no quality cliff).

Drop-in helper + worked examples (review→verify, hybrid migrate, budget-aware degradation): `assets/route.js` and `references/model-routing.md`.

Single-worker recipe

bash
cd <target-worktree>
fleet-worker --output-format json "Refactor src/parser.py to use the visitor pattern" \
> result.json
fleet-collect.sh result.json && echo "succeeded — review the diff"

fleet-collect.sh gates on is_error (the real success signal — subtype lies) and prints the worker's final text. Exit 0 = success, 10 = worker failed.

Fan-out recipe (parallel workers)

Each task gets its own git worktree + branch and its own config dir so N workers never clobber each other. Spawn from the orchestrator's Bash tool with run_in_background: true, then collect by output file.

bash
# Where the worker trees go: the machine-wide lane root when set
# ($WORKTREE_ROOT/<repo>/fleet-<id>, <repo> = the main checkout's dir name),
# else in-repo scratch (.fleet-work/<id>). rules/worktree-boundaries.md "Lane location".
main=$(dirname "$(git rev-parse --path-format=absolute --git-common-dir)")
if [ -n "${WORKTREE_ROOT:-}" ]; then FW="${WORKTREE_ROOT%/}/$(basename "$main")"; pre=fleet-
else FW=.fleet-work; pre=; fi
delegate() { # $1 = task-id, $2 = prompt
local id="$1" prompt="$2" wt="$FW/$pre$1"
git worktree add -q -b "fleet/$id" "$wt" HEAD
( cd "$wt"
FLEET_WORKER_CONFIG_DIR="$HOME/.fleet-worker/cfg-$id" \
fleet-worker --output-format json "$prompt" > "../$pre$id.result.json" 2> "../$pre$id.err"
)
}
delegate task-a "Add tests for the auth module" &
delegate task-b "Update the README install section" &
delegate task-c "Refactor utils.py duplications" &
wait # barrier
for id in task-a task-b task-c; do
if fleet-collect.sh "$FW/$pre$id.result.json" >/dev/null; then echo "fleet/$id OK"; fi
done

Keep concurrency modest (≤ 4–6) — the binding constraint is endpoint quota, not local CPU. .gitignore the scratch dirs (.fleet-work/, .fleet-worker/); with WORKTREE_ROOT set, .fleet-work/ is never created.

Hand off to fleet-ops (test-gated landing)

The winning branches are ordinary git branches — land them with the sibling skill instead of merging by hand:

bash
fleet track fleet/task-a fleet/task-b fleet/task-c # register as lanes
fleet land fleet/task-a # sequential, test-gated, you review each diff

Full walkthrough + recovery in references/fleet-ops-handoff.md.

Permission posture

Headless -p can't answer a permission prompt — it would stall, so the worker runs in a non-interactive mode. The default is --permission-mode bypassPermissions (set FLEET_WORKER_PERMISSION_MODE to override); safety comes from the cage (isolated worktree + isolated config + merge gate), not the prompt. Optionally constrain further with --disallowedTools (e.g. block WebFetch) or --add-dir.

Spawning from an auto-mode orchestrator. If the session that runs fleet-worker is itself in auto mode, a bypassPermissions launch is hard-denied by the auto-mode classifier as Create Unsafe Agents (an agent spawning an ungated agent) — and no allow-rule saves it (broad/interpreter allow-rules are dropped on entry to auto mode). Two fixes, either works:

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
42
Repository forks
7
7-day trend score
19

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 23 Oct 2026, a month ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/0xdarkmatter/claude-mods/fleet-worker/badge)](https://verified-skill.com/skills/0xdarkmatter/claude-mods/fleet-worker)

Something wrong with this skill or its page? Tell us.