Skip to content

Custom Subagents

A subagent is a child agent a session spawns to handle bounded, delegated work — research, code analysis, summarization — without polluting the main conversation’s context. Netclaw ships three built-ins, and you define your own by dropping a markdown file in ~/.netclaw/agents/.

  • An initialized netclaw install (netclaw init)
  • Subagents run for any audience except Public — a public-channel session can’t spawn them

Each subagent is one markdown file in ~/.netclaw/agents/ — YAML frontmatter on top, the system prompt as the body:

---
name: release-notes
description: Draft release notes from a git log and merged PRs
modelRole: Main
timeoutSeconds: 180
visibility: user-facing
---
You write release notes. Given a version range, read the git log and the merged
PRs, group changes into Features / Fixes / Docs, and write a concise changelog
entry in the project's existing style. Lead with user-visible impact.

The body after the closing --- is loaded verbatim as the subagent’s system prompt — no templating.

FieldRequiredDefaultDescription
nameYesUnique identifier. This is what you pass to spawn_agent. Case-insensitive.
descriptionYesOne line. Shown to the parent agent so it knows when to reach for this subagent.
modelRoleNoCompactionWhich model the subagent runs on: Main (your primary model) or Compaction (the cheaper/faster one).
timeoutSecondsNo60Inactivity budget between streamed updates. Range 5—600.
prefillTimeoutSecondsNoinheritsWait-for-first-token budget. Range 5—3600. Falls back to the global subagent default when unset.
emitStructuredFindingsNofalseWhen true, a successful run becomes a memory candidate the parent session can keep.
visibilityNouser-facinguser-facing agents are spawnable and listed; internal ones are hidden.
toolsNo[]Advisory metadata only. It does not grant or restrict tools — a subagent’s tool access comes from the parent session’s audience.

A file that’s missing name or description, has an empty body, or sets an out-of-range timeout is rejected, and that agent simply doesn’t load — the rest keep working.

netclaw init seeds three, as ordinary editable files in ~/.netclaw/agents/:

NameWhat it does
research-assistantDeep web research with search and citation
code-analystAnalyze code, run commands, and review files
summarizerSummarize documents and content concisely

Edit them, delete them, or use them as templates for your own — they aren’t special.

Add, edit, or remove a file in ~/.netclaw/agents/ and netclaw picks it up on the next turn — no daemon restart. An edit that fails validation is dropped rather than served stale, so a typo in one file never takes down the others.

The parent agent calls the spawn_agent tool:

ParameterRequiredDescription
agentYesThe name of a user-facing subagent
taskYesA specific, bounded task for this run
contextNoExtra background prepended to the task

The subagent runs its own tool loop and returns a single text result to the parent. It inherits the parent’s session and project directories, working directory, and trust audience — so file tools resolve against the same workspace, and a subagent can never widen its own permissions.

Each subagent run gets up to 30 tool iterations before it’s forced to wrap up with a text answer. That’s separate from the main session’s per-turn budget, Session:MaxToolIterationsPerTurn (default 60, configurable in netclaw.json).

spawn_agent says the agent isn’t available

Section titled “spawn_agent says the agent isn’t available”

The name doesn’t match any loaded file, or the agent is visibility: internal. Check the exact name in the frontmatter and that the file parsed — an invalid file is skipped. Run netclaw doctor to surface load warnings.

Raise timeoutSeconds (inter-update budget) or prefillTimeoutSeconds (time to first token) in the agent file. A subagent making steady progress won’t be killed; the timeouts catch genuinely stuck runs.

They’re unavailable to Public-audience sessions by design. Confirm the session’s audience is Team or Personal.