multi-agent-coordination

A set of rules for coordinating multiple coding agents working in the same repository. It covers feature locks, stale-lock checks, separate worktrees, and Git branch discipline.

In plain words
What is it for?
Use it when starting feature or fix work while another agent may be active, checking whether a feature is locked, or isolating concurrent changes in separate worktrees.
Why use it?
It reduces the risk that two agents edit the same work or overwrite each other’s changes. It also provides a fallback when the project does not include the expected lock script.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/andr-ca/agentharness/multi-agent-coordination
Any agent
npx skills add andr-ca/agentharness --skill multi-agent-coordination
Clone the repo
git clone --depth 1 https://github.com/andr-ca/agentharness

Made for: Claude Code, Codex.

Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,246 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00048 $0.02246
Opus 5 $0.00024 $0.01123
Sonnet 5 $0.00010 $0.00449
Haiku 4.5 $0.00005 $0.00225

Measured 2d ago against content hash 3a279f809582, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

multi-agent-coordination scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- **Remove with git:** `git worktree remove <dir>` (not `rm -rf`).
.claude/skills/multi-agent-coordination/SKILL.md · 230 lines

How it starts

The opening of the file, as written. The whole thing — 230 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Multi-Agent Coordination

Use this skill when you start work on a feature and another agent session might be working on the same repository, or when you detect that a lock exists for the feature you want to work on.

tools/agent-lock.sh is agentharness's own dogfooding tool — it is not currently installed into consumer projects by harness-link.sh. If this skill file is symlinked/copied into a consumer repo (the normal case for every install mode) and tools/agent-lock.sh doesn't exist there, every command below will fail with "No such file or directory". Check [ -x tools/agent-lock.sh ] before relying on this skill's commands; if it's missing, this protocol doesn't apply to this repo yet — fall back to plain git branch discipline (check git branch -a / git log for other in-progress work before starting) rather than assuming the lock file exists.

This fallback covers coordination with other agents only — it does not weaken the branching skill's worktree-isolation rule. Whether or not tools/agent-lock.sh exists, starting new feature/fix work on a dirty tree or an unrelated branch still requires a worktree first; a missing lock script is not license to git checkout -b on top of in-progress changes, yours or anyone else's.

Deeper reference: patterns/multi-agent-coordination/COORDINATION.md (full protocol, lock format, stale detection, worktree rules).


Before starting work: check for a lock

tools/agent-lock.sh check "add-user-auth"
  • FREE — no lock exists. Proceed normally.
  • LOCKED — another agent is working on this feature.

Acquiring a lock

AGENT_LOCK_PID=<stable-session-pid> tools/agent-lock.sh acquire "add-user-auth" "feat/user-auth"
# ACQUIRED: locked 'add-user-auth' (agent_id=3f2a1c8d-..., owner_pid=12345)
# 3f2a1c8d-...
export AGENTHARNESS_AGENT_ID=3f2a1c8d-...   # the id from the last line

Check owner_pid in that output. It is the process whose liveness and ancestry the lock is anchored to. If it isn't the session process you meant, acquire still succeeds — and the mistake surfaces much later, as a push blocked by your own lock. acquire prints a NOTE when the recorded pid isn't an ancestor of the acquiring process, which is the usual signature of a wrong AGENT_LOCK_PID.

Read the full file on GitHub · 230 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 230 lines · 48 tokens per session scan C 3a279f809582

Subscribe to this mod's changes

multi-agent-coordination is a skill published in the GitHub repository andr-ca/agentharness (1 stars, last pushed 2d ago), licensed MIT. It adds 48 tokens to every session and 2,246 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

html-ppt-zhangzara-coral

OpenDesign's community-growth campaign across GitHub, Discord, and X: the loops, the content calendar, and the pipeline math. Built as a decision-grade marketing & GTM deck for growth team, community lead.

nexu-io/open-design · 55 tokens

hr-onboarding

A new-hire onboarding plan as a single page — first week schedule, buddy + manager intro, learning track, equipment checklist, and "you're set when…" outcomes. Use when the brief mentions "onboarding", "new hire", "first week plan", or "入职".

nexu-io/open-design · 62 tokens

html-ppt-hermes-cyber-terminal

OpenDesign + BYOK: choosing and wiring your own model, hands-on — cost, quality, and the routing decision. Built as a decision-grade AI literacy deck for engineers, IT, applied-AI teams.

nexu-io/open-design · 53 tokens

html-ppt-taste-brutalist

16:9 HTML deck in tactical-telemetry / CRT-terminal taste. Deactivated-CRT charcoal slides, white-phosphor monospace, hazard-red accent, scanline overlay, ASCII syntax, density over decoration. Distilled from Leonxlnx/taste-skill brutalist-skill (Tactical Telemetry mode).

nexu-io/open-design · 78 tokens

digital-health-clinical-asr-finetune

Stage 4 of the Clinical ASR Flywheel. Use when priority KER is above 0.3 to run stock NeMo SFT on Parakeet TDT v2 and offline cycle N+1 re-eval. NOT for generic word boosting (use /finetune-asr).

NVIDIA/skills · 72 tokens

doca-compress

Use this skill for hands-on DOCA Compress programming on a BlueField DPU, ConnectX NIC, or host with DOCA — enabling compress-deflate, decompress-deflate, decompress-lz4-stream, or decompress-lz4-block tasks on a docacompress context (the hardware supports DEFLATE both directions plus LZ4 decompress; LZ4 encode is NOT…

NVIDIA/skills · 242 tokens