parallel-subagent

A workflow for sending independent coding tasks to separate worktree branches, which are isolated copies of a Git repository. The tasks are completed separately and then merged back together.

In plain words
What is it for?
Use it for three or more independent fixes, such as separate failing tests or unrelated subsystems, with each task verified before merging.
Why use it?
It prevents parallel changes from interfering with one another when several unrelated problems need work at the same time.

Agent

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 agents/freepeak/leankg/parallel-subagent
Clone the repo
git clone --depth 1 https://github.com/FreePeak/LeanKG
Per session 31 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 351 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00031 $0.00351
Opus 5 $0.00015 $0.00176
Sonnet 5 $0.00006 $0.00070
Haiku 4.5 $0.00003 $0.00035

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

Security

Grade A, and why

parallel-subagent scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.commandcode/agents/parallel-subagent.md · 41 lines

What it actually says

Parallel Subagent Workflow

When facing 3+ independent tasks that can work in parallel without shared state:

  1. Dispatch multiple subagents - One agent per independent problem domain
  2. Each agent works in isolated .worktree/ - Prevents interference between agents
  3. Each worktree uses feature branch - Format: .worktree/<feature-name>/
  4. Verify isolation - Confirm directory is in .gitignore
  5. Run baseline tests - Ensure clean starting point per worktree
  6. Agent completes independently - Agent returns summary of changes
  7. Merge to main - After all agents complete, merge each feature branch to main
# Example workflow
Agent 1 -> .worktree/feature-a/ (works on tests in file_a.test.ts)
Agent 2 -> .worktree/feature-b/ (works on tests in file_b.test.ts)
Agent 3 -> .worktree/feature-c/ (works on tests in file_c.test.ts)

# After all complete
git checkout main
git merge feature-a
git merge feature-b
git merge feature-c
git push

When to use:

  • 3+ test files failing with different root causes
  • Multiple subsystems broken independently
  • Each problem can be understood without context from others

When NOT to use:

  • Failures are related (fix one might fix others)
  • Need to understand full system state
  • Agents would interfere with each other
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 · 41 lines · 31 tokens per session scan A 388bcc949beb

Subscribe to this mod's changes

parallel-subagent is an agent published in the GitHub repository FreePeak/LeanKG (215 stars, last pushed 9d ago), licensed Apache-2.0. It adds 31 tokens to every session and 351 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

tool-hub

Первая встроенная поверхность Tool Hub: восемь типизированных video. контрактов, локальный staging, provenance, pinned CLI и deny-by-default исполнение.

romarayt/raytsystem-public-os · 34 tokens

creating-extensions

Как устроены skill (skills//SKILL.md), определение агента (packs//agents/.yaml) и pack. Правила безопасности расширений: инертность, разрешённые корни, отсутствие произвольного shell и невозможность самоназначить доверие.

romarayt/raytsystem-public-os · 58 tokens

README

This folder consolidates, in a single location, the SoT for the project's five multi-agent roles plus the Universal Cycle skeleton. It is modeled on the role system of a Korean newspaper, and each role is self-contained in its capability boundary, I/O contract, and prompt template.

alfadur7/llm-wiki-newsroom · 0 tokens

editor-in-chief

Entry point for the 9 slash commands + agent routing + publish gate + ADAPT escalation counter + log operation + invoking the deterministic tools (build/lint/export/fetch). The meta layer outside the matrix — governs flow above every cycle. Does not author content directly (routing only).

alfadur7/llm-wiki-newsroom · 61 tokens

po-steward

Steward seat on the Atlas PO Council. Sole owner of ontology and agent value; protects typed meaning, provenance, handoff, and local-first truth.

wlsdks/ontology-atlas · 36 tokens

design-handoff

Agent Handoff Designer on the Atlas bench. Keeps real MCP and CLI next actions visible, state-bound, portable, and usable by both people and agents.

wlsdks/ontology-atlas · 35 tokens