refactor: rename CLI command from oh to clawteam and update config files

This commit is contained in:
2026-04-03 17:05:09 +07:00
parent 129dea87c4
commit ef552df46e
8 changed files with 170 additions and 118 deletions
@@ -174,4 +174,29 @@ User explicitly stated: "với mọi dự án thì tôi đều muốn mọi th
- First-Seen: 2026-03-31
- Last-Seen: 2026-03-31
---
## New Learnings — 2026-04-03 (ClawTeam Deep Dive)
### [LRN-20260403-001] no_sessions_spawn_for_multi_agent
**Logged**: 2026-04-03T09:30:00Z
**Priority**: critical
**Status**: resolved
**Area**: orchestration
### Summary
NEVER use sessions_spawn for multi-agent coordination. ALWAYS use clawteam CLI.
### Suggested Action
- Never call sessions_spawn for multi-agent work
- If used by mistake → immediately kill and redo with clawteam
### Metadata
- Source: user_correction
- Related Files: AGENTS.md, RULES.md
- Tags: clawteam, orchestration, sessions_spawn
- Pattern-Key: clawteam.no_subagent
- Recurrence-Count: 3
- First-Seen: 2026-04-03
---
+8 -8
View File
@@ -178,16 +178,16 @@ No peer or leader review should begin until the worker has completed their self-
Enforce this sequence in your task board by marking statuses appropriately (e.g., `needs-self-review``needs-peer-review``needs-leader-review``completed`).
ClawTeam enables you to:
- Spawn teams of specialized agents via `oh team spawn-team <team> -n <leader>`
- Create tasks with dependencies using `oh task create <team> "..." -o <owner>`
- Spawn workers with `oh spawn tmux openclaw --team <team> --agent-name <name> --task "..."`
- Monitor progress via `oh board show/attach <team>`
- Coordinate via `oh inbox send/receive <team> <to-agent> "..."`
- Spawn teams of specialized agents via `clawteam team spawn-team <team> -n <leader>`
- Create tasks with dependencies using `clawteam task create <team> "..." -o <owner>`
- Spawn workers with `clawteam spawn tmux openclaw --team <team> --agent-name <name> --task "..."`
- Monitor progress via `clawteam board show/attach <team>`
- Coordinate via `clawteam inbox send/receive <team> <to-agent> "..."`
- Isolate work via git worktrees (no merge conflicts between parallel agents)
- Wait for sub-agents with `oh task wait <team>`
- Launch pre-built template teams with `oh launch <template> --team <name> --goal "..."`
- Wait for sub-agents with `clawteam task wait <team>`
- Launch pre-built template teams with `clawteam launch <template> --team <name> --goal "..."`
⚠️ **IMPORTANT:** Always use `oh spawn tmux openclaw` — NOT bare `oh spawn` which defaults to `claude`.
⚠️ **IMPORTANT:** Always use `clawteam spawn tmux openclaw` — NOT bare `clawteam spawn` which defaults to `claude`.
Setup: `pip install clawteam` and ensure `tmux` and `openclaw` CLI are installed.
**CLI command is `oh`** (installed with `pip install clawteam`). See skill content for full workflow.
+81 -53
View File
@@ -32,17 +32,17 @@ Things like:
## ClawTeam Multi-Agent Orchestration
> **Important:** ClawTeam CLI command is `oh`. On our OpenClaw setup, ALWAYS explicitly specify `tmux openclaw` as backend+agent — `oh spawn` defaults to `claude` which we don't have.
> **Important:** ClawTeam CLI command is `clawteam`. ALWAYS specify `tmux openclaw` or `subprocess openclaw` as backend+agent — default `claude` is not available.
> Official repo: https://github.com/HKUDS/ClawTeam
### ⚠️ CRITICAL: Spawn Syntax
```
oh spawn tmux openclaw --team <team> --agent-name <name> --task "<task>"
clawteam spawn tmux openclaw --team <team> --agent-name <name> --task "<task>"
```
**NOT** `oh spawn --team ...` (defaults to `claude` → will fail)
**NOT** `oh spawn tmux claude` (we don't have claude CLI)
**NOT** `clawteam spawn --team ...` (defaults to `claude` → will fail)
**NOT** `clawteam spawn tmux claude` (we don't have claude CLI)
### Team Setup
@@ -52,114 +52,114 @@ export CLAWTEAM_AGENT_ID="leader-001"
export CLAWTEAM_AGENT_NAME="leader"
export CLAWTEAM_AGENT_TYPE="leader"
oh team spawn-team <team-name> -d "<description>" -n leader
clawteam team spawn-team <team-name> -d "<description>" -n leader
# View team status
oh status
oh board show <team-name>
oh board attach <team-name> # tiled tmux view
clawteam status
clawteam board show <team-name>
clawteam board attach <team-name> # tiled tmux view
```
### Task Management
```bash
# Create tasks (with owner, dependencies, priority)
oh task create <team> "<task description>" -o <owner>
oh task create <team> "<task>" -o <owner> --blocked-by <task-id>
oh task create <team> "Hotfix" -o <owner> --priority high
clawteam task create <team> "<task description>" -o <owner>
clawteam task create <team> "<task>" -o <owner> --blocked-by <task-id>
clawteam task create <team> "Hotfix" -o <owner> --priority high
# Update status
oh task update <team> <task-id> --status pending
oh task update <team> <task-id> --status in_progress
oh task update <team> <task-id> --status completed
oh task update <team> <task-id> --status blocked
clawteam task update <team> <task-id> --status pending
clawteam task update <team> <task-id> --status in_progress
clawteam task update <team> <task-id> --status completed
clawteam task update <team> <task-id> --status blocked
# List/filter tasks
oh task list <team> --status pending
oh task list <team> --owner <agent-name>
oh task list <team> --priority high
clawteam task list <team> --status pending
clawteam task list <team> --owner <agent-name>
clawteam task list <team> --priority high
# Wait for all sub-agents to finish
oh task wait <team>
oh task wait <team> --timeout 300 --poll-interval 10
clawteam task wait <team>
clawteam task wait <team> --timeout 300 --poll-interval 10
```
### Spawn Workers (OpenClaw Specific)
```bash
# ✅ CORRECT — always use tmux openclaw
oh spawn tmux openclaw --team <team> --agent-name <name> --task "<task>"
clawteam spawn tmux openclaw --team <team> --agent-name <name> --task "<task>"
# ✅ With non-default provider/model via profile
oh spawn tmux --profile <profile-name> --team <team> --agent-name <name> --task "<task>"
clawteam spawn tmux --profile <profile-name> --team <team> --agent-name <name> --task "<task>"
# ❌ WRONG — defaults to claude
oh spawn --team <team> --agent-name <name> --task "<task>"
oh spawn tmux claude --team <team> --agent-name <name> --task "<task>"
clawteam spawn --team <team> --agent-name <name> --task "<task>"
clawteam spawn tmux claude --team <team> --agent-name <name> --task "<task>"
```
### Communication (Inbox)
```bash
# Send message to agent
oh inbox send <team> <to-agent> "<message>"
clawteam inbox send <team> <to-agent> "<message>"
# Broadcast to all
oh inbox broadcast <team> "<message>"
clawteam inbox broadcast <team> "<message>"
# Receive (destructive — consumes message)
oh inbox receive <team> --agent <name>
clawteam inbox receive <team> --agent <name>
# Peek (non-destructive)
oh inbox peek <team> --agent <name>
clawteam inbox peek <team> --agent <name>
# Watch for new messages
oh inbox watch <team> --agent <name>
clawteam inbox watch <team> --agent <name>
```
### Profiles & Presets
```bash
# List built-in provider templates
oh preset list
oh preset show <provider-name>
clawteam preset list
clawteam preset show <provider-name>
# Generate reusable profile from preset
oh preset generate-profile <preset> <base-agent> --name <profile-name>
clawteam preset generate-profile <preset> <base-agent> --name <profile-name>
# Or use interactive TUI
oh profile wizard
clawteam profile wizard
# Test a profile before using in team
oh profile test <profile-name>
clawteam profile test <profile-name>
# Fix broken profile on fresh machine
oh profile doctor claude
clawteam profile doctor claude
```
### Git Context & Conflict Checks
```bash
oh context log <team>
oh context diff <team>
oh context files <team>
oh context conflicts <team>
oh context inject <team> --agent <name>
clawteam context log <team>
clawteam context diff <team>
clawteam context files <team>
clawteam context conflicts <team>
clawteam context inject <team> --agent <name>
```
### Workspace Management
```bash
oh workspace list <team>
oh workspace merge <team> <agent-name>
clawteam workspace list <team>
clawteam workspace merge <team> <agent-name>
```
### Snapshots & Recovery
```bash
oh team snapshot <team> --tag <tag-name>
oh team snapshots <team>
oh team restore <team> --snapshot <tag-name>
clawteam team snapshot <team> --tag <tag-name>
clawteam team snapshots <team>
clawteam team restore <team> --snapshot <tag-name>
```
### Worker Loop Protocol
@@ -168,28 +168,28 @@ Workers should NOT exit after completing their initial task. Expected loop:
```bash
# 1. Check tasks
oh task list <team> --owner <me>
clawteam task list <team> --owner <me>
# 2. Check inbox for new instructions
oh inbox receive <team> --agent <me>
clawteam inbox receive <team> --agent <me>
# 3. If idle, notify leader
oh lifecycle idle <team>
clawteam lifecycle idle <team>
```
### Cleanup
```bash
oh team cleanup <team> # kill workers, cleanup worktrees
oh lifecycle request-shutdown <team>
clawteam team cleanup <team> # kill workers, cleanup worktrees
clawteam lifecycle request-shutdown <team>
```
### JSON Output
```bash
oh --json team discover
oh --json board show <team>
oh --json task list <team> --status pending
clawteam --json team discover
clawteam --json board show <team>
clawteam --json task list <team> --status pending
```
Requires:
@@ -200,3 +200,31 @@ Requires:
- OpenClaw CLI available on PATH (`openclaw`)
- Git repo for worktree isolation
- Data directory: `~/.clawteam/`
### ✅ Confirmed Working Commands
```bash
# Create team
clawteam team spawn-team <team> -d "<description>" -n <leader>
# Create task (gets task ID back)
clawteam task create <team> "<task>" -o <owner>
# Output: OK Task created: <TASK_ID>
# Spawn worker with task description
clawteam spawn tmux openclaw --team <team> --agent-name <name> --agent-type coder \
--task "Do X. After done: clawteam task update <team> <TASK_ID> --status completed"
# Or with subprocess (faster, no tmux monitor)
clawteam spawn subprocess openclaw --team <team> --agent-name <name> --task "..."
# View board
clawteam board show <team>
# Mark task done
clawteam task update <team> <task-id> --status completed
### ⚠️ Flags That DON'T Exist on clawteam spawn
- `--model` (model is set by OpenClaw config, not clawteam)
- `--timeout` (no timeout flag on spawn)
- `-m` (conflicts with clawteam's own options)
@@ -22,7 +22,7 @@ ClawTeam is a framework-agnostic CLI tool for coordinating multiple AI agents as
It provides team/task management, inter-agent messaging, git worktree isolation, provider-aware
runtime profiles, git context injection, snapshots, and terminal-based monitoring dashboards.
All operations are performed via the `oh` CLI (shorthand for `clawteam`). Data is stored in `~/.clawteam/` by default.
All operations are performed via the `clawteam` CLI. Data is stored in `~/.clawteam/` by default.
**Official repo:** https://github.com/HKUDS/ClawTeam
@@ -39,7 +39,7 @@ Requires Python 3.10+. For P2P transport support: `pip install clawteam[p2p]`.
- `tmux` installed (default spawn backend)
- A CLI coding agent such as `openclaw`, `claude`, `codex`
- A git repository for worktree isolation and context features
- Default dependencies installed if you want the TUI wizard (`oh profile wizard`)
- Default dependencies installed if you want the TUI wizard (`clawteam profile wizard`)
## Core Concepts
@@ -67,68 +67,68 @@ export CLAWTEAM_AGENT_ID="leader-001"
export CLAWTEAM_AGENT_NAME="leader"
export CLAWTEAM_AGENT_TYPE="leader"
oh team spawn-team my-team -d "Project team" -n leader
oh task create my-team "Design system" -o leader
oh task create my-team "Implement feature" -o worker1
oh task create my-team "Write tests" -o worker2
oh board show my-team
clawteam team spawn-team my-team -d "Project team" -n leader
clawteam task create my-team "Design system" -o leader
clawteam task create my-team "Implement feature" -o worker1
clawteam task create my-team "Write tests" -o worker2
clawteam board show my-team
```
### Configure Runtime Profiles
```bash
# Inspect built-in provider templates
oh preset list
oh preset show moonshot-cn
clawteam preset list
clawteam preset show moonshot-cn
# Generate a reusable profile from a preset
oh preset generate-profile moonshot-cn claude --name claude-kimi
clawteam preset generate-profile moonshot-cn claude --name claude-kimi
# Or use the interactive TUI
oh profile wizard
clawteam profile wizard
# Claude Code on a fresh machine/home may need onboarding repair once
oh profile doctor claude
clawteam profile doctor claude
# Smoke-test the profile before using it in a team
MOONSHOT_API_KEY=... oh profile test claude-kimi
MOONSHOT_API_KEY=... clawteam profile test claude-kimi
```
### Spawn and Coordinate Agents
> **⚠️ CRITICAL for OpenClaw environments:** `oh spawn` defaults to `claude` as backend+command. ALWAYS explicitly specify `tmux openclaw`:
> **⚠️ CRITICAL for OpenClaw environments:** `clawteam spawn` defaults to `claude` as backend+command. ALWAYS explicitly specify `tmux openclaw`:
> ```bash
> oh spawn tmux openclaw --team <team> --agent-name <name> --task "..."
> clawteam spawn tmux openclaw --team <team> --agent-name <name> --task "..."
> ```
```bash
# ✅ CORRECT for OpenClaw — ALWAYS use tmux openclaw
oh spawn tmux openclaw --team my-team --agent-name worker1 --task "Implement the auth module"
oh spawn tmux openclaw --team my-team --agent-name worker2 --task "Write unit tests"
clawteam spawn tmux openclaw --team my-team --agent-name worker1 --task "Implement the auth module"
clawteam spawn tmux openclaw --team my-team --agent-name worker2 --task "Write unit tests"
# With non-default provider/model via profile
oh spawn tmux --profile claude-kimi --team my-team --agent-name worker5 --task "Build API endpoints"
clawteam spawn tmux --profile claude-kimi --team my-team --agent-name worker5 --task "Build API endpoints"
# ❌ WRONG — will fail, defaults to claude
oh spawn --team my-team --agent-name worker1 --task "..."
oh spawn tmux claude --team my-team --agent-name worker1 --task "..."
clawteam spawn --team my-team --agent-name worker1 --task "..."
clawteam spawn tmux claude --team my-team --agent-name worker1 --task "..."
oh board attach my-team
oh inbox send my-team worker1 "Start implementing the auth module"
oh board live my-team --interval 3
clawteam board attach my-team
clawteam inbox send my-team worker1 "Start implementing the auth module"
clawteam board live my-team --interval 3
```
### Spawn Defaults
| Setting | Default | Override |
|---------|---------|----------|
| Backend | `tmux` | `oh spawn subprocess ...` |
| Command | `claude` (default) / `openclaw` (ours) | `oh spawn tmux openclaw` for our setup |
| Backend | `tmux` | `clawteam spawn subprocess ...` |
| Command | `claude` (default) / `openclaw` (ours) | `clawteam spawn tmux openclaw` for our setup |
| Workspace | `auto` (git worktree) | `--no-workspace` or config `workspace=never` |
| Permissions | skip | `--no-skip-permissions` or config `skip_permissions=false` |
| Runtime profile | none | `--profile <name>` |
> **Important:** For OpenClaw setups, use `oh spawn tmux openclaw` — NOT `oh spawn` (default=claude).
> **Important:** For OpenClaw setups, use `clawteam spawn tmux openclaw` — NOT `clawteam spawn` (default=claude).
Use `--profile` whenever you need a non-default provider, model, endpoint, or auth mapping.
@@ -136,28 +136,28 @@ Use `--profile` whenever you need a non-default provider, model, endpoint, or au
```bash
# Create with dependencies
oh task create my-team "Deploy" --blocked-by <impl-task-id>,<test-task-id>
clawteam task create my-team "Deploy" --blocked-by <impl-task-id>,<test-task-id>
# Create with priority
oh task create my-team "Hotfix prod issue" --priority high
clawteam task create my-team "Hotfix prod issue" --priority high
# Update status
oh task update my-team <task-id> --status in_progress
oh task update my-team <task-id> --status completed
clawteam task update my-team <task-id> --status in_progress
clawteam task update my-team <task-id> --status completed
# Filter tasks
oh task list my-team --status blocked
oh task list my-team --owner worker1
oh task list my-team --priority high
clawteam task list my-team --status blocked
clawteam task list my-team --owner worker1
clawteam task list my-team --priority high
```
### Waiting for Sub-Agents
```bash
oh task wait my-team
oh task wait my-team --timeout 300 --poll-interval 10
oh task wait my-team --agent coordinator
oh --json task wait my-team --timeout 600
clawteam task wait my-team
clawteam task wait my-team --timeout 300 --poll-interval 10
clawteam task wait my-team --agent coordinator
clawteam --json task wait my-team --timeout 600
```
### Worker Loop Protocol
@@ -166,13 +166,13 @@ Workers should not stop after completing the initial `--task`. The expected loop
```bash
# 1. Check tasks assigned to you
oh task list my-team --owner worker1
clawteam task list my-team --owner worker1
# 2. Finish any pending work, then check for new instructions
oh inbox receive my-team --agent worker1
clawteam inbox receive my-team --agent worker1
# 3. If idle, notify the leader and keep monitoring for follow-ups
oh lifecycle idle my-team
clawteam lifecycle idle my-team
```
Repeat the loop until the leader explicitly shuts the worker down.
@@ -180,9 +180,9 @@ Repeat the loop until the leader explicitly shuts the worker down.
### Git Context and Conflict Checks
```bash
oh context log my-team
oh context conflicts my-team
oh context inject my-team --agent worker1
clawteam context log my-team
clawteam context conflicts my-team
clawteam context inject my-team --agent worker1
```
Use these before reassigning work, continuing another worker's task, or merging overlapping changes.
@@ -190,16 +190,16 @@ Use these before reassigning work, continuing another worker's task, or merging
### Snapshots and Recovery
```bash
oh team snapshot my-team --tag before-refactor
oh team snapshots my-team
oh team restore my-team --snapshot before-refactor
clawteam team snapshot my-team --tag before-refactor
clawteam team snapshots my-team
clawteam team restore my-team --snapshot before-refactor
```
### Activity Visualization
```bash
oh board gource my-team --log-only
oh board gource my-team --live
clawteam board gource my-team --log-only
clawteam board gource my-team --live
```
Prefer `--log-only` in headless environments.
@@ -240,9 +240,9 @@ Configure non-default providers through `profile` + `preset` instead of hardcodi
All commands support `--json` for machine-readable output. Put the flag before the subcommand:
```bash
oh --json team discover
oh --json board show my-team
oh --json task list my-team --status pending
clawteam --json team discover
clawteam --json board show my-team
clawteam --json task list my-team --status pending
```
## Important Notes
@@ -252,15 +252,15 @@ oh --json task list my-team --status pending
- Completing a task auto-unblocks tasks that list it in `blockedBy`.
- Tasks also support `priority`; use `high` for urgent unblockers and production fixes.
- Workers are expected to keep polling tasks/inbox after the first task instead of exiting immediately.
- `oh spawn` defaults to tmux, git worktree isolation, and skip-permissions.
- `oh launch` also respects `skip_permissions`, so template workers no longer stall on approval prompts.
- `clawteam spawn` defaults to tmux, git worktree isolation, and skip-permissions.
- `clawteam launch` also respects `skip_permissions`, so template workers no longer stall on approval prompts.
- All file writes use atomic tmp+rename to prevent corruption.
- Identity env vars are set automatically when spawning via `oh spawn`.
- Identity env vars are set automatically when spawning via `clawteam spawn`.
- Use `board attach <team>` to watch all agents in a tiled tmux layout.
- `board show` JSON and the browser board now include message history with member-aware aliases, which is useful for inbox triage and handoffs.
- Prefer `--profile` for non-default providers/models instead of manually exporting provider env vars.
- `profile` is the final runtime object; `preset` is a reusable template for generating profiles.
- For Claude Code on a fresh machine/home, run `oh profile doctor claude` once before spawning.
- For Claude Code on a fresh machine/home, run `clawteam profile doctor claude` once before spawning.
- `context inject` and `context conflicts` are the recommended way to hand off cross-worktree tasks safely.
## Additional Resources