Skip to content

Commit 48c4e8a

Browse files
MrFlounderclaude
andcommitted
feat(ws): add --team flag for agent teams integration
- Add --team flag to workspace commands for Claude Code Agent Teams - Include default team prompt for generic multi-agent collaboration - Support custom team prompts via --team "prompt" - Update help and cheat sheet with team examples - Bump version to 0.6.0 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 47838d2 commit 48c4e8a

2 files changed

Lines changed: 56 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## [0.6.0] - 2026-02-05
4+
5+
### Added
6+
- **Agent Teams integration**: start Claude Code with collaborative agent teams
7+
- `crab ws <N> --team` — start workspace with agent team mode
8+
- `crab ws <N> --team "custom prompt"` — start with custom team prompt
9+
- Default team prompt for generic multi-agent collaboration
10+
- Environment setup for agent teams feature (`CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS`)
11+
- Tmux teammate mode for split-pane agent display
12+
313
## [0.5.0] - 2026-02-04
414

515
### Added

src/crabcode

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,17 @@
2727

2828
set -e
2929

30-
VERSION="0.5.0"
30+
VERSION="0.6.0"
3131
CONFIG_DIR="$HOME/.crabcode"
3232
CONFIG_FILE="$CONFIG_DIR/config.yaml"
3333
WIP_BASE="$CONFIG_DIR/wip"
3434
PROJECTS_DIR="$CONFIG_DIR/projects"
3535
GLOBAL_CONFIG="$CONFIG_DIR/config.yaml"
3636
PROJECT_ALIAS=""
37+
TEAM_PROMPT=""
38+
39+
# Default team prompt (used when --team is passed without a custom prompt)
40+
DEFAULT_TEAM_PROMPT="Create an agent team to help with this task. You are the team lead working in a crabcode workspace. Spawn teammates as needed for parallel work - research, implementation, review, or debugging. Coordinate the team, assign tasks, and synthesize results. The shared codebase is in this directory."
3741

3842
# Colors
3943
RED='\033[0;31m'
@@ -1297,6 +1301,14 @@ open_workspace() {
12971301
local dev_cmd=$(get_pane_command "server")
12981302
local claude_cmd=$(get_pane_command "main")
12991303

1304+
# If team mode, append the team prompt to claude command
1305+
if [ -n "${TEAM_PROMPT:-}" ]; then
1306+
# Escape single quotes in team prompt for shell
1307+
local escaped_prompt="${TEAM_PROMPT//\'/\'\\\'\'}"
1308+
claude_cmd="$claude_cmd -p '$escaped_prompt'"
1309+
echo -e "${MAGENTA}Team mode enabled${NC}"
1310+
fi
1311+
13001312
# Port override if needed
13011313
if [ "$need_override" = "true" ]; then
13021314
dev_cmd="PORT=$api_port APP_PORT=$app_port $dev_cmd"
@@ -6107,6 +6119,8 @@ show_cheat() {
61076119
║ crab ws new Create next available workspace ║
61086120
║ crab ws <N> Open/create workspace N ║
61096121
║ crab ws <N> --separate Open in new terminal window ║
6122+
║ crab ws <N> --team Start with agent team (Claude spawns teammates) ║
6123+
║ crab ws <N> -t "prompt" Start team with custom prompt ║
61106124
║ crab ws <N> restart Reset git + restart panes ║
61116125
║ crab ws <N> cleanup Kill window + reset to origin/main ║
61126126
║ crab ws <N> destroy Completely remove workspace (worktree + files) ║
@@ -6247,6 +6261,7 @@ show_help() {
62476261
echo " ws <N> cleanup Kill window + reset to origin/main"
62486262
echo " ws <N> continue Resume with --continue flag"
62496263
echo " ws <N> --separate Open in new terminal window"
6264+
echo " ws <N> --team Start with agent team"
62506265
echo ""
62516266
echo "Shortcuts (auto-detect workspace):"
62526267
echo " <N> Shorthand for: ws <N>"
@@ -6309,6 +6324,29 @@ handle_ws_command() {
63096324
*)
63106325
if [[ "$arg" =~ ^[0-9]+$ ]]; then
63116326
local num="$arg"
6327+
local team_prompt=""
6328+
6329+
# Parse remaining args for --team flag
6330+
local remaining_args=()
6331+
while [ $# -gt 0 ]; do
6332+
case "$1" in
6333+
--team|-t)
6334+
if [ -n "${2:-}" ] && [[ "${2:-}" != -* ]]; then
6335+
team_prompt="$2"
6336+
shift 2
6337+
else
6338+
team_prompt="$DEFAULT_TEAM_PROMPT"
6339+
shift
6340+
fi
6341+
;;
6342+
*)
6343+
remaining_args+=("$1")
6344+
shift
6345+
;;
6346+
esac
6347+
done
6348+
set -- "${remaining_args[@]}"
6349+
63126350
case "${1:-}" in
63136351
"cleanup"|"clean")
63146352
cleanup_workspace "$num"
@@ -6329,11 +6367,16 @@ handle_ws_command() {
63296367
handle_wip_for_workspace "$num" "${@:2}"
63306368
;;
63316369
"")
6332-
open_workspace "$num"
6370+
if [ -n "$team_prompt" ]; then
6371+
TEAM_PROMPT="$team_prompt"
6372+
open_workspace "$num"
6373+
else
6374+
open_workspace "$num"
6375+
fi
63336376
;;
63346377
*)
63356378
error "Unknown command: crab ws $num $1"
6336-
echo "Try: crab ws $num restart|cleanup|continue|wip"
6379+
echo "Try: crab ws $num restart|cleanup|continue|wip|--team"
63376380
exit 1
63386381
;;
63396382
esac

0 commit comments

Comments
 (0)