agents/ Role Directory
agents/ stores worker/subagent definitions. A3S Code scans ~/.claude/agents,
~/.a3s/agents, <workspace>/.claude/agents, and <workspace>/.a3s/agents
automatically, in that order. ACL agent_dirs load before these, and session
agentDirs and workerAgents load after them; a later definition with the
same name replaces an earlier one. Prefer .a3s/agents/ for new projects; .claude/agents/
is read for compatibility. Directories are scanned recursively for .md,
.yaml, and .yml files, and symlinks that resolve outside the directory are
skipped.
These files are worker definitions. They are invoked by the model-visible
task tool, the session.task(...) and session.tasks(...) host helpers, or
autoDelegation. The parent session still owns final synthesis, verification,
and permission boundaries.
Agent File
name is the call name. description drives automatic routing. The body describes the worker role. Tool fields narrow visible capabilities; do not rely on the worker merely promising not to do risky things.
tools(alsoallowedToolsorallowed_tools) becomes an allow-only permission policy for the child run.disallowedTools(alsodisallowed-toolsordisallowed_tools) adds deny rules that win over the allowlist.- Either field accepts a comma-separated string or a YAML list. When one is
set, the child's confirmation inheritance defaults to
auto_approve. - A
kindfield (read_only,planner,implementer,verifier,reviewer, orcustom) parses the file as a worker agent spec, the same shape accepted byworkerAgents.
Manual Delegation
Fixed flows are better as manual delegation or programmable orchestration. Automatic delegation fits goals where the parent agent should choose specialists.
Automatic Delegation
Automatic delegation scores the request locally against each agent's name and description; there is no model call in the routing step. Write descriptions that say when to use the agent, not just what the role is called. See Tasks for the scoring and fan-out limits.
Practices
- Keep one role per file.
- Make descriptions useful for routing and bodies useful for execution.
- Ask workers to return evidence, risks, and next steps.
- Keep publish, delete, push, and other high-risk permissions out of default workers.
- Use
workerAgentsorregisterWorkerAgent()for dynamic one-off workers.