spawner

spawner is a skill for Claude Code, Codex from khalilbenaz/claude-skills-collection. It costs 83 tokens per session (2,408 once invoked), scanned A, original, MIT.

A skill for creating and managing smaller agents dynamically while a system is running. It covers agent setup, lifecycles and allocation of computing resources.

In plain words
What is it for?
Use it to create specialised agents on demand, configure their tools and models, and manage variable workloads.
Why use it?
It helps when the number or type of agents needed is not known in advance or changes with the work.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Use it to create specialised agents on demand, configure their tools and models, and manage variable workloads.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/khalilbenaz/claude-skills-collection/spawner
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 khalilbenaz/claude-skills-collection --skill spawner
Clone the repo
git clone --depth 1 https://github.com/khalilbenaz/claude-skills-collection

Made for: Claude Code, Codex.

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 spawner

README.md
[![agentmods](https://agentmods.dev/badge/skills/khalilbenaz/claude-skills-collection/spawner/github.svg)](https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/spawner)
Your own site
<a href="https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/spawner"><img src="https://agentmods.dev/badge/skills/khalilbenaz/claude-skills-collection/spawner/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 spawner

Your own site · 80×15
<a href="https://agentmods.dev/skills/khalilbenaz/claude-skills-collection/spawner"><img src="https://agentmods.dev/badge/skills/khalilbenaz/claude-skills-collection/spawner.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,408 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00083 $0.02408
Opus 5.5 $0.00033 $0.00963
Sonnet 5.5 $0.00017 $0.00482
Haiku 4.5 $0.00008 $0.00241

Measured 3mo ago against content hash cb43d340601a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

spawner 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 3mo 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.

agent-skills/spawner/SKILL.md · 251 lines

How it starts

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

Agent Spawner

Quand utiliser ce skill

Condition Spawner requis ?
Nombre d'agents inconnu à l'avance Oui
Agents identiques, volume variable Oui (+ pool-manager)
Agents fixes et connus en design-time Non — câbler statiquement
Besoin de parallélisme homogène Préférer agent-pool-manager
Types d'agents différents selon le contexte Oui

Workflow en étapes

1. Concevoir les templates d'agents

Chaque template encode une spécialisation. Définir au minimum :

from dataclasses import dataclass, field
from typing import Optional

@dataclass
class AgentTemplate:
    name: str                          # identifiant du gabarit
    system_prompt: str                 # supporte les placeholders {domain}, {task}…
    tools: list[str]                   # liste des tools autorisés
    model: str = "claude-sonnet-4-5"   # modèle par défaut
    max_tokens: int = 4096
    timeout_seconds: int = 120

Exemples de templates courants :

  • researcher — search_web, fetch_url, modèle léger (haiku)
  • coder — bash, read_file, write_file, modèle puissant (sonnet/opus)
  • reviewer — lecture seule, modèle sonnet
  • summarizer — aucun tool, haiku suffit

2. Critères de décision : quel modèle choisir ?

Criticité / Complexité Modèle recommandé
Analyse simple, résumé claude-haiku-4
Tâche de code standard claude-sonnet-4-5
Raisonnement multi-étapes, debugging claude-opus-4
Réponses temps-réel < 2 s claude-haiku-4

Règle : ne jamais utiliser opus pour les agents répétitifs à fort volume — le coût est 10–20× celui de haiku.

3. Implémenter la factory

import uuid
from datetime import datetime, timezone

@dataclass
class AgentInstance:
    id: str = field(default_factory=lambda: str(uuid.uuid4()))
    template_name: str = ""
    status: str = "created"   # created | running | done | failed | terminated
    created_at: datetime = field(default_factory=lambda: datetime.now(timezone.utc))
    parent_id: Optional[str] = None
    result: Optional[str] = None
    error: Optional[str] = None

class AgentFactory:
    _templates: dict[str, AgentTemplate] = {}
    _registry: dict[str, AgentInstance] = {}
    _max_concurrent: int = 10

    @classmethod
    def register_template(cls, t: AgentTemplate) -> None:
        cls._templates[t.name] = t

    @classmethod
    def spawn(cls, template_name: str, context: dict, parent_id: str | None = None) -> AgentInstance:
        running = sum(1 for a in cls._registry.values() if a.status == "running")
        if running >= cls._max_concurrent:
            raise RuntimeError(f"Limite {cls._max_concurrent} agents concurrents atteinte")

        tpl = cls._templates[template_name]
        agent = AgentInstance(template_name=template_name, parent_id=parent_id)
        cls._registry[agent.id] = agent

        enriched_prompt = tpl.system_prompt.format(**context)
        agent.status = "running"
        print(f"[SPAWN] {agent.id} ({template_name}) parent={parent_id} at {agent.created_at.isoformat()}")
        return agent

    @classmethod
    def terminate(cls, agent_id: str, result: str | None = None, error: str | None = None) -> None:
        if a := cls._registry.get(agent_id):
            a.status = "failed" if error else "terminated"
            a.result, a.error = result, error

    @classmethod
    def gc(cls, timeout_s: int = 300) -> list[str]:
        """Libère les agents bloqués en 'running' depuis trop longtemps."""
        now = datetime.now(timezone.utc)
        stale = [
            a.id for a in cls._registry.values()
            if a.status == "running" and (now - a.created_at).total_seconds() > timeout_s
        ]
        for aid in stale:
            cls.terminate(aid, error="GC timeout")
        return stale

    @classmethod
    def active(cls) -> list[AgentInstance]:
        return [a for a in cls._registry.values() if a.status == "running"]

Read the full file on GitHub · 251 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. 3mo ago First seen · 251 lines · 83 tokens per session scan A cb43d340601a

Subscribe to this mod's changes

spawner is a skill published in the GitHub repository khalilbenaz/claude-skills-collection (27 stars, last pushed 3mo ago), licensed MIT. It adds 83 tokens to every session and 2,408 once invoked, about $0.0003 per session on Opus 5.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

spawner compared with skills from other repositories

spawner next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
spawnerkhalilbenaz/claude-skills-collectionSkill273mo agoMITA83Claude Code, Codex
explainsoftspark/ai-toolkitSkill18013d agoApache-2.0A34Claude Code
finance-econ-literacymodu-ai/moai-coworkSkill3201mo agoApache-2.0A128Claude Code
exposure-guidanceellmos-ai/skillsSkill10todayMITA117Claude Code, Codex
systemisch-loesungsfokussiertellmos-ai/skillsSkill10todayMITA127Claude Code, Codex
trauma-psychoeducationellmos-ai/skillsSkill10todayMITA40Claude Code, Codex
act-techniquesellmos-ai/skillsSkill10todayMITA127Claude Code, Codex