/ utils / swarm / constants.ts
constants.ts
 1  export const TEAM_LEAD_NAME = 'team-lead'
 2  export const SWARM_SESSION_NAME = 'claude-swarm'
 3  export const SWARM_VIEW_WINDOW_NAME = 'swarm-view'
 4  export const TMUX_COMMAND = 'tmux'
 5  export const HIDDEN_SESSION_NAME = 'claude-hidden'
 6  
 7  /**
 8   * Gets the socket name for external swarm sessions (when user is not in tmux).
 9   * Uses a separate socket to isolate swarm operations from user's tmux sessions.
10   * Includes PID to ensure multiple Claude instances don't conflict.
11   */
12  export function getSwarmSocketName(): string {
13    return `claude-swarm-${process.pid}`
14  }
15  
16  /**
17   * Environment variable to override the command used to spawn teammate instances.
18   * If not set, defaults to process.execPath (the current Claude binary).
19   * This allows customization for different environments or testing.
20   */
21  export const TEAMMATE_COMMAND_ENV_VAR = 'CLAUDE_CODE_TEAMMATE_COMMAND'
22  
23  /**
24   * Environment variable set on spawned teammates to indicate their assigned color.
25   * Used for colored output and pane identification.
26   */
27  export const TEAMMATE_COLOR_ENV_VAR = 'CLAUDE_CODE_AGENT_COLOR'
28  
29  /**
30   * Environment variable set on spawned teammates to require plan mode before implementation.
31   * When set to 'true', teammates must enter plan mode and get approval before writing code.
32   */
33  export const PLAN_MODE_REQUIRED_ENV_VAR = 'CLAUDE_CODE_PLAN_MODE_REQUIRED'