Skip to main content
A sub-agent is an optional harness-native role inside one agent project. For Claude Code, it is usually a .claude/agents/*.md file; for OpenCode, it is the equivalent .opencode/agents/*.md file. Karta discovers those files and lets sessions route to them, but it does not deploy them as separate top-level agents with their own stable URLs.

Where sub-agents come from

Each sub-agent is a Markdown file with YAML frontmatter and a prompt body:
.claude/agents/billing.md
The discovered definition exposes name, description, prompt, optional model, tools, skills, permissions, temperature, and type. With a single sub-agent, it is selected automatically; with several, you route by name.

Routing

Send a turn to a named sub-agent, or let the default handle it. The API field is still named agent because it names the harness actor for that turn:

Handoff within a session

A session has a current sub-agent. Reassign it to hand off mid-conversation; the change fires an agent.handoff hook.
This is how a general intake agent can hand a thread to a specialist without losing context. The session and its history carry across the handoff.

Runtime authority

When a deployed agent runs, the resulting karta - a durable computer for a user-agent relationship, virtual employee, backend job, account role, or fleet member - is itself an actor with shell and tool access. It can be steered by user input or by data it fetches (prompt injection). Karta treats it as its own actor: its authority is scoped to the current karta and session, not the platform, so a prompt-injected or misbehaving karta is contained to its own boundary.

Sub-agent files

The full frontmatter format and conventions.

Skills

Give agents reusable capabilities.