Skip to content

Comments

feat(plugin): add agent-teams-pipeline plugin#25631

Open
0xarkstar wants to merge 1 commit intoanthropics:mainfrom
0xarkstar:feat/agent-teams-pipeline-plugin
Open

feat(plugin): add agent-teams-pipeline plugin#25631
0xarkstar wants to merge 1 commit intoanthropics:mainfrom
0xarkstar:feat/agent-teams-pipeline-plugin

Conversation

@0xarkstar
Copy link

Agent Teams Pipeline Plugin

Lifecycle management plugin for Claude Code's Agent Teams feature — 7 hooks, a cleanup script, and a multi-phase pipeline orchestration skill that address common Agent Teams pain points.

Problem

Agent Teams currently lacks lifecycle management, leading to:

Solution

7 hooks across 4 event types:

Hook Event What It Does
check-context-preemptive.sh PreToolUse Blocks ExitPlanMode/TeamCreate at 55%+ context
detect-pipeline-complete.sh Stop Detects "Pipeline Complete", sets flag, warns user
block-after-pipeline.sh PreToolUse Blocks heavy tools after Pipeline Complete
check-idle-reason.sh TeammateIdle Orphan detection + deliverable validation + auto-pane cleanup
check-team-limit.js PreToolUse Max 3 concurrent active teammates
verify-phase-output.sh TaskCompleted Validates pipeline deliverables (file existence, min size, PASS/FAIL)
check-context-stop.sh Stop Suggests fresh session at 75%+ context with retry guard

Plus:

  • cleanup-team-panes.sh — Manual tmux pane cleanup ([team], --all, --orphans)
  • Pipeline Orchestration Skill — Multi-phase protocol (P-1 Research → P4 Docs) with blocking shutdown, file ownership, failure recovery
  • /agent-teams-pipeline:cleanup-team-panes slash command

Testing

All hooks are production-tested across 50+ pipeline runs with 3-agent teams on macOS. Key thresholds (55%/75% context, max 3 teammates, 200-char min deliverables) are empirically tuned from real failure incidents.

Platform Support

  • macOS: Full support (mkdir atomic locking, stat -f, md5)
  • Linux: Full support (stat -c, md5sum)

Requirements

  • jq (JSON parsing in hooks)
  • tmux (pane cleanup — optional if not using tmux-based spawning)
  • Node.js (for check-team-limit.js)

Files

plugins/agent-teams-pipeline/
├── .claude-plugin/plugin.json
├── hooks/
│   ├── hooks.json
│   ├── check-context-preemptive.sh
│   ├── detect-pipeline-complete.sh
│   ├── block-after-pipeline.sh
│   ├── check-idle-reason.sh
│   ├── check-team-limit.js
│   ├── verify-phase-output.sh
│   └── check-context-stop.sh
├── scripts/cleanup-team-panes.sh
├── commands/cleanup-team-panes.md
├── skills/pipeline-orchestration/SKILL.md
├── README.md
└── LICENSE (MIT)

Also updates plugins/README.md table with the new plugin entry.

Lifecycle management for Claude Code's Agent Teams feature:

- 7 hooks across 4 event types (PreToolUse, Stop, TeammateIdle, TaskCompleted)
- Context-aware shutdown: blocks heavy ops at 55%+ context, suggests fresh session at 75%+
- Orphan detection: auto-detects agents whose team config was deleted
- Team size enforcement: max 3 concurrent active teammates
- Pipeline lifecycle: detects Pipeline Complete, blocks post-pipeline work
- Deliverable validation: verifies phase output files on task completion
- tmux cleanup script with normal, --all, and --orphans modes
- Multi-phase pipeline orchestration skill (P-1 Research through P4 Docs)

Addresses: anthropics#24385 (leaked panes), anthropics#25131 (runaway spawning),
anthropics#24585 (context exhaustion), anthropics#18405 anthropics#20369 anthropics#25180 (orphans),
anthropics#24414 (post-pipeline freeze)
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