sub-agents

sub-agents is a skill for Claude Code, Codex from shinpr/sub-agents-skills. It costs 38 tokens per session (1,336 once invoked), scanned A, original, MIT.

A tool for running named agent definitions as separate helper processes. These helpers can use different command-line AI tools and work with their own context.

In plain words
What is it for?
Use it when a task should be handed to a specific sub-agent or when a workflow calls for external AI task delegation.
Why use it?
It lets you delegate focused tasks without filling the main agent's context with every detail. It also provides a standard way to choose an agent, task, working folder, and optional timeout.

Skill for Claude CodeCodex

Written for Claude Code and Codex: allowed-tools in frontmatter, but also agents/openai.yaml present. Also seen: mentions subagents; mentions Codex; mentions OpenCode.

Part of the runner plugin — 1 skill shipped together

Good fit Use it when a task should be handed to a specific sub-agent or when a workflow calls for external AI task delegation.

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

Made for: Claude Code, Codex.

Or install runner, the plugin that ships this one along with the rest of its 1 skill.

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 sub-agents

README.md
[![agentmods](https://agentmods.dev/badge/skills/shinpr/sub-agents-skills/sub-agents.svg)](https://agentmods.dev/skills/shinpr/sub-agents-skills/sub-agents)
Your own site
<a href="https://agentmods.dev/skills/shinpr/sub-agents-skills/sub-agents"><img src="https://agentmods.dev/badge/skills/shinpr/sub-agents-skills/sub-agents.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,336 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 warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 158
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
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.00038 $0.01336
Opus 5 $0.00019 $0.00668
Sonnet 5 $0.00008 $0.00267
Haiku 4.5 $0.00004 $0.00134

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

Security

Grade A, and why

sub-agents 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 8d ago.

The scan reads SKILL.md. This mod also ships 6 executable files (scripts/_builder.py, scripts/_constants.py, scripts/_executor.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

plugins/runner/skills/sub-agents/SKILL.md · 159 lines

How it starts

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

Sub-Agents - External CLI AI Task Delegation

Spawns external CLI AIs (codex, claude, cursor-agent, glm, kimi, grok, antigravity, gemini, opencode, command-code) as isolated sub-agents with dedicated context.

Workflow: discover available definitions, select one from the user request, execute it, and handle the JSON response.

Resources

  • run_subagent.py - Main execution script
  • codex.md - Read before first execution from Codex; covers permissions and timeout

Script Path: Use absolute path {SKILL_DIR}/scripts/run_subagent.py where {SKILL_DIR} is the directory containing this SKILL.md file.

Interpreting User Requests

Extract parameters from user's natural language request:

Parameter Source
--agent Agent name from the user request or workflow selection
--prompt Task instruction part (excluding agent specification)
--cwd Current working directory (absolute path)
--cli Backend override explicitly requested by the user; otherwise omit
--timeout Timeout explicitly requested by the user, converted to milliseconds; otherwise omit (default: 600000)

Example: "Run code-reviewer on src/" → --agent code-reviewer --prompt "Review src/" --cwd $(pwd)

Important: Permission and Timeout

This script executes external CLIs that require elevated permissions.

Before first execution:

  1. Request elevated permissions via your CLI's tool parameters
  2. Set tool timeout to match --timeout argument (default: 600000ms)

For Codex CLI (most common permission issues): See references/codex.md for exact JSON parameter format.

Workflow

Step 1: List Available Agents

Always list agents first to discover available definitions:

{SKILL_DIR}/scripts/run_subagent.py --list

Output:

{"agents": [{"name": "code-reviewer", "description": "Reviews code..."}], "agents_dir": "/path/.agents"}

Read the full file on GitHub · 159 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 159 lines · 38 tokens per session scan A 0c638aed15c5

Subscribe to this mod's changes

sub-agents is a skill published in the GitHub repository shinpr/sub-agents-skills (83 stars, last pushed 2d ago), licensed MIT. It adds 38 tokens to every session and 1,336 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.