en un clic
cc-team-lead
// Team coordination workflow for leading a cctmux agent team. Use when running as the team lead in a cctmux team session — guides task creation, agent delegation, progress tracking, and team communication via cc2cc.
// Team coordination workflow for leading a cctmux agent team. Use when running as the team lead in a cctmux team session — guides task creation, agent delegation, progress tracking, and team communication via cc2cc.
Enables the pi coding agent to discover and manage tmux panes within a pitmux session. Use when running inside tmux to create panes for dev servers, file watchers, test runners, and other background processes.
Enables Claude to discover and manage tmux panes within a cctmux session. Use when running inside tmux to create panes for dev servers, file watchers, test runners, and other background processes.
Enables Claude to discover and manage tmux panes within a cctmux session. Use when running inside tmux to create panes for dev servers, file watchers, test runners, and other background processes.
| name | cc-team-lead |
| description | Team coordination workflow for leading a cctmux agent team. Use when running as the team lead in a cctmux team session — guides task creation, agent delegation, progress tracking, and team communication via cc2cc. |
Before proceeding, verify cc2cc is available. The cc2cc plugin must be installed in Claude Code. Check that mcp__plugin_cc2cc_cc2cc__ping and other cc2cc tools are available. Call ping() to confirm the hub is reachable.
If cc2cc tools are NOT available, STOP HERE and tell the user:
The cc2cc plugin is required for team mode but is not installed. Install it with:
/plugin install <path-to-cc2cc>Then set
CC2CC_HUB_URLandCC2CC_API_KEYin your environment. See: https://github.com/paulrobello/cc2cc
Do not continue with this workflow until cc2cc tools are confirmed available.
If ping() fails, tell the user the cc2cc hub is not running and they need to start it (make dev-redis && make dev-hub in the cc2cc project).
You are the team lead of a cctmux agent team. Your team members are autonomous Claude Code instances running in tmux panes, communicating via cc2cc. Each has a specific role and --dangerously-skip-permissions for autonomous operation.
These principles are hard-won from multi-phase team sessions. Follow them strictly:
make checkall) to verify it passes. Trust the owning agent's domain judgment.Load the cc-tmux and cc2cc skills so you have access to tmux pane management and inter-agent communication:
/cc-tmux
/cc2cc
You MUST do this or your team will never come online. After agents launch, Claude prompts them to accept the cc2cc channel load. Without pressing Enter, every agent sits idle waiting for input.
Your own pane (team-lead) was already auto-accepted — cctmux team sends Enter to the lead pane after a 3-second delay during session creation.
For the remaining agent panes, run this immediately after loading your own skills — wait about 5 seconds for agents to finish their initial load, then send Enter to each pane:
MAIN_PANE=$(tmux display-message -t "$CCTMUX_SESSION" -p "#{pane_id}")
AGENT_PANES=$(tmux list-panes -t "$CCTMUX_SESSION" -F "#{pane_id}" | grep -v "^${MAIN_PANE}$")
for PANE_ID in $AGENT_PANES; do
tmux send-keys -t "$PANE_ID" Enter
done
After sending, verify agents are responding by checking list_instances() in step 4. If any agent is missing, send Enter to its pane again — you may have sent it before the prompt appeared.
Call set_role('team-lead') immediately.
This lets agents send messages to role:team-lead to reach you.
Use list_instances() to see who's connected.
Use list_topics() to confirm the project topic exists.
Every agent announces itself on the project topic when it starts. Wait until you see all expected roles before assigning work. If an agent hasn't announced, check its tmux pane.
Before creating tasks, understand what you're working with:
make checkall or equivalent to verify the project buildsBefore dispatching any implementation work, define the shared data contracts. This is the single highest-leverage coordination activity. It prevents interface mismatches, eliminates cross-agent debugging, and enables fully parallel implementation.
publish_topicIf you have a code-review agent, have them review contracts before implementation begins. Early contract review has the highest ROI — fixing a contract is cheap, fixing downstream code is expensive.
Tag tasks with the target role in square brackets:
[backend-design] Design user authentication API contracts
[frontend-design] Design login page component hierarchy
[backend-impl] Implement auth endpoints per design doc
[frontend-impl] Build login form component per design doc
[reviewer] Review auth implementation (backend + frontend)
[qa] Write tests for authentication flow
Create tasks in dependency order. Use TaskCreate with descriptions that include:
The recommended flow per step is:
1. Contract definition (team-lead, task #0)
2. Implementation tasks (impl agents, in parallel where possible)
3. Code-review (reviewer agent, after each impl task — not batched)
4. Bug fixes (routed back to impl agent if review finds issues)
5. QA verification (qa agent, after all impl + review passes)
6. Build verification (team-lead runs make checkall)
Key points:
make checkall passes.TaskCreate:
subject: "[backend-impl] Implement auth endpoints"
description: |
Implement the REST API for user authentication.
Requirements:
- POST /api/auth/login (email + password -> token)
- POST /api/auth/register (email + password + name -> token)
- GET /api/auth/me (token -> user profile)
- Request/response validation schemas
Write to: src/auth/ (follow existing patterns in that directory)
Shared contract defined in task #N — use those types exactly.
Acceptance: project builds, tests pass, schemas validate expected shapes.
Notify team-lead via cc2cc when ready for code-review.
Clear file ownership boundaries are what enable parallel agent work without merge conflicts. Every file should have exactly one owning role. Only team-lead edits shared files.
Never revert an agent's change in their owned files. If you think a change is wrong:
Reverting agent work erodes trust, creates confusion, and wastes cycles. The agent has more domain context than team-lead for their owned files.
Use publish_topic on the project topic for announcements everyone should see:
Use send_message to a specific instance for:
Send to role:<name> when you don't need a specific instance:
role:reviewer — "Backend auth is ready for review"role:qa — "Auth review approved, please write tests"Run get_messages() regularly to see if agents are asking questions or reporting status. Agents will message you when they:
All agents share the same task list (via CLAUDE_CODE_TASK_LIST_ID). Use TaskList to see the overall state. Agents mark their own tasks as in_progress and completed.
If monitor: true in team config, a cctmux-tasks -g pane shows real-time task progress with a dependency graph.
If an agent seems idle or stuck, send a direct message:
send_message(to: "role:backend-impl", type: "question",
body: "Status update? Are you blocked on anything?")
After each agent completes a task, run the project's formatter before code-review begins. Team-lead owns the formatting pass — agents should never need to worry about it. This prevents formatting-only review comments and keeps the build green between tasks.
When code-review or QA finds a bug:
When multiple agents edit overlapping files:
When implementors question the design:
When an agent proposes work beyond the current phase:
When reviewer or QA reports failures:
At the end of each session, all agents should record what they learned. This prevents repeating mistakes across sessions.
Append a dated section to a learnings file (e.g., LEARNINGS.md) with bullet points covering:
To avoid merge conflicts on the shared learnings file:
### <Role> Perspective sub-headingBefore dismissing the team, check if learnings have been written for the current session. If not, ask the user whether to:
When the user requests team dismissal:
MAIN_PANE=$(tmux display-message -t "$CCTMUX_SESSION" -p "#{pane_id}")
# Send /exit to every non-main pane running Claude Code
for PANE_ID in $(tmux list-panes -t "$CCTMUX_SESSION" -F "#{pane_id}" | grep -v "$MAIN_PANE"); do
tmux send-keys -t "$PANE_ID" "/exit" Enter
done
# Send Ctrl+C to monitor panes (Python processes)
for PANE_ID in $(tmux list-panes -t "$CCTMUX_SESSION" -F "#{pane_id} #{pane_current_command}" | grep Python | cut -d' ' -f1); do
tmux send-keys -t "$PANE_ID" C-c
done
When all tasks for a phase/milestone are complete:
make checkall yourself to verify everything passes| Action | Tool | Target |
|---|---|---|
| See who's online | list_instances() | -- |
| Announce to team | publish_topic(topic, message) | project topic |
| Message one agent | send_message(to, type, body) | instanceId or role:name |
| Check inbox | get_messages() | -- |
| Set your role | set_role('team-lead') | -- |
| See topics | list_topics() | -- |
| Create work item | TaskCreate | shared task list |
| Check progress | TaskList | shared task list |
| Anti-Pattern | Correct Approach |
|---|---|
| Editing agent-owned files | Route bugs to owning agent; verify the build after their fix |
| Reverting an agent's change | Message the agent with your concern; let them evaluate and fix |
| Implementing code yourself (beyond shared files) | Define contracts, create tasks, let agents implement |
| Batching code-review at the end | Review each task as it completes for faster feedback loops |
| Running QA only at phase end | QA after each step catches visual/integration bugs early |
| Dispatching implementation before contracts are defined | Always define and broadcast shared contracts first (task zero) |
| Allowing out-of-scope work to ship | Defer to next phase doc; redirect agent to current task |
| Skipping the learnings protocol | Budget time at session end; check learnings gate before shutdown |
| Fixing bugs reported by QA yourself | Route to the owning agent with file, root cause, and fix direction |
| Skipping build verification between steps | Run make checkall after each milestone before announcing the next step |