Skip to content

Commit ec7dd91

Browse files
MrFlounderclaude
andcommitted
fix(team): restart Claude pane when --team used on existing window
When a workspace window already exists, --team now restarts the Claude pane so it picks up the new CLAUDE.md context. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3bc5c1c commit ec7dd91

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/crabcode

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,17 @@ EOF
13441344
else
13451345
# Session exists
13461346
if tmux list-windows -t "$SESSION_NAME" -F "#{window_name}" 2>/dev/null | grep -q "^$window_name$"; then
1347-
echo -e "${CYAN}Switching to workspace $num...${NC}"
1347+
# If team mode and window exists, restart the main pane so Claude sees new context
1348+
if [ -n "${TEAM_PROMPT:-}" ]; then
1349+
echo -e "${CYAN}Team mode: restarting Claude in workspace $num...${NC}"
1350+
# Find the main pane (usually pane 2) and restart Claude
1351+
local main_pane="${SESSION_NAME}:${window_name}.2"
1352+
tmux send-keys -t "$main_pane" C-c 2>/dev/null || true
1353+
sleep 0.5
1354+
tmux send-keys -t "$main_pane" "$claude_cmd" Enter 2>/dev/null || true
1355+
else
1356+
echo -e "${CYAN}Switching to workspace $num...${NC}"
1357+
fi
13481358
if [ -n "$TMUX" ]; then
13491359
tmux select-window -t "$SESSION_NAME:$window_name"
13501360
else

0 commit comments

Comments
 (0)