Skip to content

feat(subagent-dev): add optional external delegate mode for implementation tasks#956

Open
mvanhorn wants to merge 1 commit intoobra:mainfrom
mvanhorn:osc/feat-external-delegate-mode
Open

feat(subagent-dev): add optional external delegate mode for implementation tasks#956
mvanhorn wants to merge 1 commit intoobra:mainfrom
mvanhorn:osc/feat-external-delegate-mode

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

What problem are you trying to solve?

Users on metered plans (Claude Pro, Codex weekly credits) burn through their token allocation running superpowers sessions with many mechanical tasks. Each implementation subagent consumes tokens from the same provider as the controller. On a session with 8+ tasks, the implementer subagents account for the majority of token spend, even though most mechanical tasks (1-2 files, clear spec) don't need the controller's model.

The skill already says "use the least powerful model that can handle each role" - but that principle stops at the provider boundary. There's no way to route cheap tasks to a different provider's CLI that might be faster, cheaper, or better suited for mechanical implementation.

Related issues:

What does this PR change?

Adds an optional "External Delegate" section to subagent-driven-development. When users configure external-delegate: <cli-name> in their AGENTS.md, mechanical implementation tasks (cheap-model tier) get piped to the external CLI instead of spawning a same-provider subagent. Also adds external-delegate-prompt.md - a streamlined implementer prompt for delegates.

Is this change appropriate for the core library?

Yes. This is provider-agnostic infrastructure, not a third-party integration. It works with any CLI that accepts a prompt on stdin and writes to the filesystem. The AGENTS.md example uses codex but the mechanism is generic. It extends an existing design pattern (model selection tiers) rather than adding a new one.

The feature is opt-in. Without external-delegate in AGENTS.md, behavior is identical to today. No new dependencies, no scripts, no external service calls from superpowers itself.

What alternatives did you consider?

  1. Cross-model review only (Feature request: Cross-model collaboration via external CLI tools (Codex, Gemini) for review and second opinions #730's original proposal) - smaller scope but only addresses the bias problem, not token conservation. If the delegate interface exists for implementation, adding review delegation later is trivial.

  2. Token budget tracking - auto-switch to delegate when nearing billing limits. Too complex, too many assumptions about billing APIs. Explicit opt-in via AGENTS.md is simpler. Also aligns with @obra's response on Superpowers consume a lot of tokens in Opencode with Codex #750: "You can do that today - just put those things in your AGENTS.md."

  3. Separate skill - a standalone external-delegate skill instead of extending subagent-driven-development. This would fragment the execution flow and require users to choose between two competing execution skills. Extending the existing skill preserves the single execution path.

Does this PR contain multiple unrelated changes?

No. One feature: external delegate mode. Two files: the section in SKILL.md and the prompt template.

Existing PRs

PR #113 was a larger scope ("comprehensive Codex CLI integration" with utility scripts, hooks, config files). This PR is instruction-only - 44 lines of markdown added to SKILL.md plus a prompt template. No code, no scripts, no config files. The approach is fundamentally different: opt-in via AGENTS.md rather than automatic delegation.

Environment tested

Harness Harness version Model Model version/ID
Claude Code 1.0.33 Claude claude-opus-4-6

Evaluation

Initial prompt: "Research obra/superpowers for external delegate/Codex delegation patterns. If none exist, propose adding one."

This change adds skill instructions (markdown), not executable code. The evaluation is structural:

  • The new section slots cleanly after Model Selection, extending the existing cheap/standard/capable tier system
  • The prompt template follows the same structure as implementer-prompt.md with sections removed that the controller handles (self-review, escalation)
  • The circuit breaker and fallback patterns match how superpowers handles other failure modes
  • Red Flags additions are consistent with existing entries

I have not run multi-session evals comparing sessions with and without external delegation. The instructions are new and untested at scale. I'd welcome feedback on the circuit breaker threshold (currently 3 failures) and the task-tier classification rules.

Video Demo

Demo

Rigor

  • If this is a skills change: I reviewed superpowers:writing-skills patterns. Adversarial pressure testing was not performed (this is a new feature proposal, not a modification to existing behavior-shaping content).
  • This change was reviewed for edge cases: delegate unavailable (fallback), delegate fails (circuit breaker), out-of-scope changes (diff review + fallback), git operations (controller-only)
  • I did not modify any existing behavior-shaping content. All changes are additive.

Human review

  • A human has reviewed the COMPLETE proposed diff before submission

This contribution was developed with AI assistance (Claude Code).

Relates to #730, #750

…ation tasks

Extends the "least powerful model per role" principle across providers.
When configured in AGENTS.md, mechanical implementation tasks (cheap-model
tier) can be piped to an external CLI instead of spawning a same-provider
subagent. Reviews always use same-provider subagents. Includes circuit
breaker (3 failures disables delegate for session) and graceful fallback.

Relates to obra#730, obra#750
@mvanhorn
Copy link
Copy Markdown
Contributor Author

Can't tag you on X, but would love any thoughts here if you think this could work. Thanks for considering, love what youve built here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant