Codumentor logo Codumentor

External Agent

Lets the main agent delegate work to external coding-agent CLIs — Claude Code, Codex, OpenCode, Gemini — or to a peer Codumentor instance. Each configured backend becomes its own tool (claude_code, codex, …). The live transcript appears in a UI card.

The user approves once per invocation, not each step the external agent takes inside its run. Credentials are never shown to the LLM.

External-agent tools are offered only when the caller's access profile grants every repository.

Configuration

plugins:
  - module: codumentor.plugins.external_agent
    class: ExternalAgentPlugin
    args:
      enabled: true
      # default_sandbox_tier: 1   # omit to auto-pick (see below)
      target_agents: "main"
      backends:
        claude-code:
          binary: claude
          mode: technical_user
          # api_key omitted → CLI's own auth store in $HOME
        codex:
          binary: codex
          mode: technical_user

Parameters

Each backend entry may include:

Auth modes

A call is rejected (not spawned) if no credential resolves.

CLI login (no API key)

Install the CLI, log in on the host (claude /login, codex login, …), omit api_key, and keep mode: technical_user (or byo_subscription for per-user stores).

Under sandbox tier 1 the agent does not see host $HOME. Known auth paths are copied into the session home at spawn:

If a CLI stores login somewhere else, the sandboxed run can fail with auth_required even though the host CLI works. The copy can refresh OAuth in the sandbox copy; if the host CLI later reports logged out, log in again on the host (or use byo_subscription).

Tools

One tool per configured backend:

ToolYAML keyBackend
claude_codeclaude-codeAnthropic Claude Code CLI
codexcodexOpenAI Codex CLI
opencodeopencodeOpenCode CLI
geminigeminiGoogle Gemini CLI (no native session resume; follow-ups recap in the prompt)
codumentorcodumentorPeer Codumentor instance over HTTP (base_url)

Each takes query (the task) and optional subagent_id to resume that backend's session (except Gemini, as above).

Notes