Skip to content

Commit 3bc5c1c

Browse files
MrFlounderclaude
andcommitted
fix(team): use CLAUDE.md for team context instead of -p flag
The -p flag makes Claude run non-interactively, which exits after responding. Instead, write team instructions to .claude/CLAUDE.md so Claude sees the context but stays in interactive mode. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 48c4e8a commit 3bc5c1c

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

src/crabcode

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,12 +1301,26 @@ open_workspace() {
13011301
local dev_cmd=$(get_pane_command "server")
13021302
local claude_cmd=$(get_pane_command "main")
13031303

1304-
# If team mode, append the team prompt to claude command
1304+
# If team mode, write team context to CLAUDE.md for interactive session
13051305
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}"
1306+
local team_file="$dir/.claude/CLAUDE.md"
1307+
mkdir -p "$dir/.claude"
1308+
1309+
# Write team instructions to CLAUDE.md (overwrites any existing team section)
1310+
if [ -f "$team_file" ]; then
1311+
# Remove existing team section if present, then append
1312+
sed -i '' '/^## Team Mode$/,/^## /{ /^## Team Mode$/d; /^## /!d; }' "$team_file" 2>/dev/null || true
1313+
fi
1314+
1315+
cat >> "$team_file" << EOF
1316+
1317+
## Team Mode
1318+
1319+
$TEAM_PROMPT
1320+
1321+
When the user provides a task, spawn teammates as needed using the Task tool.
1322+
EOF
1323+
echo -e "${MAGENTA}Team mode enabled - instructions written to .claude/CLAUDE.md${NC}"
13101324
fi
13111325

13121326
# Port override if needed

0 commit comments

Comments
 (0)