Custom Agents

A subagent is a separate worker Command Code hands a task to. It runs in its own context window with its own tools, system prompt, and (optionally) its own model. Command Code can run several at once, so work like editing three modules can happen in parallel instead of one at a time.

Three built-in agents are always available: General, Explore, and Plan. You can add your own as Markdown files.

The fastest way to make a subagent is to ask for one:

create a code-reviewer subagent that reviews diffs for bugs and security issues

Command Code writes the agent file for you. From then on it delegates to that agent when the task matches.

To manage agents yourself, run:

/agents

That's it for getting started. The rest of this page covers making agents by hand, how delegation works, and the full file reference.

These ship with Command Code and are always available. They're read-only - you can't edit or delete them.

AgentWhen it runsTools
GeneralThe default when no other agent fits. Research and multi-step tasks.All tools
ExploreCodebase search and understanding that touches many files.Read-only: read_file, read_directory, grep
PlanDesigning an approach and weighing trade-offs.read_file

When Command Code delegates without naming an agent, the task goes to General.

Describe the agent in plain language, as shown in Quick start. Command Code drafts the name, description, system prompt, and a sensible tool set, then saves the file. You review and adjust.

Choosing Create agents with Command Code in the /agents menu shows the same thing - it points you back to just asking:

Create agents with Command Code Ask Command Code to create or update subagents for you, e.g. ‣ "create a code-reviewer subagent that reviews diffs for bugs" ‣ "make a changelog agent that uses a fast model" Or edit the files directly: • .commandcode/agents/ (this project) • ~/.commandcode/agents/ (all projects)