use-claude-code-subagents
Installation
SKILL.md
Use Claude Code subagents
When to use
Cursor's Task tool pins custom subagents to the parent model when a personal Anthropic API key is on, or when the agent's model is not enabled in Cursor. This skill runs the project's custom subagents through Claude Code (headless claude -p) so each runs on the model: in its own agent file. The mode lasts for the rest of the chat. When the user says "use cursor subagents", switch back to the Task tool and confirm in one line.
Skip for Cursor's built-in subagents (explore, generalPurpose, ...), for Cloud Agents (no claude CLI there), and for any agent whose model: is missing, inherit, or not Anthropic (see step 2). Those keep using the Task tool.
Before you start
- Gather first. Read the agent file for each agent named (step 1) before you ask the user anything.
- Consent. If the user typed
/use-claude-code-subagentsor asked for Claude Code subagents, continue. If this skill loaded on its own (the user only described a symptom), ask once: "Run custom subagents through Claude Code? Runs bill your Claude Code account and edits bypass Cursor's review and undo. Reply yes to switch." Wait for yes. On no, use the Task tool. - Reply exactly:
Subagent mode: claude code. - Preflight once. Run
claude --versionfrom the Shell tool withrequired_permissions: ["all"]. This skill needs Claude Code 2.1.281 or later (--permission-promptsneeds 2.1.259, the--agents <file>form needs 2.1.281). If the command fails, point the user to the Claude Code setup guide and tell them to runclaudeonce to sign in. If the version is older, ask them to runclaude update. Stay in Cursor native mode until it passes. - Light path. For one agent and one task, do steps 1, 2, 4 and 5 with a single
claudecall. Skip parallel runs and--resumeunless the agent asks a question. - If the user's message included a task, do it. Otherwise wait.