Skip to content

feat(subagents): add subagents system#3098

Open
brianjlandau wants to merge 26 commits into
charmbracelet:mainfrom
brianjlandau:subagents
Open

feat(subagents): add subagents system#3098
brianjlandau wants to merge 26 commits into
charmbracelet:mainfrom
brianjlandau:subagents

Conversation

@brianjlandau

@brianjlandau brianjlandau commented Jun 9, 2026

Copy link
Copy Markdown

Summary

Adds a full subagents system to Crush — discoverable, configurable child agents that the coordinator can dispatch via the agent tool.

  • Subagent definitions — Markdown files with YAML frontmatter (name, description, model, provider, effort, color, permissionMode, tools, disallowedTools, skills, mcp_servers) discovered from configurable paths
  • Dispatcher tool — dynamic subagent_type enum built from active agents; builds each subagent with its own model/prompt/memory/permissions at dispatch time
  • Skills — pinned skills: frontmatter suppresses full skill discovery; absent skills: keeps full access
  • Color — eight named palette values + auto (deterministic hash); used in running-status panel and modal
  • Effortlow/medium/high translated to provider-specific thinking budgets
  • Permission modesdefault and bypassPermissions (auto-approves the sub-session)
  • Runtime tracker — tracks in-flight subagent sessions; feeds the inline status panel and modal
  • TUI — inline running-subagents panel in the sidebar; modal (Ctrl+X) with Running + Library tabs; Library enable/disable toggle; parent breadcrumb + Ctrl+Up navigation; ctrl+x in help bar
  • Model cacheresolveModelByID results memoized per (modelID, provider) and cleared on config reload
  • Robustness — build/memory/prompt failures surfaced as tool-error responses (not turn aborts); all Validate overlaps reported

Test plan

  • Build: CGO_ENABLED=0 GOEXPERIMENT=greenteagc go build ./...
  • Tests: CGO_ENABLED=0 GOEXPERIMENT=greenteagc go test ./internal/subagents/... ./internal/agent/...
  • Drop a .md subagent file in the discovery path — verify it appears in Library tab (Ctrl+X); also test @-mention completion in the editor
  • Dispatch the subagent by name — verify Running tab shows it with correct color/model
  • Disable it in Library (space) — verify it disappears from the agent tool enum
  • Subagent with invalid model: — verify parent agent gets a readable tool-error, not a crash
  • Press Ctrl+X → check help bar shows ctrl+x subagents; press Ctrl+G → binding in full help

🤖 Generated with Claude Code

@charmcli

charmcli commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@brianjlandau

Copy link
Copy Markdown
Author

I have read the Contributor License Agreement (CLA) and hereby sign the CLA.

andreynering and others added 26 commits June 9, 2026 01:34
…ator

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
… enum

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…late

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…beling

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ML key to disallowedTools

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…anslation

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…events

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…and async runtime IO

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… in coordinator

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…urn aborts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@Zim-Inn

Zim-Inn commented Jun 10, 2026

Copy link
Copy Markdown

why subagents? is it useful for coding?

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.

4 participants