subagents-management
This skill uses Claude hooks which can execute code automatically in response to events. Review carefully before installing.
Subagents & Skills Management
Manage subagents, skills, and instruction files for coding agents.
- Claude Code: Subagents in
~/.claude/agents/and.claude/agents/ - Codex CLI: AGENTS.md instructions + skills in
~/.agents/skills/and.agents/skills/
IMPORTANT: After creating, modifying, or deleting subagents/skills, inform the user that they need to restart the agent for changes to take effect.
CRITICAL: Before performing any deletion operation, you MUST use the AskUserQuestion tool to confirm with the user. Never delete a subagent without explicit user confirmation, even if using --force flag or direct rm commands.
Operations
List Subagents
python3 {SKILL_PATH}/scripts/list_subagents.py [--scope user|project|all] [--json]
Create Subagent
Write a markdown file directly to the appropriate scope directory:
User scope: ~/.claude/agents/{name}.md
Project scope: .claude/agents/{name}.md
Template:
---
name: {name}
description: {when Claude should use this subagent}
tools: {comma-separated tools, or omit to inherit all}
model: {sonnet|opus|haiku|inherit}
---
{System prompt - instructions for the subagent}
Or use the helper script:
python3 {SKILL_PATH}/scripts/create_subagent.py {name} \
--description "..." \
--prompt "..." \
--scope {user|project} \
--tools "Read,Grep,Glob" \
--model sonnet
Edit Subagent
- Find the file:
~/.claude/agents/{name}.mdor.claude/agents/{name}.md - Edit the frontmatter and/or system prompt using Edit tool
Move Subagent
python3 {SKILL_PATH}/scripts/move_subagent.py {name} --to {user|project} [--overwrite]
Or manually:
- Read the source file
- Write to target directory
- Delete source file
Delete Subagent
⚠️ ALWAYS confirm with user before deleting. Use AskUserQuestion to ask: "Are you sure you want to delete the subagent '[name]'? This action cannot be undone."
python3 {SKILL_PATH}/scripts/delete_subagent.py {name} [--scope user|project] [--force]
Or delete directly (still requires user confirmation via AskUserQuestion first): rm ~/.claude/agents/{name}.md or rm .claude/agents/{name}.md
Codex CLI: AGENTS.md & Skills
Codex uses AGENTS.md (equivalent to CLAUDE.md) for project instructions and a skills system for reusable capabilities.
AGENTS.md
~/.codex/AGENTS.md # Global instructions
<project-root>/AGENTS.md # Project instructions
<project-root>/sub/AGENTS.md # Subdirectory instructions (additive)
Skills
~/.agents/skills/my-skill/SKILL.md # User skills
<project-root>/.agents/skills/my-skill/SKILL.md # Project skills
See references/codex-agents.md for Codex agents/skills reference.
Key Concepts (Claude Code)
- User scope (
~/.claude/agents/): Available in all projects - Project scope (
.claude/agents/): Specific to current project, higher priority - Subagents reload on session restart or via
/agentscommand - See references/claude-subagents.md for Claude Code subagent schema
Common Patterns
Read-only reviewer:
tools: Read, Grep, Glob
model: haiku
Full-access helper:
# omit tools field to inherit all
model: inherit
Restricted with hooks:
tools: Bash
hooks:
PreToolUse:
- matcher: "Bash"
hooks:
- type: command
command: "./validate.sh"
More from codealive-ai/agents-reflection-skills
skills-management
Search, find, discover, install, remove, update, review, list, and move skills for AI coding agents. Use when user asks "find a skill for X", "search for a skill", "is there a skill for X", "install skill", "remove skill", "update skills", "list skills", "review skill quality", "move skill", "check for updates", or "how do I do X" where X might have an existing skill. This is THE tool for skill discovery and ecosystem search.
7hooks-management
Manage hooks and automation for coding agents (Claude Code, Codex CLI). Use when users want to add, list, remove, update, or validate hooks. Triggers on requests like "add a hook", "create a hook that...", "list my hooks", "remove the hook", "validate hooks", or any mention of automating agent behavior with shell commands.
6mcp-management
Search, install, configure, update, and remove MCP servers across coding agents (Claude Code, Cursor, VS Code, Claude Desktop, Gemini CLI, Codex, Goose, Zed, and more). Supports multi-agent installation via npx add-mcp, the official MCP registry, and direct config editing.
6settings-management
View and configure settings for coding agents (Claude Code, Codex CLI, and others). Covers JSON settings for Claude Code and TOML config for Codex CLI, including permissions, sandbox, model selection, and profiles.
2optimizing-claude-code
Audits repositories for Claude Code readiness and suggests improvements. Use when asked to check CLAUDE.md quality, review settings, audit project organization, or optimize for agentic work.
2plugins-management
Create, publish, delete, and submit Claude Code plugins. Use when user wants to (1) create a new plugin with proper structure, (2) create or configure a plugin marketplace, (3) publish plugins to GitHub/GitLab, (4) delete/uninstall plugins, (5) validate plugin structure, or (6) prepare and submit plugins to the official Anthropic directory.
2