subagent-optimizer
Subagent optimizer
Audit Claude Code subagent files and Codex custom agent files, propose token-economy + quality fixes, then apply the approved ones and bump each changed Claude agent's version (Codex agent files have no version field).
The biggest win is the tools field: an agent with no tools inherits every
tool available to subagents, loading all schemas on every launch, and every extra
schema costs tokens and selection accuracy. Read references/best-practices.md for
the rationale behind each flag and references/tool-catalog.md for the tool list
and archetype → tools map — consult both before proposing tool changes.
All paths below are relative to this skill's directory: in Claude Code that is
${CLAUDE_SKILL_DIR}; in Codex it is wherever this SKILL.md was loaded from (the
user's or a project's .agents/skills/subagent-optimizer/, or the older Codex skills
folder). Resolve scripts from that directory, not from a guessed home path.