How kuberwastaken/subagentmaxxing works
Purpose and Entry Points
subagentmaxxing is a dependency-free Python CLI that normalizes coding-agent execution across Codex, Cursor, and Claude CLIs. It lets an external orchestrator run one agent, fan a prompt out to multiple models, or manage detached jobs through a common interface.
Primary executables:
• bin/subagent — main local CLI and backend adapter.
• bin/subagent-remote — SSH-forwarding client for a remote subagent host.
• install.sh — installs both commands and the Claude Code skill.
CLI Control Plane
The subagent command is the core control plane. Its command families cover synchronous execution (run), parallel multi-target consensus (fanout), background lifecycle (jobs, wait, logs), backend discovery (models, doctor), and session continuation (--resume).
It translates normalized options—model, CWD, sandbox level, system prompt, schema, worktree, JSON envelope—into backend-specific invocations.
• bin/subagent
• docs/backends.md
• docs/feature-matrix.md
Backend Execution Boundary
The CLI delegates actual model work to already-installed, authenticated provider CLIs rather than embedding SDKs or credentials. Supported execution backends are:
• Codex via codex exec
• Cursor via cursor-agent/Cursor prompt execution
• Claude via claude -p
This boundary isolates differing flags, output conventions, model aliases, sandbox semantics, and session behavior behind the common CLI.
• bin/subagent
• docs/backends.md
Single-Run Flow
A run request accepts a backend, prompt, model selection, working directory, and permissions level. The CLI constructs and launches the native backend command, then returns the agent’s final answer; --json exposes a richer envelope including session, usage, duration, worktree, and exact command.
Optional worktree isolation protects the caller’s checkout when allowing edits; structured output is supported where the underlying backend supports schemas.
• bin/subagent
• docs/feature-matrix.md
Parallel and Detached Execution
fanout sends a shared prompt to independently selected backend/model targets concurrently and returns a JSON array, enabling cross-model review or consensus. Background runs detach execution and persist enough state for later polling, logs, and result collection.
These are orchestration mechanisms, not a distributed worker service: process execution remains local to the host running subagent.
• bin/subagent
• examples/cross-model-consensus.sh
• examples/review-diff.sh
Remote-Host Operation and Authentication
subagent-remote forwards arguments and stdin safely over SSH to a remote machine that has the agent CLIs and credentials. SUBAGENT_HOST selects that host, while -C refers to remote filesystem paths.
Authentication belongs to the native CLIs: Codex uses ~/.codex, Claude uses ~/.claude, and Cursor’s headless-host token can be copied from a Mac keychain through the dedicated helper. doctor verifies installations, auth, and Cursor token expiry.
• bin/subagent-remote
• bin/lift-cursor-token
• docs/auth.md
Orchestrator Integration
The included Claude Code skill teaches a parent coding agent when to delegate scoped execution, request a read-only review, or use multi-model fanout. The intended architecture is a capable orchestrator planning and validating work while external model CLIs perform bounded coding tasks.
• skills/subagentmaxxing/SKILL.md
• bin/subagent
Validation Surface
Live parity and smoke scripts validate the CLI against real authenticated Codex and Cursor environments, including prompting, system instructions, resume behavior, effort, worktrees, background jobs, and structured output.
• tests/parity.sh
• tests/smoke.sh
Main entry points: subagent Command router · install.sh Installer · SKILL.md Claude Code skill · subagent-remote subagent-remote
Components 16
Local control plane
Common CLI orchestration on the local host.
- subagent CLI · Normalizes execution across agent backends.
bin/subagent - Command router · Routes run, fanout, jobs, wait, logs, models, and doctor.
bin/subagent - Backend adapter · Translates normalized options into native CLI commands.
bin/subagent - Single run · Returns final answers or a rich JSON envelope.
bin/subagent - Fanout · Runs independent backend/model targets concurrently.
bin/subagent - Detached jobs · Persists local background-run state for polling, logs, and results.
bin/subagent - Worktree isolation · Optionally isolates editing runs from the caller checkout.
bin/subagent
Native agent backends
Installed and authenticated provider CLIs execute model work.
- Codex CLI · Executed through codex exec.
docs/backends.md - Cursor CLI · Executed through cursor-agent or Cursor prompt execution.
docs/backends.md - Claude CLI · Executed through claude -p.
docs/backends.md
Remote operation
SSH forwarding to a host with local agent credentials.
- subagent-remote · Forwards arguments and stdin to a selected remote host.
bin/subagent-remote - Remote subagent host · Hosts subagent, native CLIs, and their credentials.
- Cursor token helper · Copies a headless-host token from the Mac keychain.
bin/lift-cursor-token
Orchestrator integration
Guidance for parent coding agents.
- Claude Code skill · Teaches delegation, review, and multi-model fanout.
skills/subagentmaxxing/SKILL.md - Parent orchestrator · Plans and validates work while delegating bounded tasks.
Other components
- Installer · Installs commands and the Claude Code skill.
install.sh
Connections 18
- Installer → subagent CLI: installs
- Installer → subagent-remote: installs
- Installer → Claude Code skill: installs
- subagent CLI → Command router: dispatches
- Command router → Backend adapter: run requests
- Command router → Single run: synchronous execution
- Command router → Fanout: parallel execution
- Command router → Detached jobs: background lifecycle
- Backend adapter → Codex CLI: codex exec
- Backend adapter → Cursor CLI: Cursor invocation
- Backend adapter → Claude CLI: claude -p
- Single run → Worktree isolation: optional edit isolation
- Fanout → Backend adapter: one invocation per target
- subagent-remote → Remote subagent host: SSH forwards args and stdin
- Remote subagent host → subagent CLI: runs locally
- Cursor token helper → Remote subagent host: provisions Cursor auth
- Parent orchestrator → Claude Code skill: uses delegation guidance
- Claude Code skill → subagent CLI: delegates bounded tasks