Plugin authors guide (v0.15)
modusbrain discovers subagent definitions from outside this repo via
MODUSBRAIN_PLUGIN_PATH. If you maintain a downstream agent (your OpenClaw
deployment, a workflow host, a private tool) and want to ship custom
subagents alongside it, drop a plugin directory on that env path.
This guide is for plugin authors. The CLI user doesn’t need to read it.
Minimum viable plugin
modusbrain.plugin.json:
subagents/my-summarizer.md:
Turning it on
$PATH.
Rules (strict by design)
Path policy. Absolute paths only. Relative paths,~-prefixed paths,
and URL-style paths (https://, file://) are rejected with a warning.
You control where your plugin lives on disk; modusbrain doesn’t guess.
Collision policy. If two plugins ship a subagent with the same name,
the one listed FIRST in MODUSBRAIN_PLUGIN_PATH wins. The other is dropped
with a warning naming both sources.
Trust policy. Plugins ship subagent definitions ONLY in v0.15:
- You cannot declare new tools.
- You cannot extend the brain tool allow-list.
- You cannot override any
agentSafeor similar flag. - Your
allowed_tools:frontmatter field MUST subset the derived brain tool registry. Names not in the registry are rejected at plugin load time (worker startup), NOT at subagent dispatch time — so a typo in your plugin gives you a loud startup error, not a silent “tool never fires” at 3am.
modusbrain.plugin.json
Subagent definition files
Plain markdown with YAML frontmatter. The body is the system prompt. The frontmatter controls runtime behavior. Recognized frontmatter fields:
Unknown frontmatter fields are preserved but ignored by the handler. v0.16
may consume more of them.
Caveats that will bite you
- Plugin definitions can’t change during a run. The loader reads the disk once at worker startup. Editing a subagent def doesn’t re-take effect until you restart the worker. This is deliberate — live reloads would break crash-resumable replay.
-
~/.modusbrain/audit/subagent-jobs-*.jsonlis local only. If your worker runs on a different host than themodusbrain agent logscaller, the CLI won’t see heartbeats from that worker. v0.16 will unify this; for now assume worker + CLI share a filesystem. -
Tool calls always run with
ctx.remote = true. Even on local CLI invocation. Tools that gate onremote=true(file_upload’s strict confinement, put_page’s namespace check) will apply. Good default; a subagent definition that wants local-filesystem reach beyond the brain can’t have it. -
put_pagewrites are namespace-scoped. A subagent with id 42 can only write underwiki/agents/42/.... This is enforced both in the tool schema (the slug pattern shown to the model) AND server-side in theput_pageoperation (fail-closed ifviaSubagent=true). Don’t try to route around it; you’ll getpermission_denied.
Example: a downstream-OpenClaw plugin
~/your-openclaw/modusbrain-plugin/modusbrain.plugin.json:
modusbrain agent run --subagent-def meeting-ingestion --fanout-by transcript ... and its definitions load automatically.