sub-agents
Skill10 starsChanged 4 months agoMITView on GitHub
Execute external CLI AIs as isolated sub-agents for task delegation, parallel processing, and context separation. Use when delegating complex multi-step tasks, running parallel investigations, needing fresh context without current conversation history, or leveraging specialized agent definitions. Returns structured JSON with agent output, exit code, and execution status.
7 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- blindlove200/sub-agents-skillsedited, first seen Nov 8, 2026
- shinpr/sub-agents-skillsedited, first seen Nov 1, 2026
- parcadei/Continuous-Claudetheir own version, first seen Oct 17, 2026
- parcadei/Continuous-Claude-v2their own version, first seen Oct 8, 2026
- MeRezaRezaei/goal-driven-parallel-agentstheir own version, first seen Sep 20, 2026
- modal-projects/modal-auto-research-skillstheir own version, first seen Apr 14, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- shinpr/sub-agents-skills★ 9935% same
- blindlove200/sub-agents-skills★ 597% same
Wrote their own version · 5
- parcadei/Continuous-Claude★ 3.9ksame name
- parcadei/Continuous-Claude-v2★ 3.9ksame name
- parcadei/Continuous-Claude-v3★ 3.9ksame name
- modal-projects/modal-auto-research-skills★ 47same name
- MeRezaRezaei/goal-driven-parallel-agents★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository177 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- docs/llms-full.txtllms.txt
- docs/llms.txtllms.txt
- llms.txtllms.txt
- academic-cv-builderSkill
- agenticx-a2a-connectorSkill
- agenticx-agent-builderSkill
- agenticx-automation-crontaskSkill
- agenticx-deployerSkill
- agenticx-memory-architectSkill
- agenticx-quickstartSkill
- agenticx-skill-managerSkill
- agenticx-tool-creatorSkill
- agenticx-workflow-designerSkill
- ai-slop-detectorSkill
- alert-managerSkill
- algorithmic-artSkill
- api-gatewaySkill
- backlink-analyzerSkill
- brand-guidelinesSkill
- canvas-designSkill
- career-changer-translatorSkill
- Codex-apiSkill
- Codex-skill-rustSkill
- claw-releaseSkill
- clawsec-clawhub-checkerSkill
- clawsec-feedSkill
- clawsec-nanoclawSkill
- clawsec-scannerSkill
- clawsec-suiteSkill
- clawtributorSkill
- cn-statsSkill
- codebase-documenterSkill
- code-dev-workflowSkill
- competitor-analysisSkill
- content-experimentation-best-practicesSkill
- content-gap-analysisSkill
- content-modeling-best-practicesSkill
- content-quality-auditorSkill
- content-refresherSkill
- context-mode-opsSkill
- context-modeSkill
- cover-letter-generatorSkill
- creative-portfolio-resumeSkill
- crypto-reportSkill
- ctx-doctorSkill
- ctx-insightSkill
- ctx-purgeSkill
- ctx-statsSkill
- ctx-upgradeSkill
- deep-cleanSkill
- doc-coauthoringSkill
- docxSkill
- domain-authority-auditorSkill
- edgeoneSkill
- edge-ttsSkill
- entity-optimizerSkill
- executive-resume-writerSkill
- fallowSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 4 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Script Path: Use absolute path {SKILL_DIR}/scripts/run_subagent.py where {SKILL_DIR} is the directory containing this SKILL.md file.
- Distinctive: line 20
Check the corresponding reference for your environment:
- Distinctive: line 21
Codex: Read references/codex.md BEFORE first execution
- Very specific: line 34
Run --list to get available agents
- Distinctive: line 65
If you are running on Codex, read references/codex.md first.
- Distinctive: line 82
Add agent definition file (see Agent Definition Format)
- Very specific: line 143
Place .md files in .agents/ directory:
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Sub-Agents - External CLI AI Task Delegation
Spawns external CLI AIs (Codex, cursor-agent, codex, gemini) as isolated sub-agents with dedicated context.
Resources
- run_subagent.py - Main execution script
- codex.md - Codex-specific setup (permissions, timeout)
Script Path: Use absolute path {SKILL_DIR}/scripts/run_subagent.py where {SKILL_DIR} is the directory containing this SKILL.md file.
CLI-Specific Notes
Check the corresponding reference for your environment:
- Codex: Read references/codex.md BEFORE first execution
Interpreting User Requests
Extract parameters from user's natural language request:
| Parameter | Source |
| --agent | Agent name from user request (see selection rules below) |
| --prompt | Task instruction part (excluding agent specification) |
| --cwd | Current working directory (absolute path) |
Agent Selection Rules (when user doesn't specify agent name):
- Run
--listto get available agents - 0 agents: Inform user no agents available, show setup instructions (see Agent Definition Format)
- 1 agent: Auto-select without asking
- 2+ agents: Show list with descriptions, ask user to choose
Example:
"Run code-reviewer on src/"
→ --agent code-reviewer --prompt "Review src/" --cwd $(pwd)
When to Use This Skill
Use sub-agent when ANY of these apply:
- Complex multi-step task (isolated context prevents interference)
- Parallel investigation (multiple agents can run simultaneously)
- Task needs fresh context (sub-agent starts without conversation history)
- Specialized agent definition exists (leverage pre-defined expert prompts)
Important: Permission and Timeout
This script executes external CLIs that require elevated permissions.
Before first execution:
- Request elevated permissions via your CLI's tool parameters
- Set tool timeout to match
--timeoutargument (default: 600000ms)
For Codex CLI (most common permission issues): See references/codex.md for exact JSON parameter format.
Workflow
Step 0: Read CLI-Specific Setup (if applicable)
If you are running on Codex, read references/codex.md first.
Step 1: List Available Agents
Always list agents first to discover available definitions:
scripts/run_subagent.py --listOutput:
{"agents": [{"name": "code-reviewer", "description": "Reviews code..."}], "agents_dir": "/path/.agents"}If agents list is empty:
- Create
{cwd}/.agents/directory - Add agent definition file (see Agent Definition Format)
- Re-run
--listto verify
Step 2: Execute Agent
scripts/run_subagent.py \
--agent <name> \
--prompt "<task>" \
--cwd <absolute-path>Step 3: Handle Response
Parse JSON output and check status field:
{"result": "...", "exit_code": 0, "status": "success", "cli": "Codex"}By status:
| status | Meaning | Action |
success | Task completed | Use result directly |
partial | Timeout but has output | Review partial result, may need retry |
error | Execution failed | Check error field and exit_code, fix and retry |
By exit_code (when status is error):
| exit_code | Meaning | Resolution |
| 0 | Success | - |
| 124 | Timeout | Increase --timeout or simplify task |
| 127 | CLI not found | Install required CLI (Codex, codex, etc.) |
| 1 | General error | Check error field in response |
Parameters
| Parameter | Required | Description |
--list | - | List available agents (no other params needed) |
--agent | Yes* | Agent definition name from --list |
--prompt | Yes* | Task description to delegate |
--cwd | Yes* | Working directory (absolute path) |
--timeout | No | Timeout ms (default: 600000) |
--cli | No | Force CLI: Codex, cursor-agent, codex, gemini |
*Required when not using --list
Agent Definition Location
| Priority | Source | Path |
| 1 | Environment variable | $SUB_AGENTS_DIR |
| 2 | Default | {cwd}/.agents/ |
To customize: export SUB_AGENTS_DIR=/custom/path
Agent Definition Format
Place .md files in .agents/ directory:
---
run-agent: Codex
---
# Agent Name
Brief description of agent's purpose.
## Task
What this agent does.
## Output Format
How results should be structured.Critical: The run-agent frontmatter determines which CLI executes the agent. See cli-formats.md for CLI-specific behaviors.
CLI Selection Priority
--cliargument (explicit override)- Agent definition
run-agentfrontmatter - Auto-detect caller environment
- Default:
codex
Common Mistakes
| Mistake | Result | Fix |
Skip --list before execution | Agent not found error | Always run --list first |
Use relative path for --cwd | Validation fails | Use absolute path |
Ignore status field in response | Undetected errors | Always check status before using result |
| Very long prompts | May exceed CLI limits | Break into smaller tasks |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

