Register the Agent tool and any btw custom agent tools
Source:R/tools_agent.R
register_agent_tool.RdRegisters btw_tool_agent_subagent (or fallback), plus any custom agents
discovered from .btw/agent-*.md, .claude/agents/, etc.
Arguments
- chat
An
ellmer::Chatobject.- model
Character. Model for sub-agents (fallback).
- mode
Character. Permission mode.
- rules
List. Permission rules.
- max_turns
Integer. Max turns per sub-agent.
- worktree_isolation
Logical. Run sub-agents in isolated git worktrees.
- ask_fn
Function or NULL. Parent permission callback forwarded to the sub-agent (which runs in "bubble" mode).
- async
Logical. Passed to
agent_tool(); enables concurrent sub-agents on async parent turns. DefaultFALSE.- data_shield
Optional DataShield inherited by codeagent sub-agents; disables uninstrumented btw/custom-agent delegation.
- cwd
Character. Working directory used for upstream agent discovery.
- parent_chat
Optional parent
ellmer::Chat; reserved for owned sub-agent lifecycle integration.- hooks
Optional HookRegistry used for SubagentStart/Stop lifecycle events on the owned codeagent Agent path.
- security_context
Internal immutable parent security snapshot.