ML.ai CodeAgents

Custom subagents

Asking ML.ai to build you a new subagent, and why a restart is required before it appears.

Creating one

You don't write an agent definition by hand. Describe what you want in plain language and ML.ai generates the definition for you:

Create a subagent that reviews pull requests for security issues.

ML.ai uses its bundled create-subagent skill to compose a full agent definition from that description. This isn't a template with blanks filled in: it's a generated definition tailored to what you asked for, covering the subagent's scope, its instructions, and which tools it's allowed to use. The result is written to your project's .opencode/agent/ directory, as a file you can open and edit by hand afterward if you want to adjust anything the generated version got wrong.

The restart step

After a new subagent is created, run ML.ai: Restart Engine from the Command Palette before it will show up. The engine only reads agent definitions at startup, so a subagent written to disk mid-session stays invisible to the @ menu and to Settings → Agents until you restart.

This is the same restart requirement that applies to newly added skills. See troubleshooting for the "skills or agents are missing" case.

After restarting

The new subagent appears in the @ picker and in Settings → Agents, alongside General, Explore, and any other custom subagents already defined for the project.