You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(team): always enable team mode, fix restart layout
Changes:
- Team mode is now always enabled (instructions in CLAUDE.md)
- Removed --team flag (no longer needed)
- `crab restart` now kills and recreates the full window layout
- Fixes issue where closed panes weren't restored
- Updated help text
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
# 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."
41
37
42
38
# Colors
43
39
RED='\033[0;31m'
@@ -1301,38 +1297,18 @@ open_workspace() {
1301
1297
local dev_cmd=$(get_pane_command "server")
1302
1298
local claude_cmd=$(get_pane_command "main")
1303
1299
1304
-
#Handle team mode: add or remove team section from CLAUDE.md
1300
+
#Always ensure team context exists in CLAUDE.md
1305
1301
local team_file="$dir/.claude/CLAUDE.md"
1306
-
if [ -n"${TEAM_PROMPT:-}" ];then
1307
-
# Team mode ON: add team section
1308
-
mkdir -p "$dir/.claude"
1309
-
1310
-
# Remove existing team section if present, then append new one
1311
-
if [ -f"$team_file" ];then
1312
-
# Remove team section (from ## Team Mode to next ## or end of file)
1313
-
sed -i '''/^## Team Mode$/,/^## [^T]/{ /^## Team Mode$/d; /^## [^T]/!d; }'"$team_file"2>/dev/null ||true
1314
-
# Also handle if Team Mode is last section (no following ##)
1315
-
sed -i '''/^## Team Mode$/,$d'"$team_file"2>/dev/null ||true
1316
-
fi
1302
+
mkdir -p "$dir/.claude"
1317
1303
1318
-
cat >>"$team_file"<<EOF
1304
+
# Add team section if not present
1305
+
if! grep -q "^## Team Mode$""$team_file"2>/dev/null;then
1306
+
cat >>"$team_file"<< 'EOF'
1319
1307
1320
1308
## Team Mode
1321
1309
1322
-
$TEAM_PROMPT
1323
-
1324
-
When the user provides a task, spawn teammates as needed using the Task tool.
1310
+
You can spawn agent teammates for complex tasks. Use the Task tool to create specialized agents (researcher, implementer, reviewer, debugger) that work in parallel. Coordinate the team, assign tasks, and synthesize results. Only spawn teams when the task benefits from parallel work.
1325
1311
EOF
1326
-
echo -e "${MAGENTA}Team mode enabled${NC}"
1327
-
else
1328
-
# Team mode OFF: remove team section if it exists
1329
-
if [ -f"$team_file" ];then
1330
-
# Remove team section
1331
-
sed -i '''/^## Team Mode$/,/^## [^T]/{ /^## Team Mode$/d; /^## [^T]/!d; }'"$team_file"2>/dev/null ||true
1332
-
sed -i '''/^## Team Mode$/,$d'"$team_file"2>/dev/null ||true
1333
-
# Clean up trailing whitespace
1334
-
sed -i '' -e :a -e '/^\n*$/{$d;N;ba' -e '}'"$team_file"2>/dev/null ||true
0 commit comments