convert-to-agent

convert-to-agent is a command for Claude Code from basher83/agent-auditor. It costs 12 tokens per session (1,735 once invoked), scanned A, a copy of convert-to-agent, MIT.

A guide for deciding when a slash command should become a sub-agent, a separate worker with its own context. It focuses on parallel work, isolated context, repeated tasks, and whether later context must be retained.

In plain words
What is it for?
Use it to review a slash command and decide whether to convert it into a project sub-agent.
Why use it?
It helps prevent moving simple or sequential tasks into a form that adds unnecessary separation or loses useful context.

Command for Claude Code

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.

agentmods
npx agentmods add commands/basher83/agent-auditor/convert-to-agent
Clone the repo
git clone --depth 1 https://github.com/basher83/agent-auditor

Made for: Claude Code.

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 convert-to-agent

README.md
[![agentmods](https://agentmods.dev/badge/commands/basher83/agent-auditor/convert-to-agent.svg)](https://agentmods.dev/commands/basher83/agent-auditor/convert-to-agent)
Your own site
<a href="https://agentmods.dev/commands/basher83/agent-auditor/convert-to-agent"><img src="https://agentmods.dev/badge/commands/basher83/agent-auditor/convert-to-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,735 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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 $0.00012 $0.01735
Opus 5 $0.00006 $0.00868
Sonnet 5 $0.00002 $0.00347
Haiku 4.5 $0.00001 $0.00173

Measured 4d ago against content hash c9cdd5d4fd58, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

convert-to-agent 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 4d ago.

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.

Origin

This is a copy

100% identical to convert-to-agent — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/commands/convert-to-agent.md · 237 lines

How it starts

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

Convert Slash Command to Sub-Agent

You are tasked with converting a slash command to a sub-agent definition. This conversion should ONLY happen when appropriate based on the decision criteria.

Input

You will receive a file path to a slash command file via $ARGUMENTS.

Decision Criteria - MUST VALIDATE FIRST

Before converting, you MUST validate that conversion is appropriate. A slash command should become a sub-agent ONLY when:

Convert when:

  • Parallelization is needed - "Whenever you see parallel, you should always just think sub-agents"
  • Context isolation is required - You want to protect the main context window
  • Scale/batch operations - Running the same task multiple times in parallel
  • You're okay losing context afterward - Sub-agent context doesn't persist (unless resumable)

Do NOT convert when:

  • One-off task - Keep as slash command
  • Context matters later - Use main conversation instead
  • Sequential operations - Keep as slash command or consider skill
  • Simple repeatable actions - Keep as slash command

Critical Anti-Pattern Warning

From official guidance:

"There are a lot of engineers right now that are going all in on skills. They're converting all their slash commands to skills. I think that's a huge mistake."

The same applies to sub-agents. Do not convert slash commands to sub-agents unless there's a clear need for parallelization or context isolation.

Conversion Process

Step 1: Read the slash command file

Read the file at $ARGUMENTS

Step 2: Orchestrator Detection (Check FIRST)

Immediately after reading the file, analyze the content to detect if this is an orchestrator:

Check frontmatter:

  • Does allowed-tools field contain Task?

Check body content for these keywords:

  • "Task tool"
  • "subagent" / "sub-agent"
  • "spawn"
  • "parallel agent"
  • "multiple Task tool"
  • "launch all subagents"
  • "orchestrate"

If ANY orchestrator indicator is found:

Read the full file on GitHub · 237 lines

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. 4d ago First seen · 237 lines · 12 tokens per session scan A c9cdd5d4fd58

Subscribe to this mod's changes

convert-to-agent is a command published in the GitHub repository basher83/agent-auditor (5 stars, last pushed 6mo ago), licensed MIT. It adds 12 tokens to every session and 1,735 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to convert-to-agent, differing in 0 lines, and is treated as a copy.