legion

legion is a skill for Claude Code from Kasempiternal/Claude-Agent-System. It costs 54 tokens per session (6,487 once invoked), scanned B, original, MIT.

An iterative coordinator for Claude coding agents that repeatedly sends teams of scouts, analysts, and implementation agents to build a project.

In plain words
What is it for?
Use it for a broad project described as a whole, when exploration, analysis, implementation waves, and completion checks are needed.
Why use it?
It keeps checking and starting another work cycle until the project is complete, reaches its iteration limit, or stops making progress.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: model in frontmatter; reads .claude/ paths; mentions subagents.

Part of the cas plugin — 19 skills, 3 hooks, 2 MCP servers shipped together

Good fit Use it for a broad project described as a whole, when exploration, analysis, implementation waves, and completion checks are needed.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kasempiternal/claude-agent-system/legion
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.

Any agent
npx skills add Kasempiternal/Claude-Agent-System --skill legion
Clone the repo
git clone --depth 1 https://github.com/Kasempiternal/Claude-Agent-System

Made for: Claude Code.

Or install cas, the plugin that ships this one along with the rest of its 19 skills, 3 hooks, 2 MCP servers.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for legion

README.md
[![agentmods](https://agentmods.dev/badge/skills/kasempiternal/claude-agent-system/legion/github.svg)](https://agentmods.dev/skills/kasempiternal/claude-agent-system/legion)
Your own site
<a href="https://agentmods.dev/skills/kasempiternal/claude-agent-system/legion"><img src="https://agentmods.dev/badge/skills/kasempiternal/claude-agent-system/legion/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for legion

Your own site · 80×15
<a href="https://agentmods.dev/skills/kasempiternal/claude-agent-system/legion"><img src="https://agentmods.dev/badge/skills/kasempiternal/claude-agent-system/legion.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,487 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00054 $0.06487
Opus 5 $0.00027 $0.03243
Sonnet 5 $0.00011 $0.01297
Haiku 4.5 $0.00005 $0.00649

Measured 9d ago against content hash be96dd8b0bb6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade B, and why

legion scanned grade B 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 9d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

Read `~/.claude/settings.json`. Verify `env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS` is `"1"`.
claude-agent-system-plugin/skills/legion/SKILL.md · 651 lines

How it starts

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

██╗     ███████╗ ██████╗ ██╗ ██████╗ ███╗   ██╗
██║     ██╔════╝██╔════╝ ██║██╔═══██╗████╗  ██║
██║     █████╗  ██║  ███╗██║██║   ██║██╔██╗ ██║
██║     ██╔══╝  ██║   ██║██║██║   ██║██║╚██╗██║
███████╗███████╗╚██████╔╝██║╚██████╔╝██║ ╚████║
╚══════╝╚══════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝  ╚═══╝

         ⚔ Iterative Swarm Army ⚔
           CLAUDE AGENT SYSTEM

MANDATORY: Output the banner above verbatim as your very first message to the user, before any tool calls or other output.

You are entering LEGION ORCHESTRATOR MODE. You are Opus, the CEO orchestrator. You run an iterative swarm loop — each iteration deploys a full team of scouts, a CTO analyst, and wave-based implementation agents, then checks if the project is complete. You keep iterating until the project is done, you hit the max iteration limit, or progress stalls.

This is LEGION: An autonomous iteration loop where each cycle deploys a Hydra-scale parallel swarm. Think of it as a company team that keeps sprinting until the project is fully complete.

Your Role: CEO Orchestrator

  • You are the CEO — you delegate EVERYTHING via Task tool with team_name
  • You NEVER implement code, read scout reports, or analyze plans directly
  • You keep an iteration log with full per-iteration detail — heavy work is delegated to sub-agents, but the log itself is not artificially squeezed
  • You spawn scouts, a CTO analyst, wave-prep analysts, implementation agents, verifiers, and completion assessors
  • You manage the iteration loop: assess → deploy → verify → check completion → repeat or stop
  • You use Agent Teams tools: TeamCreate, TaskCreate/TaskUpdate/TaskList, SendMessage, TeamDelete

Phase 0: Prerequisites Check

Step 1: Locate Skill Directory

Use Glob to find your own templates: Glob("**/skills/legion/templates/scout-assess-prompt.md"). Extract the parent directory path (everything before /templates/). Store this as LEGION_SKILL_DIR — you will use it for all template reads (e.g., {LEGION_SKILL_DIR}/templates/scout-assess-prompt.md).

Read the full file on GitHub · 651 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. 9d ago First seen · 651 lines · 54 tokens per session scan B be96dd8b0bb6

Subscribe to this mod's changes

legion is a skill published in the GitHub repository Kasempiternal/Claude-Agent-System (15 stars, last pushed 1mo ago), licensed MIT. It adds 54 tokens to every session and 6,487 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.