Orchestrate free opencode workers from Claude Code to cut token costs.

Apache-2.0Auto-check passedAI & LLM Engineering

Install Hivemind

skills CLI
$ npx skills add alirezarezvani/claude-skills --skill hivemind -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install alirezarezvani/claude-skills hivemind --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/alirezarezvani/claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/engineering/hivemind .claude/skills/hivemind && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
hivemind
GitHub stars
28k
Used in
1 other repo
Token cost
~2.4k tokens
SKILL.md length
1,134 words
Files
18 (incl. scripts, assets)
Skills in repo
342
Repo updated
First seen
Licence
Apache-2.0

At a glance

Orchestrate free opencode workers from Claude Code to cut token costs.

  • Works in 3 steps: Put this skill folder wherever your… → Export HIVEMIND_HOME pointing at that… → Copy the bundled assets into place
  • Delegating grunt work to a single worker
  • SKILL.md covers Prerequisites (external…, Setup, Components and Invocation contract, plus 10 more sections
  • Runs JavaScript scripts from its folder; calls opencode, git and node

What it does

Hivemind is an agent skill from alirezarezvani/claude-skills. Orchestrate free opencode workers from Claude Code to cut token costs. Use when delegating grunt work to a single worker or a parallel swarm (scout/coder/tester) with worktree isolation, benchmarking against opencode, or when the user says "spawn a worker", "swarm", "delegate to opencode", or "/oc".

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 22 other files, including scripts and assets (for example `assets/agents/coder.md`, `assets/agents/scout.md` and `assets/agents/tester.md`).

It sits in AI & LLM Engineering, covering LLM cost and token optimization and Git worktrees. The repository describes itself as: 380 Claude Code skills & agent skills & plugins (30+ Agents, 70+ custom commands, 380+ skills, customizable references, scripts)for Claude Code, Codex, Gemini CLI, Cursor, and 8… The licence is Apache-2.0.

When your agent uses it

  • Delegating grunt work to a single worker
  • A parallel swarm (scout/coder/tester) with worktree isolation
  • Benchmarking against opencode
  • The user says spawn a worker

Example prompts

  • “spawn a worker”
  • “delegate to opencode”
  • “/hivemind”

Requirements

  • Node.js

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Put this skill folder wherever your agent loads skills from (e.g. ~/.claude/skills/hivemind).
  2. Export HIVEMIND_HOME pointing at that folder — the bundled slash commands use it
  3. Copy the bundled assets into place

What it can do on your machine

Read from SKILL.md and the folder at commit 19392f7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (JavaScript, from the files we listed), which the agent can run.

    Shell commands in SKILL.md call:

    • opencode
    • git
    • node
    • npm
    • bash

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • opencode.ai

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Hivemind loads about 2.4k tokens when it runs. Until then it costs about 77 tokens; SKILL.md has 1,134 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~77
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from alirezarezvani/claude-skills at commit 19392f7, republished under its Apache-2.0 licence (© alirezarezvani). 1,134 words, ~2,445 tokens.

Download SKILL.mdSave it as .claude/skills/hivemind/SKILL.md (or your agent's skills folder). This skill also uses 17 other files; get the full folder from GitHub.
name
hivemind
description
Orchestrate free opencode workers from Claude Code to cut token costs. Use when delegating grunt work to a single worker or a parallel swarm (scout/coder/tester) with worktree isolation, benchmarking against opencode, or when the user says "spawn a worker", "swarm", "delegate to opencode", or "/oc".

Hivemind: Claude Code as Orchestrator, opencode as Free Worker Swarm

Claude Code = brain (plans, reviews, merges). opencode = disposable workers on free models (opencode/mimo-v2.5-free default; verified $0.00 per run).

Prerequisites (external dependency)

This skill is a thin orchestration layer over opencode, a third-party CLI. It is not bundled — install and authenticate it yourself first:

RequirementNotes
Node.js >= 18The scripts use fetch and node:timers/promises.
opencode CLI on PATHnpm i -g opencode-ai (or the installer opencode documents).
An authenticated opencode accountopencode auth login. Workers run as your account.
Default model opencode/mimo-v2.5-freeA free tier offered by opencode, not by Anthropic. Availability, rate limits, and pricing are opencode's to change — override with --model at any time.
Windows only: OPENCODE_GIT_BASH_PATHPoint at C:\Program Files\Git\bin\bash.exe, set persistently.

Nothing here calls the Anthropic API on the worker side; worker traffic goes to opencode's endpoints. Do not delegate secrets or private code you would not send there.

Setup

  1. Put this skill folder wherever your agent loads skills from (e.g. ~/.claude/skills/hivemind).
  2. Export HIVEMIND_HOME pointing at that folder — the bundled slash commands use it:
    export HIVEMIND_HOME="$HOME/.claude/skills/hivemind"
  3. Copy the bundled assets into place:
    • assets/commands/*.md -> ~/.claude/commands/ (the /hive, /oc, /swarm, ... entry points)
    • assets/agents/*.md -> ~/.config/opencode/agent/ (the scout / coder / tester worker personas)

Both copies are optional: everything the commands do can be driven by invoking scripts/oc-worker.mjs directly, and any opencode agent name works with --agent.

Runtime state (.runs/*.jsonl) is written inside this folder and is gitignored.

Components

Path (relative to this skill dir)Purpose
scripts/oc-worker.mjsONLY sanctioned way to invoke a worker. Hardened join point.
scripts/oc-status.mjsFleet progress from run logs (oc-status.mjs <run-id>)
scripts/oc-aggregate.mjsDedupe/synthesize N worker outputs; consensus findings first
scripts/bench/run-bench.mjsBenchmark configs A (claude solo), B (opencode solo), C (orchestrated swarm)
scripts/bench/grader-prompt.mdBlind grading rubric (max 12 pts + PASS/FAIL gate)
assets/commands/Slash-command entry points to copy into ~/.claude/commands/
assets/agents/scout / coder / tester agent definitions for opencode

Slash commands (ship in assets/commands/, copy to ~/.claude/commands/):

  • /hive <task> - AUTO-ROUTER. Classifies task -> single worker, generic swarm, or template. Default entry point; prefer this over manual routing.
  • /oc <task> - single worker delegation
  • /swarm <task> - generic parallel swarm
  • /review-panel <diff> - 4-lens parallel review (correctness/security/performance/style) + consensus aggregation
  • /research-sweep <question> - 3-5 parallel research angles, synthesized
  • /migration <task> - batched per-worktree migration workers + sequenced merge
  • /test-fleet <target> - partitioned parallel test runs with safety checks

Worker agents (ship in assets/agents/, copy to ~/.config/opencode/agent/):

  • scout - read-only research (no write/edit/bash)
  • coder - implements one subtask in its worktree
  • tester - runs tests only, never edits source

Invocation contract

node "<skill-dir>\scripts\oc-worker.mjs" [--agent scout|coder|tester] [--dir <path>] [--model <p/m>] [--timeout 900] [--run <id> --label <name>] "TASK TEXT"

Returns exactly ONE compact JSON line: { ok, result, tokens:{total,input,output,cache}, cost_usd, duration_ms, label, agent, model }

On failure: { ok:false, stage:"args"|"exec"|"api"|"parse"|"empty", error } with stderr capped at 300 chars.

--run <id> + --label <name> append lifecycle events (start/done/fail) to .runs/<id>.jsonl inside this skill dir. Use them for EVERY swarm worker so progress is recoverable via oc-status.mjs even after orchestrator context loss.

The script auto-manages the shared server: health-checks 127.0.0.1:4096, spawns opencode serve if dead, waits 5s, falls back to cold start. Workers are idempotent against their --dir; re-run once on ok:false before giving up.

HIVEMIND_SERVER_URL overrides that address (default http://127.0.0.1:4096). It must be a valid URL with a numeric port; anything else fails fast with a single stage:"args" JSON line rather than reaching the spawned process.

Golden Rule (non-negotiable)

Raw opencode NDJSON streams must NEVER enter your context. All output arrives via the script's single JSON line. Never pipe opencode run --format json directly into this conversation; never re-implement what the script does.

Single worker flow (/oc)

For one read-only question or small delegation: run oc-worker.mjs without worktrees. Read-only tasks may omit --agent/--dir. Summarize result for the user. If files were written: show git diff before letting the user commit.

Swarm flow (multi-worker)

  1. Decompose task into 2-5 INDEPENDENT subtasks (no shared files).
  2. Writing workers get isolated worktrees FIRST: git worktree add ../<repo>-wt-N -b swarm/N.
  3. Issue ALL worker invocations as PARALLEL Bash tool calls in ONE message.
  4. Review every diff yourself (git diff main...swarm/N). YOU are the only merger.
  5. Merge approved branches, remove worktrees, run tests.
  6. Report table: subtask | agent | tokens | outcome + total worker tokens.

HARD RULES: workers never share directories; never delegate merging/reviewing; escalate to your own Sonnet only when a free-model worker demonstrably fails twice.

Show full SKILL.md (441 more words)Show less

Benchmarking

node scripts\bench\run-bench.mjs --repo <project> [--configs a,b,c] [--task 1-5]

Appends JSONL records (ts, config, tokens, cost, duration) to bench-results.jsonl. Grade artifacts blind with grader-prompt.md (grader sees only task spec + output). Configs: A=claude solo baseline, B=opencode solo, C=claude orchestrating 2 workers.

Fallback ladder (all flows)

  1. Worker ok:false -> re-invoke once against the same dir.
  2. Still failing -> orchestrator performs that subtask inline, marks it [orchestrator-sourced].
  3. opencode entirely down (exec/api twice) -> announce, abandon workers, do the task directly. Never let a swarm fail a task that Claude could have done itself.

Fleet patterns

Four reusable topologies ship as slash commands (see table above). Shared invariants: parallel spawns in one message; --run/--label on every worker; aggregation via oc-aggregate.mjs when 3+ workers produce findings; consensus beats single-lens claims; worktree isolation whenever any worker writes.

Windows notes (hard-won)

  • Requires OPENCODE_GIT_BASH_PATH=C:\Program Files\Git\bin\bash.exe (set persistently).
  • The script resolves the REAL opencode.exe by parsing the npm .cmd shim — Node's EINVAL policy blocks spawning .cmd directly. Do not "simplify" resolver back to where.exe first-line.
  • Free models: opencode/mimo-v2.5-free, opencode/nemotron-3.5-lightning-free, opencode/hy3-free. NOTE: opencode-go/* models require workspace billing — avoid.

Known limits

  • Free-tier rate limits can 429 under heavy swarms; space out retries.
  • Worker quality varies; always review diffs. Scout answers are evidence-cited.
  • Bench config C consumes real Claude tokens for orchestration (~1-2k/task).

Anti-patterns

Anti-patternWhy it breaksDo this instead
Piping opencode run --format json straight into the orchestratorRaw NDJSON floods context — the exact cost the skill exists to avoidAlways go through scripts/oc-worker.mjs, which returns one compact JSON line
Two writing workers in one directoryConcurrent edits corrupt each other's diffsOne git worktree per writing worker, created before the spawn
Letting a worker merge, review, or approve its own branchFree-tier workers are the least reliable judges of their own outputThe orchestrator is the only merger and the only reviewer
Spawning workers sequentially, one per messageLoses the entire wall-clock benefit of a swarmIssue every worker invocation as parallel calls in ONE message
Retrying a failing worker indefinitelyBurns rate limit and stalls the taskRetry once, then do the subtask inline and mark it [orchestrator-sourced]
Delegating secrets, credentials, or private codeWorker traffic leaves for opencode's endpointsKeep sensitive context in the orchestrator; send workers only what is safe to share
Trusting cost_usd: 0 as a permanent guaranteeThe free tier belongs to opencode and can changeRe-check pricing before relying on zero cost for bulk work

Cross-references

  • engineering/llm-cost-optimizer — decide whether a task is worth delegating before Hivemind decides how
  • engineering/agent-harness — harness patterns for the orchestrator side of the loop
  • engineering/workflow-builder — for deterministic pipelines that do not need independent worker judgment
  • engineering/skills and engineering/write-a-skill — authoring conventions used by the worker agent definitions in assets/agents/

© alirezarezvani, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 17 other files (scripts, assets) in engineering/hivemind of alirezarezvani/claude-skills.

  • SKILL.md
  • .gitignore
  • LICENSE.txt
  • assets/agents/coder.md
  • assets/agents/scout.md
  • assets/agents/tester.md
  • assets/commands/hive.md
  • assets/commands/migration.md
  • assets/commands/oc.md
  • assets/commands/research-sweep.md
  • assets/commands/review-panel.md
  • assets/commands/swarm.md
  • assets/commands/test-fleet.md
  • scripts/bench/grader-prompt.md
  • scripts/bench/run-bench.mjs
  • scripts/oc-aggregate.mjs
  • … and 2 more

Open the folder on GitHubat commit 19392f7

Used in 1 other repository

We found 2 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in alirezarezvani/claude-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Hivemind next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Hivemind compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Hivemind this skillalirezarezvani/claude-skills28k1 repos~2.4kAutomated safety check: PassApache-2.0
HoneyGreen-PT/honey-for-devs311—~3.5kAutomated safety check: PassMIT
Explore Codelllllllama/RigorPilot-Skills4971 repos~648Automated safety check: PassMIT
Optimizing Promptsjeremylongshore/tons-of-skills-marketplace2.8k1 repos~1kAutomated safety check: PassMIT
Implementation Kickoffopenai/openai-guardrails-js105—~1kAutomated safety check: PassMIT
Antigravityyuting0624/antigravity-for-claude-code376—~9.1kAutomated safety check: PassMIT

Similar skills

  • Honey

    Green-PT/honey-for-devs

    Write less code and say less about it. An agent skill from Green-PT/honey-for-devs.

    311 GitHub stars~3.5k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • Explore Code

    lllllllama/RigorPilot-Skills

    Rigor Improve implementation leaf skill for auditable candidate implementation in deep learning research repositories.

    497 GitHub starsUsed in 1 repo~648 tokens
    AI & LLM EngineeringAuto-check passed
  • Optimizing Prompts

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill optimizes prompts for large language models (llms) to reduce token usage, lower costs, and improve performance.

    2.8k GitHub starsUsed in 1 repo~1k tokens
    AI & LLM EngineeringAuto-check passed
  • Implementation Kickoff

    openai/openai-guardrails-js

    Official

    Start or resume a requested Guardrails implementation or PR takeover in the selected linked worktree with bounded scope and verification.

    105 GitHub stars~1k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Antigravity

    yuting0624/antigravity-for-claude-code

    Run the Antigravity CLI (Gemini) as a collaborating AI inside Claude Code, with intelligent model routing across the software development lifecycle.

    376 GitHub stars~9.1k tokensUpdated 4 days ago
    AI & LLM EngineeringAuto-check passed
  • Mines local Claude Code session transcripts with a deterministic Python pipeline to show what the agent is actually used for, how often it fails and what it costs.

    1.6k GitHub stars~2.3k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed

More from alirezarezvani/claude-skills

All 342 skills in this repo
  • Agile Product Owner

    alirezarezvani/claude-skills

    Writes INVEST-checked user stories with acceptance criteria, splits epics, plans sprints from velocity and ranks the backlog with a weighted score.

    28k GitHub starsUsed in 3 repos~3.2k tokens
    Auto-check passed
  • Product Strategist

    alirezarezvani/claude-skills

    OKR cascade toolkit for product leaders: generates aligned company-to-team OKRs from five strategy types and scores how well they line up.

    28k GitHub starsUsed in 2 repos~1.8k tokens
    Auto-check passed
  • App Store Optimization

    alirezarezvani/claude-skills

    App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store.

    28k GitHub starsUsed in 1 repo~4.2k tokens
    Auto-check passed
  • AWS Solution Architect

    alirezarezvani/claude-skills

    Design AWS architectures for startups using serverless patterns and IaC templates.

    28k GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • Campaign Analytics

    alirezarezvani/claude-skills

    Calculates attribution, funnel and ROI figures for marketing campaigns with three Python scripts that need only the standard library.

    28k GitHub starsUsed in 1 repo~2.1k tokens
    Auto-check passed
  • Code to PRD

    alirezarezvani/claude-skills

    Reverse-engineers a frontend, backend or fullstack codebase into a product requirements document with per-page docs, an enum dictionary and an API inventory.

    28k GitHub starsUsed in 1 repo~4.9k tokens
    Auto-check passed

Questions about Hivemind

What does Hivemind do?

Orchestrate free opencode workers from Claude Code to cut token costs. Hivemind is an agent skill from alirezarezvani/claude-skills. Orchestrate free opencode workers from Claude Code to cut token costs.

When should I use Hivemind?

Hivemind fits situations like: delegating grunt work to a single worker; A parallel swarm (scout/coder/tester) with worktree isolation; benchmarking against opencode; the user says spawn a worker.

How do I install Hivemind in Claude Code?

Run `npx skills add alirezarezvani/claude-skills --skill hivemind -a claude-code`. Or copy the skill folder (engineering/hivemind in alirezarezvani/claude-skills) into .claude/skills/hivemind in your project. Claude Code loads it when a task matches its description.

How do I install Hivemind in Codex?

Run `npx skills add alirezarezvani/claude-skills --skill hivemind -a codex`. Or copy the skill folder (engineering/hivemind in alirezarezvani/claude-skills) into .agents/skills/hivemind in your project. Codex loads it when a task matches its description.

Can I use Hivemind in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add alirezarezvani/claude-skills --skill hivemind -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/hivemind, .gemini/skills/hivemind, .github/skills/hivemind and .opencode/skills/hivemind in your project.

What does Hivemind need to run?

Going by SKILL.md and its folder, Hivemind needs JavaScript for the scripts in its folder and the command-line tools its instructions call (opencode, git, node, npm and bash). Our summary lists: Node.js.

Does Hivemind access the network?

SKILL.md names 1 domain. As links in the text: opencode.ai. This is read from the text; nothing was executed.

Is Hivemind safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Hivemind use?

Hivemind is published under the Apache-2.0 licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Hivemind use?

About 2.4k tokens (SKILL.md is roughly 9.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Hivemind?

Skills that share tags, products or a category with Hivemind: Honey (Green-PT/honey-for-devs, 311 stars), Explore Code (lllllllama/RigorPilot-Skills, 497 stars), Optimizing Prompts (jeremylongshore/tons-of-skills-marketplace, 2.8k stars) and Implementation Kickoff (openai/openai-guardrails-js, 105 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Hivemind?

alirezarezvani (a GitHub user) maintains it in alirezarezvani/claude-skills, which has 27,829 GitHub stars. The repository holds 342 skills in this directory. The repository was last updated on August 30, 2026.

Source: alirezarezvani/claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.