Best practices
- CLI
- >=0.28.1
- Skill
- >=1.4.2
- Executors
- claude-code, codex, gemini-antigravity
- System
- macos
- Reviewed on
- 2026-10-30
Sub-agents
A sub-agent is a second instance of the LLM that receives a bounded task, works in its own conversation, and returns only the conclusion. What it read doesn't enter your main conversation, which keeps the context small. Each executor offers its own way of using one, and not every executor offers it; this page describes what holds when it exists.
Two roles
- Reading sub-agent: reads, searches and reviews, and returns the conclusion. It doesn't change anything and doesn't touch the board. This is the most common use, and the rest of this page is about it.
- Executor sub-agent: takes a whole issue through the workflow, with its own governed flow and in its own worktree, as far as you authorize, usually up to opening the PR. It exists only when you ask for it and authorize it. It's what lets you run several issues together: see Running batches in parallel.
When to use
- Broad search: finding where something is defined or used across many files.
- Reading a lot of material when you only need the conclusion.
- Independent parts of the same delivery, which don't depend on each other's result.
- Independent review: a second reading of something you wrote, without inheriting your conclusion.
When not to use
- A simple lookup, where you already know where the answer is.
- A stage whose result you'll need to review line by line.
- Work that depends on decisions only you make.
How to delegate
- Say what to look for and where. A clear scope avoids a pointless sweep.
- Limit what comes back. “Up to 15 lines, with file and line” keeps the report from returning everything it read.
- Say what it doesn't do. In reading tasks: it doesn't change anything and doesn't touch the board.
- Use the right model. Reading and searching don't call for the most expensive model, if the executor lets you choose.
- Mind parallelism. Several sub-agents in the same working folder can collide. Give each one its own subfolder and sync the repository before you start. A sub-agent that edits code needs its own worktree and branch.
What a sub-agent never does for you
A reading sub-agent doesn't approve a stage, doesn't advance the issue, and doesn't change the board. An executor sub-agent does that only on the issue it was given, within what you authorized and what the workflow allows: it doesn't skip a gate, doesn't use another issue's grant, and doesn't merge, release or move the issue to QA without you. In both cases it operates under the same rules as your organization's workflow, and the main conversation answers for the result. Check what it returned before acting on it; for an executor, also check the PR and the board.
About cost
The report a sub-agent returns doesn't show the whole cost: its work happens in a separate conversation. Delegating saves the main context, but it isn't free. A sub-agent with no limit can cost more than the task you wanted to simplify. See Cost and context.
Prompt templates
Reading sub-agent:
/malha-os-workflow Use a sub-agent only to read [area]. Return up to 15 lines with file and line. It doesn't change anything or touch the board.
Executor sub-agent:
/malha-os-workflow Use an executor sub-agent for ABC-123, with its own worktree, branch and governed flow, up to opening the PR. It stops on any decision the spec doesn't cover and doesn't merge. Then check the PR and the board.
Status
- Available: this guidance. Claude Code and Codex used sub-agents in a read-only test, without changing anything. In Claude Code, executor sub-agents took the issues of an epic to a PR in parallel, with the operator's authorization.
- Limitation: the name, the command, and the options (such as choosing the model) vary by executor and by version; check your executor's documentation. In other executors, confirm that it offers sub-agents.