Skip to content

Subagents

Subagents are specialized AI agents that OmniDev can materialize for Claude Code, Cursor, Codex, and OpenCode.

Define subagents in subagents/<name>/agent.toml and subagents/<name>/prompt.md:

my-capability/
├── capability.toml
└── subagents/
└── code-reviewer/
├── agent.toml
└── prompt.md
name = "code-reviewer"
description = "Reviews code for quality and best practices"
[claude]
tools = ["Read", "Glob", "Grep"]
model = "sonnet"
permission_mode = "acceptEdits"
[codex]
model = "gpt-5.4"
model_reasoning_effort = "high"
sandbox_mode = "read-only"
nickname_candidates = ["Atlas", "Delta"]
You are a senior code reviewer.
Focus on correctness, regressions, and missing tests.
FieldRequiredDescription
nameYesUnique identifier used for the generated agent file
descriptionYesHuman-facing guidance for when the subagent should be used
FieldRequiredDescription
toolsNoTool allowlist
disallowed_toolsNoTools to remove from the allowlist
modelNosonnet, opus, haiku, or inherit
permission_modeNodefault, acceptEdits, dontAsk, bypassPermissions, plan
skillsNoSkills to preload for Claude-compatible providers
hooksNoClaude-scoped lifecycle hooks
FieldRequiredDescription
modelNoFull Codex model ID, for example gpt-5.4
model_reasoning_effortNolow, medium, high, or xhigh
sandbox_modeNoread-only, workspace-write, or danger-full-access
nickname_candidatesNoOptional display nicknames for spawned Codex agents

OmniDev writes .claude/agents/<name>.md and maps [claude] settings into Claude’s YAML frontmatter.

OmniDev writes .cursor/agents/<name>.md. Cursor derives its agent settings from the Claude-compatible fields.

OmniDev writes .codex/agents/<name>.toml with the required Codex fields:

name = "code-reviewer"
description = "Reviews code for quality and best practices"
developer_instructions = "You are a senior code reviewer.\nFocus on correctness, regressions, and missing tests."
model = "gpt-5.4"
model_reasoning_effort = "high"
sandbox_mode = "read-only"
nickname_candidates = ["Atlas", "Delta"]

OmniDev writes .opencode/agents/<name>.md. OpenCode continues deriving its defaults from the Claude-compatible fields, including model and permission mappings.

Preferred programmatic shape:

import type { CapabilityExport, SubagentExport } from "@omnidev-ai/core";
const reviewer: SubagentExport = {
agentToml: `name = "code-reviewer"
description = "Reviews code for quality and best practices"
[claude]
tools = ["Read", "Glob", "Grep"]
[codex]
model = "gpt-5.4"`,
promptMd: "Review the diff and report concrete defects."
};
export default {
subagents: [reviewer]
} satisfies CapabilityExport;

OmniDev still reads legacy SUBAGENT.md and AGENT.md files during migration, but they are deprecated.

  • Preferred format: agent.toml + prompt.md
  • When both formats exist for the same agent, OmniDev prefers agent.toml + prompt.md
  • Deprecation tracking lives in the repository root DEPRECATIONS.md